Permalink
Browse files

Merge pull request #11313 from unknownbrackets/load-race

 UI: Delay game config/discord until game info load
  • Loading branch information...
hrydgard committed Aug 23, 2018
2 parents 1f274a2 + 6ef7e06 commit 17de6ad2d8522d252ad34ea1fffcf864b0525cb1
Showing with 14 additions and 6 deletions.
  1. +1 −1 Common/LogManager.cpp
  2. +7 −4 UI/EmuScreen.cpp
  3. +6 −1 UI/GameInfoCache.cpp
View
@@ -99,7 +99,7 @@ static const LogNameTableEntry logTable[] = {
{LogTypes::SCECTRL, "SCECTRL"},
{LogTypes::SCEDISPLAY, "SCEDISP"},
{LogTypes::SCEFONT, "SCEFONT"},
{LogTypes::SCEGE, "SCESCEGE"},
{LogTypes::SCEGE, "SCEGE"},
{LogTypes::SCEINTC, "SCEINTC"},
{LogTypes::SCEIO, "SCEIO"},
{LogTypes::SCEKERNEL, "SCEKERNEL"},
View
@@ -189,9 +189,14 @@ void EmuScreen::bootGame(const std::string &filename) {
I18NCategory *sc = GetI18NCategory("Screen");
//pre-emptive loading of game specific config if possible, to get all the settings
invalid_ = true;
// We don't want to boot with the wrong game specific config, so wait until info is ready.
std::shared_ptr<GameInfo> info = g_gameInfoCache->GetInfo(nullptr, filename, 0);
if (info && !info->id.empty()) {
if (!info || info->pending)
return;
if (!info->id.empty()) {
g_Config.loadGameConfig(info->id);
// Reset views in case controls are in a different place.
RecreateViews();
@@ -201,8 +206,6 @@ void EmuScreen::bootGame(const std::string &filename) {
g_Discord.SetPresenceGame(sc->T("Untitled PSP game"));
}
invalid_ = true;
CoreParameter coreParam{};
coreParam.cpuCore = (CPUCore)g_Config.iCpuCore;
coreParam.gpuCore = GPUCORE_GLES;
View
@@ -353,8 +353,10 @@ class GameInfoWorkItem : public PrioritizedWorkQueueItem {
}
void run() override {
if (!info_->LoadFromPath(gamePath_))
if (!info_->LoadFromPath(gamePath_)) {
info_->pending = false;
return;
}
// In case of a remote file, check if it actually exists before locking.
if (!info_->GetFileLoader()->Exists()) {
info_->pending = false;
@@ -381,6 +383,7 @@ class GameInfoWorkItem : public PrioritizedWorkQueueItem {
goto handleELF;
}
ERROR_LOG(LOADER, "invalid pbp %s\n", pbpLoader->Path().c_str());
info_->pending = false;
info_->working = false;
return;
}
@@ -549,11 +552,13 @@ class GameInfoWorkItem : public PrioritizedWorkQueueItem {
// few files.
auto fl = info_->GetFileLoader();
if (!fl) {
info_->pending = false;
info_->working = false;
return; // Happens with UWP currently, TODO...
}
BlockDevice *bd = constructBlockDevice(info_->GetFileLoader().get());
if (!bd) {
info_->pending = false;
info_->working = false;
return; // nothing to do here..
}

0 comments on commit 17de6ad

Please sign in to comment.