Discard apihawksurface in TAStudio LoadState when frame advancing after
This fixes an issue where lua scripts could write to the screen twice when seeking to a frame in TAStudio as the screen was not cleared between the load and the following frame advance.
This fixes / expands 1a9176e12f
.
This commit is contained in:
parent
bcc0d83bf0
commit
f0bc8fbd2e
|
@ -59,7 +59,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
var lastState = GetPriorStateForFramebuffer(frame);
|
||||
if (lastState.Key > Emulator.Frame)
|
||||
{
|
||||
LoadState(lastState);
|
||||
LoadState(lastState, true);
|
||||
}
|
||||
|
||||
StartSeeking(frame);
|
||||
|
|
|
@ -932,7 +932,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
var closestState = GetPriorStateForFramebuffer(frame);
|
||||
if (closestState.Value.Length > 0 && (frame < Emulator.Frame || closestState.Key > Emulator.Frame))
|
||||
{
|
||||
LoadState(closestState);
|
||||
LoadState(closestState, true);
|
||||
}
|
||||
closestState.Value.Dispose();
|
||||
|
||||
|
@ -980,7 +980,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
}
|
||||
}
|
||||
|
||||
public void LoadState(KeyValuePair<int, Stream> state)
|
||||
public void LoadState(KeyValuePair<int, Stream> state, bool discardApiHawkSurfaces = false)
|
||||
{
|
||||
StatableEmulator.LoadStateBinary(new BinaryReader(state.Value));
|
||||
|
||||
|
@ -990,6 +990,10 @@ namespace BizHawk.Client.EmuHawk
|
|||
}
|
||||
|
||||
UpdateTools();
|
||||
if (discardApiHawkSurfaces)
|
||||
{
|
||||
DisplayManager.DiscardApiHawkSurfaces();
|
||||
}
|
||||
}
|
||||
|
||||
public void AddBranchExternal() => BookMarkControl.AddBranchExternal();
|
||||
|
|
Loading…
Reference in New Issue