From 3392f86dcbaf0c708e2513ca5bc3e76634459d6e 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 525d2e94b..79cb7ac09 100644 --- a/CHANGES +++ b/CHANGES @@ -35,6 +35,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: - Core: Suspend runloop when a core crashes diff --git a/src/platform/qt/DisplayGL.cpp b/src/platform/qt/DisplayGL.cpp index 6fdc30c3a..534c10532 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(); } }