diff options
| author | 2014-10-30 22:44:51 -0700 | |
|---|---|---|
| committer | 2014-11-04 21:44:03 -0800 | |
| commit | 1efb83bf53036fb95235e70b955fc9e1673e3cca (patch) | |
| tree | 2b659ef13806ebffc42d4e554015b321979564ff | |
| parent | Merge pull request #182 from SeannyM/fix-compile (diff) | |
| download | yuzu-1efb83bf53036fb95235e70b955fc9e1673e3cca.tar.gz yuzu-1efb83bf53036fb95235e70b955fc9e1673e3cca.tar.xz yuzu-1efb83bf53036fb95235e70b955fc9e1673e3cca.zip | |
Qt: Auto-start game when selected, play game that's passed via argv[1].
Also moves system initialization to when the game is booted.
Diffstat (limited to '')
| -rw-r--r-- | src/citra_qt/main.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/citra_qt/main.cpp b/src/citra_qt/main.cpp index 153712273..304c169b9 100644 --- a/src/citra_qt/main.cpp +++ b/src/citra_qt/main.cpp | |||
| @@ -116,7 +116,10 @@ GMainWindow::GMainWindow() | |||
| 116 | 116 | ||
| 117 | show(); | 117 | show(); |
| 118 | 118 | ||
| 119 | System::Init(render_window); | 119 | QStringList args = QApplication::arguments(); |
| 120 | if (args.length() >= 2) { | ||
| 121 | BootGame(args[1].toStdString()); | ||
| 122 | } | ||
| 120 | } | 123 | } |
| 121 | 124 | ||
| 122 | GMainWindow::~GMainWindow() | 125 | GMainWindow::~GMainWindow() |
| @@ -129,6 +132,7 @@ GMainWindow::~GMainWindow() | |||
| 129 | void GMainWindow::BootGame(std::string filename) | 132 | void GMainWindow::BootGame(std::string filename) |
| 130 | { | 133 | { |
| 131 | NOTICE_LOG(MASTER_LOG, "Citra starting...\n"); | 134 | NOTICE_LOG(MASTER_LOG, "Citra starting...\n"); |
| 135 | System::Init(render_window); | ||
| 132 | 136 | ||
| 133 | if (Core::Init()) { | 137 | if (Core::Init()) { |
| 134 | ERROR_LOG(MASTER_LOG, "Core initialization failed, exiting..."); | 138 | ERROR_LOG(MASTER_LOG, "Core initialization failed, exiting..."); |
| @@ -149,6 +153,7 @@ void GMainWindow::BootGame(std::string filename) | |||
| 149 | render_window->GetEmuThread().start(); | 153 | render_window->GetEmuThread().start(); |
| 150 | 154 | ||
| 151 | render_window->show(); | 155 | render_window->show(); |
| 156 | OnStartGame(); | ||
| 152 | } | 157 | } |
| 153 | 158 | ||
| 154 | void GMainWindow::OnMenuLoadFile() | 159 | void GMainWindow::OnMenuLoadFile() |
| @@ -185,6 +190,7 @@ void GMainWindow::OnPauseGame() | |||
| 185 | void GMainWindow::OnStopGame() | 190 | void GMainWindow::OnStopGame() |
| 186 | { | 191 | { |
| 187 | render_window->GetEmuThread().SetCpuRunning(false); | 192 | render_window->GetEmuThread().SetCpuRunning(false); |
| 193 | // TODO: Shutdown core | ||
| 188 | 194 | ||
| 189 | ui.action_Start->setEnabled(true); | 195 | ui.action_Start->setEnabled(true); |
| 190 | ui.action_Pause->setEnabled(false); | 196 | ui.action_Pause->setEnabled(false); |
| @@ -246,7 +252,6 @@ int __cdecl main(int argc, char* argv[]) | |||
| 246 | QApplication::setAttribute(Qt::AA_X11InitThreads); | 252 | QApplication::setAttribute(Qt::AA_X11InitThreads); |
| 247 | QApplication app(argc, argv); | 253 | QApplication app(argc, argv); |
| 248 | GMainWindow main_window; | 254 | GMainWindow main_window; |
| 249 | |||
| 250 | main_window.show(); | 255 | main_window.show(); |
| 251 | return app.exec(); | 256 | return app.exec(); |
| 252 | } | 257 | } |