FifoManager: Extract RestoreState from PauseAndLock

Replace calls of FifoManager::PauseAndLock(do_lock=false) with new
function RestoreState for clarity.
This commit is contained in:
Dentomologist 2023-06-04 17:07:07 -07:00
parent f628a979c4
commit f497eb519e
4 changed files with 9 additions and 2 deletions

View File

@ -108,7 +108,7 @@ static void RunWithGPUThreadInactive(std::function<void()> f)
auto& fifo = system.GetFifo();
fifo.PauseAndLock(true, was_running);
f();
fifo.PauseAndLock(false, was_running);
fifo.RestoreState(was_running);
}
else
{

View File

@ -86,6 +86,12 @@ void FifoManager::PauseAndLock(bool do_lock, bool unpause_on_unlock)
}
}
void FifoManager::RestoreState(const bool was_running)
{
if (was_running)
EmulatorState(true);
}
void FifoManager::Init()
{
if (!m_config_callback_id)

View File

@ -53,6 +53,7 @@ public:
void Prepare(); // Must be called from the CPU thread.
void DoState(PointerWrap& f);
void PauseAndLock(bool do_lock, bool unpause_on_unlock);
void RestoreState(bool was_running);
void UpdateWantDeterminism(bool want);
bool UseDeterministicGPUThread() const { return m_use_deterministic_gpu_thread; }
bool UseSyncGPU() const { return m_config_sync_gpu; }

View File

@ -70,7 +70,7 @@ void VideoConfig::Refresh()
g_Config.VerifyValidity();
if (lock_gpu_thread)
system.GetFifo().PauseAndLock(false, true);
system.GetFifo().RestoreState(true);
};
s_config_changed_callback_id =