diff options
Diffstat (limited to 'src/citra_qt/main.cpp')
-rw-r--r-- | src/citra_qt/main.cpp | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/src/citra_qt/main.cpp b/src/citra_qt/main.cpp index 1bf9bc53c..304c169b9 100644 --- a/src/citra_qt/main.cpp +++ b/src/citra_qt/main.cpp @@ -26,12 +26,16 @@ #include "core/core.h" #include "core/loader/loader.h" #include "core/arm/disassembler/load_symbol_map.h" +#include "citra_qt/config.h" #include "version.h" GMainWindow::GMainWindow() { + LogManager::Init(); + Config config; + ui.setupUi(this); statusBar()->hide(); @@ -112,8 +116,10 @@ GMainWindow::GMainWindow() show(); - LogManager::Init(); - System::Init(render_window); + QStringList args = QApplication::arguments(); + if (args.length() >= 2) { + BootGame(args[1].toStdString()); + } } GMainWindow::~GMainWindow() @@ -125,10 +131,11 @@ GMainWindow::~GMainWindow() void GMainWindow::BootGame(std::string filename) { - NOTICE_LOG(MASTER_LOG, "citra starting...\n"); + NOTICE_LOG(MASTER_LOG, "Citra starting...\n"); + System::Init(render_window); if (Core::Init()) { - ERROR_LOG(MASTER_LOG, "core initialization failed, exiting..."); + ERROR_LOG(MASTER_LOG, "Core initialization failed, exiting..."); Core::Stop(); exit(1); } @@ -146,6 +153,7 @@ void GMainWindow::BootGame(std::string filename) render_window->GetEmuThread().start(); render_window->show(); + OnStartGame(); } void GMainWindow::OnMenuLoadFile() @@ -182,6 +190,7 @@ void GMainWindow::OnPauseGame() void GMainWindow::OnStopGame() { render_window->GetEmuThread().SetCpuRunning(false); + // TODO: Shutdown core ui.action_Start->setEnabled(true); ui.action_Pause->setEnabled(false); @@ -243,7 +252,6 @@ int __cdecl main(int argc, char* argv[]) QApplication::setAttribute(Qt::AA_X11InitThreads); QApplication app(argc, argv); GMainWindow main_window; - main_window.show(); return app.exec(); } |