diff options
| author | 2016-05-17 23:06:33 +0100 | |
|---|---|---|
| committer | 2016-05-21 17:09:56 +0100 | |
| commit | 8fc9c0312660aa8b74a1251f02dfedc84da5b96b (patch) | |
| tree | 490fc1f96a96654b59c933c864aa792161399cbb /src/citra_qt/main.cpp | |
| parent | Appveyor: Restore working directory after test_script (#1835) (diff) | |
| download | yuzu-8fc9c0312660aa8b74a1251f02dfedc84da5b96b.tar.gz yuzu-8fc9c0312660aa8b74a1251f02dfedc84da5b96b.tar.xz yuzu-8fc9c0312660aa8b74a1251f02dfedc84da5b96b.zip | |
Loader, Frontends: Refactor loader creation and game loading
This allows frontends to keep a single loader and use it multiple times
e.g. for code loading and SMDH parsing.
Diffstat (limited to 'src/citra_qt/main.cpp')
| -rw-r--r-- | src/citra_qt/main.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/citra_qt/main.cpp b/src/citra_qt/main.cpp index a85c94a4b..9d47014aa 100644 --- a/src/citra_qt/main.cpp +++ b/src/citra_qt/main.cpp | |||
| @@ -272,7 +272,15 @@ bool GMainWindow::InitializeSystem() { | |||
| 272 | } | 272 | } |
| 273 | 273 | ||
| 274 | bool GMainWindow::LoadROM(const std::string& filename) { | 274 | bool GMainWindow::LoadROM(const std::string& filename) { |
| 275 | Loader::ResultStatus result = Loader::LoadFile(filename); | 275 | std::unique_ptr<Loader::AppLoader> app_loader = Loader::GetFileLoader(filename); |
| 276 | if (!app_loader) { | ||
| 277 | LOG_CRITICAL(Frontend, "Failed to obtain loader for %s!", filename.c_str()); | ||
| 278 | QMessageBox::critical(this, tr("Error while loading ROM!"), | ||
| 279 | tr("The ROM format is not supported.")); | ||
| 280 | return false; | ||
| 281 | } | ||
| 282 | |||
| 283 | Loader::ResultStatus result = app_loader->Load(); | ||
| 276 | if (Loader::ResultStatus::Success != result) { | 284 | if (Loader::ResultStatus::Success != result) { |
| 277 | LOG_CRITICAL(Frontend, "Failed to load ROM!"); | 285 | LOG_CRITICAL(Frontend, "Failed to load ROM!"); |
| 278 | System::Shutdown(); | 286 | System::Shutdown(); |