Qt: Allow pausing game at load (fixes mgba.io/i/1129)
Vicki Pfau vi@endrift.com
Sun, 22 Jul 2018 10:30:45 -0700
3 files changed,
12 insertions(+),
2 deletions(-)
M
CHANGES
→
CHANGES
@@ -71,6 +71,7 @@ - GB Video: Darken colors in GBA mode
- FFmpeg: Support libswresample (fixes mgba.io/i/1120, mgba.io/b/123) - FFmpeg: Support lossless h.264 encoding - Feature: Added loading savestates from command line + - Qt: Allow pausing game at load (fixes mgba.io/i/1129) 0.6.3: (2017-04-14) Bugfixes:
M
src/platform/qt/Window.cpp
→
src/platform/qt/Window.cpp
@@ -1198,12 +1198,15 @@ pause->setChecked(false);
pause->setCheckable(true); pause->setShortcut(tr("Ctrl+P")); connect(pause, &QAction::triggered, [this](bool paused) { - m_controller->setPaused(paused); + if (m_controller) { + m_controller->setPaused(paused); + } else { + m_pendingPause = paused; + } }); connect(this, &Window::paused, [pause](bool paused) { pause->setChecked(paused); }); - m_gameActions.append(pause); addControlledAction(emulationMenu, pause, "pause"); QAction* frameAdvance = new QAction(tr("&Next frame"), emulationMenu);@@ -1923,6 +1926,11 @@
if (!m_pendingState.isEmpty()) { m_controller->loadState(m_pendingState); m_pendingState = QString(); + } + + if (m_pendingPause) { + m_controller->setPaused(true); + m_pendingPause = false; } }
M
src/platform/qt/Window.h
→
src/platform/qt/Window.h
@@ -207,6 +207,7 @@ bool m_autoresume = false;
bool m_wasOpened = false; QString m_pendingPatch; QString m_pendingState; + bool m_pendingPause = false; bool m_hitUnimplementedBiosCall;