mirror of
https://github.com/RetroDECK/Duckstation.git
synced 2025-02-17 03:15:39 +00:00
System: Fix crash with replacement precaching
This commit is contained in:
parent
a231fd4f22
commit
a7b7ce2720
|
@ -127,6 +127,12 @@ static std::tuple<float, float> GetMinMax(std::span<const float> values)
|
||||||
void Host::DisplayLoadingScreen(const char* message, int progress_min /*= -1*/, int progress_max /*= -1*/,
|
void Host::DisplayLoadingScreen(const char* message, int progress_min /*= -1*/, int progress_max /*= -1*/,
|
||||||
int progress_value /*= -1*/)
|
int progress_value /*= -1*/)
|
||||||
{
|
{
|
||||||
|
if (!g_gpu_device)
|
||||||
|
{
|
||||||
|
Log_InfoPrintf("%s: %d/%d", message, progress_value, progress_max);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
const auto& io = ImGui::GetIO();
|
const auto& io = ImGui::GetIO();
|
||||||
const float scale = ImGuiManager::GetGlobalScale();
|
const float scale = ImGuiManager::GetGlobalScale();
|
||||||
const float width = (400.0f * scale);
|
const float width = (400.0f * scale);
|
||||||
|
|
|
@ -1456,6 +1456,10 @@ bool System::BootSystem(SystemBootParameters parameters)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Texture replacement preloading.
|
||||||
|
// TODO: Move this and everything else below OnSystemStarted().
|
||||||
|
g_texture_replacements.SetGameID(s_running_game_serial);
|
||||||
|
|
||||||
// Good to go.
|
// Good to go.
|
||||||
s_state = State::Running;
|
s_state = State::Running;
|
||||||
SPU::GetOutputStream()->SetPaused(false);
|
SPU::GetOutputStream()->SetPaused(false);
|
||||||
|
@ -3355,6 +3359,7 @@ void System::UpdateRunningGame(const char* path, CDImage* image, bool booting)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!booting)
|
||||||
g_texture_replacements.SetGameID(s_running_game_serial);
|
g_texture_replacements.SetGameID(s_running_game_serial);
|
||||||
|
|
||||||
if (booting)
|
if (booting)
|
||||||
|
|
Loading…
Reference in a new issue