Don't force users to load rom from terminal or by dragging and dropping onto executable file. Instead, open a blank window and use SDL's drag&drop feature

This commit is contained in:
SimoneN64
2023-07-10 20:48:13 +02:00
committed by wheremyfoodat
parent 008f0bfb84
commit 6ce861624d
5 changed files with 179 additions and 149 deletions

View File

@@ -5,11 +5,13 @@ int main (int argc, char *argv[]) {
emu.initGraphicsContext();
auto romPath = std::filesystem::current_path() / (argc > 1 ? argv[1] : "teapot.elf");
if (!emu.loadROM(romPath)) {
// For some reason just .c_str() doesn't show the proper path
Helpers::panic("Failed to load ROM file: %s", romPath.string().c_str());
}
if(argc > 1) {
auto romPath = std::filesystem::current_path() / argv[1];
if (!emu.loadROM(romPath)) {
// For some reason just .c_str() doesn't show the proper path
Helpers::panic("Failed to load ROM file: %s", romPath.string().c_str());
}
}
emu.run();
emu.run();
}