Merge pull request #2372 from TASVideos/painting-auto-restore-fix

Fix new bugs from painting during auto-restore
This commit is contained in:
RetroEdit 2020-09-03 19:08:20 +00:00 committed by GitHub
commit 1f19281ed1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 3 deletions

View File

@ -14,7 +14,7 @@ namespace BizHawk.Client.EmuHawk
if (frame <= Emulator.Frame) if (frame <= Emulator.Frame)
{ {
if ((MainForm.EmulatorPaused || !MainForm.IsSeeking) if ((MainForm.EmulatorPaused || !MainForm.IsSeeking)
&& !CurrentTasMovie.LastPositionStable) && !CurrentTasMovie.LastPositionStable && !_playbackInterrupted)
{ {
LastPositionFrame = Emulator.Frame; LastPositionFrame = Emulator.Frame;
CurrentTasMovie.LastPositionStable = true; // until new frame is emulated CurrentTasMovie.LastPositionStable = true; // until new frame is emulated

View File

@ -1018,6 +1018,13 @@ namespace BizHawk.Client.EmuHawk
private void DoTriggeredAutoRestoreIfNeeded() private void DoTriggeredAutoRestoreIfNeeded()
{ {
// Disable the seek that could have been initiated when painting.
// This must done before DoAutoRestore, otherwise it would disable the auto-restore seek.
if (_playbackInterrupted)
{
MainForm.PauseOnFrame = null;
}
if (_triggerAutoRestore) if (_triggerAutoRestore)
{ {
DoAutoRestore(); DoAutoRestore();
@ -1025,11 +1032,10 @@ namespace BizHawk.Client.EmuHawk
_triggerAutoRestore = false; _triggerAutoRestore = false;
_autoRestorePaused = null; _autoRestorePaused = null;
} }
if (_playbackInterrupted) if (_playbackInterrupted)
{ {
MainForm.UnpauseEmulator(); MainForm.UnpauseEmulator();
MainForm.PauseOnFrame = null;
_playbackInterrupted = false; _playbackInterrupted = false;
} }
} }