HostInterface: Restore pause state after switching renderers

Fixes #148.
This commit is contained in:
Connor McLaughlin 2020-03-25 01:48:51 +10:00
parent 18cc3d5932
commit 7cd7dec668

View file

@ -1027,6 +1027,8 @@ void HostInterface::ModifyResolutionScale(s32 increment)
void HostInterface::RecreateSystem() void HostInterface::RecreateSystem()
{ {
const bool was_paused = m_paused;
std::unique_ptr<ByteStream> stream = ByteStream_CreateGrowableMemoryStream(nullptr, 8 * 1024); std::unique_ptr<ByteStream> stream = ByteStream_CreateGrowableMemoryStream(nullptr, 8 * 1024);
if (!m_system->SaveState(stream.get()) || !stream->SeekAbsolute(0)) if (!m_system->SaveState(stream.get()) || !stream->SeekAbsolute(0))
{ {
@ -1052,6 +1054,7 @@ void HostInterface::RecreateSystem()
} }
m_system->ResetPerformanceCounters(); m_system->ResetPerformanceCounters();
PauseSystem(was_paused);
} }
void HostInterface::SetTimerResolutionIncreased(bool enabled) void HostInterface::SetTimerResolutionIncreased(bool enabled)