all repos — mgba @ 85fa3ac406e6b6c024568ebf214241f85dd19e89

mGBA Game Boy Advance Emulator

Qt: Fix crash if a game pauses before any frames are shown
Jeffrey Pfau jeffrey@endrift.com
Mon, 19 Jan 2015 02:40:55 -0800
commit

85fa3ac406e6b6c024568ebf214241f85dd19e89

parent

50b3bf750e2071edebd29f5fc0780b981dfd047f

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

jump to
M CHANGESCHANGES

@@ -37,6 +37,7 @@ - GBA Video: Fix mode 0 being able to read tiles above appropriate tile range

- GBA Audio: Properly initialize audio FIFO channels - Util: Fix SOCKET_FAILED macro - GBA: Fix timers 2 and 3 updating incorrectly + - Qt: Fix crash if a game pauses before any frames are shown Misc: - Qt: Disable sync to video by default - GBA: Exit cleanly on FATAL if the port supports it
M src/platform/qt/Window.cppsrc/platform/qt/Window.cpp

@@ -363,11 +363,15 @@ }

} void Window::showFPS() { + char title[13] = { '\0' }; + GBAGetGameTitle(m_controller->thread()->gba, title); + if (m_frameList.isEmpty()) { + setWindowTitle(tr(PROJECT_NAME " - %1").arg(title)); + return; + } qint64 interval = m_frameList.first().msecsTo(m_frameList.last()); float fps = (m_frameList.count() - 1) * 10000.f / interval; fps = round(fps) / 10.f; - char title[13] = { '\0' }; - GBAGetGameTitle(m_controller->thread()->gba, title); setWindowTitle(tr(PROJECT_NAME " - %1 (%2 fps)").arg(title).arg(fps)); }