mirror of https://github.com/mgba-emu/mgba.git
Qt: Fix rewinding while paused
This commit is contained in:
parent
246efef6b9
commit
9464ec2afa
|
@ -573,6 +573,7 @@ void GameController::setPaused(bool paused) {
|
||||||
if (!isLoaded() || paused == mCoreThreadIsPaused(&m_threadContext)) {
|
if (!isLoaded() || paused == mCoreThreadIsPaused(&m_threadContext)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
m_wasPaused = paused;
|
||||||
if (paused) {
|
if (paused) {
|
||||||
m_pauseAfterFrame.testAndSetRelaxed(false, true);
|
m_pauseAfterFrame.testAndSetRelaxed(false, true);
|
||||||
} else {
|
} else {
|
||||||
|
@ -646,9 +647,9 @@ void GameController::startRewinding() {
|
||||||
if (m_multiplayer && m_multiplayer->attached() > 1) {
|
if (m_multiplayer && m_multiplayer->attached() > 1) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
m_wasPaused = mCoreThreadIsPaused(&m_threadContext);
|
|
||||||
if (m_wasPaused) {
|
if (m_wasPaused) {
|
||||||
mCoreThreadUnpause(&m_threadContext);
|
setPaused(false);
|
||||||
|
m_wasPaused = true;
|
||||||
}
|
}
|
||||||
mCoreThreadSetRewinding(&m_threadContext, true);
|
mCoreThreadSetRewinding(&m_threadContext, true);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue