System: Purge unused RecreateSystem()

This commit is contained in:
Stenzek 2024-07-14 21:30:52 +10:00
parent 154a5b35b8
commit fee888758f
No known key found for this signature in database
2 changed files with 0 additions and 41 deletions

View file

@ -2255,44 +2255,6 @@ void System::IncrementInternalFrameNumber()
s_internal_frame_number++;
}
void System::RecreateSystem()
{
Error error;
Assert(!IsShutdown());
const bool was_paused = System::IsPaused();
std::unique_ptr<ByteStream> stream = ByteStream::CreateGrowableMemoryStream(nullptr, 8 * 1024);
if (!System::SaveStateToStream(stream.get(), &error, 0, SAVE_STATE_HEADER::COMPRESSION_TYPE_NONE) ||
!stream->SeekAbsolute(0))
{
Host::ReportErrorAsync(
"Error", fmt::format("Failed to save state before system recreation. Shutting down:\n", error.GetDescription()));
DestroySystem();
return;
}
DestroySystem();
SystemBootParameters boot_params;
if (!BootSystem(std::move(boot_params), &error))
{
Host::ReportErrorAsync("Error", fmt::format("Failed to boot system after recreation:\n{}", error.GetDescription()));
return;
}
if (!LoadStateFromStream(stream.get(), &error, false))
{
DestroySystem();
return;
}
ResetPerformanceCounters();
ResetThrottler();
if (was_paused)
PauseSystem(true);
}
bool System::CreateGPU(GPURenderer renderer, bool is_switching, Error* error)
{
const RenderAPI api = Settings::GetRenderAPIForRenderer(renderer);

View file

@ -280,9 +280,6 @@ bool SaveStateToStream(ByteStream* state, Error* error, u32 screenshot_size = 25
/// Runs the VM until the CPU execution is canceled.
void Execute();
/// Switches the GPU renderer by saving state, recreating the display window, and restoring state (if needed).
void RecreateSystem();
/// Recreates the GPU component, saving/loading the state so it is preserved. Call when the GPU renderer changes.
bool RecreateGPU(GPURenderer renderer, bool force_recreate_device = false, bool update_display = true);