From 6a8b265f3d025da76134235015bd8bd5d0fe494e Mon Sep 17 00:00:00 2001 From: Vicki Pfau Date: Sat, 10 Jul 2021 16:39:12 -0700 Subject: [PATCH] Qt: Fix bounded fast forward with enhancement OpenGL renderer --- CHANGES | 1 + src/platform/qt/DisplayGL.cpp | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CHANGES b/CHANGES index a81329500..41a48af9a 100644 --- a/CHANGES +++ b/CHANGES @@ -20,6 +20,7 @@ Other fixes: - Qt: Fix crash in sprite view for partially out-of-bounds sprites (fixes mgba.io/i/2165) - Qt: Fix having to press controller buttons twice for menu items (fixes mgba.io/i/2143) - Qt: Redo sensor binding to be less fragile + - Qt: Fix bounded fast forward with enhancement OpenGL renderer - Util: Fix loading UPS patches that affect the last byte of the file Misc: - Util: Improve speed of UPS patch loading diff --git a/src/platform/qt/DisplayGL.cpp b/src/platform/qt/DisplayGL.cpp index 254d47a74..e2614fcb7 100644 --- a/src/platform/qt/DisplayGL.cpp +++ b/src/platform/qt/DisplayGL.cpp @@ -460,8 +460,9 @@ void PainterGL::draw() { while (m_delayTimer.nsecsElapsed() + 1'000'000 < 1'000'000'000 / sync->fpsTarget) { QThread::usleep(500); } - forceRedraw = true; - } else if (!forceRedraw) { + forceRedraw = sync->videoFrameWait; + } + if (!forceRedraw) { forceRedraw = m_delayTimer.nsecsElapsed() + 1'000'000 >= 1'000'000'000 / m_surface->screen()->refreshRate(); } }