From 2bf6912f394a45034a5d787560f693d2a34ec5a6 Mon Sep 17 00:00:00 2001 From: Connor McLaughlin Date: Sun, 9 Feb 2020 22:16:37 +0900 Subject: [PATCH] Qt: Simplify emulation thread loop --- src/duckstation-qt/qthostinterface.cpp | 25 +++++++------------------ 1 file changed, 7 insertions(+), 18 deletions(-) diff --git a/src/duckstation-qt/qthostinterface.cpp b/src/duckstation-qt/qthostinterface.cpp index 69811c1ff..11f440838 100644 --- a/src/duckstation-qt/qthostinterface.cpp +++ b/src/duckstation-qt/qthostinterface.cpp @@ -590,30 +590,19 @@ void QtHostInterface::threadEntryPoint() continue; } - // execute the system, polling events inbetween frames - // simulate the system if not paused m_system->RunFrame(); - // rendering - { - if (m_system) - { - DrawDebugWindows(); - m_system->GetGPU()->ResetGraphicsAPIState(); - } + m_system->GetGPU()->ResetGraphicsAPIState(); - DrawOSDMessages(); + DrawDebugWindows(); + DrawOSDMessages(); - m_display->Render(); + m_display->Render(); - if (m_system) - { - m_system->GetGPU()->RestoreGraphicsAPIState(); + m_system->GetGPU()->RestoreGraphicsAPIState(); - if (m_speed_limiter_enabled) - m_system->Throttle(); - } - } + if (m_speed_limiter_enabled) + m_system->Throttle(); m_worker_thread_event_loop->processEvents(QEventLoop::AllEvents); }