mirror of
https://github.com/wheremyfoodat/Panda3DS.git
synced 2025-04-20 12:39:13 +12:00
Merge pull request #361 from wheremyfoodat/helpme
[Qt] Load ROMs via CLI arguments
This commit is contained in:
commit
a05879b247
1 changed files with 13 additions and 4 deletions
|
@ -54,6 +54,15 @@ MainWindow::MainWindow(QApplication* app, QWidget* parent) : QMainWindow(parent)
|
||||||
emu = new Emulator();
|
emu = new Emulator();
|
||||||
emu->setOutputSize(screen.surfaceWidth, screen.surfaceHeight);
|
emu->setOutputSize(screen.surfaceWidth, screen.surfaceHeight);
|
||||||
|
|
||||||
|
auto args = QCoreApplication::arguments();
|
||||||
|
if (args.size() > 1) {
|
||||||
|
auto romPath = std::filesystem::current_path() / args.at(1).toStdU16String();
|
||||||
|
if (!emu->loadROM(romPath)) {
|
||||||
|
// For some reason just .c_str() doesn't show the proper path
|
||||||
|
Helpers::warn("Failed to load ROM file: %s", romPath.string().c_str());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// The emulator graphics context for the thread should be initialized in the emulator thread due to how GL contexts work
|
// The emulator graphics context for the thread should be initialized in the emulator thread due to how GL contexts work
|
||||||
emuThread = std::thread([this]() {
|
emuThread = std::thread([this]() {
|
||||||
const RendererType rendererType = emu->getConfig().rendererType;
|
const RendererType rendererType = emu->getConfig().rendererType;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue