Skip to content

Commit

Permalink
Set up icons
Browse files Browse the repository at this point in the history
  • Loading branch information
wheremyfoodat committed Oct 7, 2023
1 parent 6ae8d08 commit 0421eae
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 7 deletions.
8 changes: 7 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ set(RENDERER_SW_SOURCE_FILES src/core/renderer_sw/renderer_sw.cpp)
if(ENABLE_QT_GUI)
set(FRONTEND_SOURCE_FILES src/panda_qt/main.cpp src/panda_qt/screen.cpp src/panda_qt/main_window.cpp)
set(FRONTEND_HEADER_FILES include/panda_qt/screen.hpp include/panda_qt/main_window.hpp)

source_group("Source Files\\Qt" FILES ${FRONTEND_SOURCE_FILES})
source_group("Header Files\\Qt" FILES ${FRONTEND_HEADER_FILES})
include_directories(${Qt6Gui_PRIVATE_INCLUDE_DIRS})
Expand Down Expand Up @@ -414,6 +414,12 @@ if(ENABLE_QT_GUI)
target_link_libraries(Alber PRIVATE OpenGL::OpenGL OpenGL::EGL OpenGL::GLX)
endif()
endif()

qt_add_resources(Alber "app_images"
PREFIX "/"
FILES
docs/img/rsob_icon.png
)
else()
target_compile_definitions(Alber PUBLIC "PANDA3DS_FRONTEND_SDL=1")
endif()
Expand Down
Binary file added docs/img/rsob_icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 5 additions & 3 deletions src/emulator.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#include "emulator.hpp"

#include <glad/gl.h>
#include <fstream>

#ifdef _WIN32
#include <windows.h>
Expand Down Expand Up @@ -583,7 +585,7 @@ void Emulator::updateDiscord() {
void Emulator::updateDiscord() {}
#endif

static void printNode(const RomFS::RomFSNode& node, const char* romFSBase, const std::filesystem::path& path) {
static void dumpRomFSNode(const RomFS::RomFSNode& node, const char* romFSBase, const std::filesystem::path& path) {
for (auto& file : node.files) {
const auto p = path / file->name;
std::ofstream outFile(p);
Expand All @@ -599,7 +601,7 @@ static void printNode(const RomFS::RomFSNode& node, const char* romFSBase, const
std::filesystem::create_directories(newPath, ec);

if (!ec) {
printNode(*directory, romFSBase, newPath);
dumpRomFSNode(*directory, romFSBase, newPath);
}
}
}
Expand Down Expand Up @@ -638,7 +640,7 @@ RomFS::DumpingResult Emulator::dumpRomFS(const std::filesystem::path& path) {
}

std::unique_ptr<RomFSNode> node = parseRomFSTree((uintptr_t)&romFS[0], size);
printNode(*node, (const char*) &romFS[0], path);
dumpRomFSNode(*node, (const char*)&romFS[0], path);

return DumpingResult::Success;
}
12 changes: 9 additions & 3 deletions src/panda_qt/main_window.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -209,11 +209,17 @@ void MainWindow::dumpRomFS() {

switch (res) {
case RomFS::DumpingResult::Success: break; // Yay!
case RomFS::DumpingResult::InvalidFormat:
QMessageBox::warning(
this, tr("Invalid format for RomFS dumping"), tr("The currently loaded app is not in a format that supports RomFS!")
case RomFS::DumpingResult::InvalidFormat: {
QMessageBox messageBox(
QMessageBox::Icon::Warning, tr("Invalid format for RomFS dumping"),
tr("The currently loaded app is not in a format that supports RomFS")
);

QAbstractButton* button = messageBox.addButton(tr("OK"), QMessageBox::ButtonRole::YesRole);
button->setIcon(QIcon(":/docs/img/rsob_icon.png"));
messageBox.exec();
break;
}

case RomFS::DumpingResult::NoRomFS:
QMessageBox::warning(this, tr("No RomFS found"), tr("No RomFS partition was found in the loaded app"));
Expand Down

0 comments on commit 0421eae

Please sign in to comment.