From d4ab0564eb899da268cddf81daa65e5d00887f2d Mon Sep 17 00:00:00 2001 From: Jeffrey Pfau Date: Sat, 18 Apr 2015 03:49:24 -0700 Subject: [PATCH] Qt: Post empty frames if frameskipping --- src/platform/qt/DisplayGL.cpp | 4 +++- src/platform/qt/GameController.cpp | 6 +++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/platform/qt/DisplayGL.cpp b/src/platform/qt/DisplayGL.cpp index c827878e4..0ea9bf4b7 100644 --- a/src/platform/qt/DisplayGL.cpp +++ b/src/platform/qt/DisplayGL.cpp @@ -114,7 +114,9 @@ void DisplayGL::filter(bool filter) { } void DisplayGL::framePosted(const uint32_t* buffer) { - m_painter->setBacking(buffer); + if (buffer) { + m_painter->setBacking(buffer); + } } void DisplayGL::resizeEvent(QResizeEvent* event) { diff --git a/src/platform/qt/GameController.cpp b/src/platform/qt/GameController.cpp index adc95ab0c..d2ce032ff 100644 --- a/src/platform/qt/GameController.cpp +++ b/src/platform/qt/GameController.cpp @@ -118,7 +118,11 @@ GameController::GameController(QObject* parent) controller->gamePaused(&controller->m_threadContext); } controller->m_pauseMutex.unlock(); - controller->frameAvailable(controller->m_drawContext); + if (GBASyncDrawingFrame(&controller->m_threadContext.sync)) { + controller->frameAvailable(controller->m_drawContext); + } else { + controller->frameAvailable(nullptr); + } }; m_threadContext.logHandler = [] (GBAThread* context, enum GBALogLevel level, const char* format, va_list args) {