all repos — mgba @ d4ab0564eb899da268cddf81daa65e5d00887f2d

mGBA Game Boy Advance Emulator

Qt: Post empty frames if frameskipping
Jeffrey Pfau jeffrey@endrift.com
Sat, 18 Apr 2015 03:49:24 -0700
commit

d4ab0564eb899da268cddf81daa65e5d00887f2d

parent

e11d34d7617cd6f7c1da26dcb2d6bfbfbc5375e4

2 files changed, 8 insertions(+), 2 deletions(-)

jump to
M src/platform/qt/DisplayGL.cppsrc/platform/qt/DisplayGL.cpp

@@ -114,7 +114,9 @@ }

} void DisplayGL::framePosted(const uint32_t* buffer) { - m_painter->setBacking(buffer); + if (buffer) { + m_painter->setBacking(buffer); + } } void DisplayGL::resizeEvent(QResizeEvent* event) {
M src/platform/qt/GameController.cppsrc/platform/qt/GameController.cpp

@@ -118,7 +118,11 @@ controller->m_pauseAfterFrame = false;

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) {