mirror of
https://github.com/yuzu-emu/yuzu.git
synced 2025-06-17 12:18:02 -05:00
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.
This commit is contained in:
@ -272,7 +272,15 @@ bool GMainWindow::InitializeSystem() {
|
||||
}
|
||||
|
||||
bool GMainWindow::LoadROM(const std::string& filename) {
|
||||
Loader::ResultStatus result = Loader::LoadFile(filename);
|
||||
std::unique_ptr<Loader::AppLoader> app_loader = Loader::GetFileLoader(filename);
|
||||
if (!app_loader) {
|
||||
LOG_CRITICAL(Frontend, "Failed to obtain loader for %s!", filename.c_str());
|
||||
QMessageBox::critical(this, tr("Error while loading ROM!"),
|
||||
tr("The ROM format is not supported."));
|
||||
return false;
|
||||
}
|
||||
|
||||
Loader::ResultStatus result = app_loader->Load();
|
||||
if (Loader::ResultStatus::Success != result) {
|
||||
LOG_CRITICAL(Frontend, "Failed to load ROM!");
|
||||
System::Shutdown();
|
||||
|
Reference in New Issue
Block a user