mirror of https://github.com/mgba-emu/mgba.git
Qt: Fix crash if a game pauses before any frames are shown
This commit is contained in:
parent
21f9c0107a
commit
2400b760c8
1
CHANGES
1
CHANGES
|
@ -63,6 +63,7 @@ Bugfixes:
|
||||||
- GBA Audio: Properly initialize audio FIFO channels
|
- GBA Audio: Properly initialize audio FIFO channels
|
||||||
- Util: Fix SOCKET_FAILED macro
|
- Util: Fix SOCKET_FAILED macro
|
||||||
- GBA: Fix timers 2 and 3 updating incorrectly
|
- GBA: Fix timers 2 and 3 updating incorrectly
|
||||||
|
- Qt: Fix crash if a game pauses before any frames are shown
|
||||||
Misc:
|
Misc:
|
||||||
- Qt: Disable sync to video by default
|
- Qt: Disable sync to video by default
|
||||||
- GBA: Exit cleanly on FATAL if the port supports it
|
- GBA: Exit cleanly on FATAL if the port supports it
|
||||||
|
|
|
@ -413,11 +413,15 @@ void Window::recordFrame() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void Window::showFPS() {
|
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());
|
qint64 interval = m_frameList.first().msecsTo(m_frameList.last());
|
||||||
float fps = (m_frameList.count() - 1) * 10000.f / interval;
|
float fps = (m_frameList.count() - 1) * 10000.f / interval;
|
||||||
fps = round(fps) / 10.f;
|
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));
|
setWindowTitle(tr(PROJECT_NAME " - %1 (%2 fps)").arg(title).arg(fps));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue