StateManagerDecay - pass in Global.Emulator.Frame instead of referencing it directly

This commit is contained in:
adelikat 2020-05-25 12:47:30 -05:00
parent 4e3ae130e2
commit fbb47b2297
2 changed files with 3 additions and 3 deletions
src/BizHawk.Client.Common/movie/tasproj

View File

@ -64,11 +64,11 @@ namespace BizHawk.Client.Common
}
// todo: go through all states once, remove as many as we need. refactor to not need goto
public void Trigger(int decayStates)
public void Trigger(int frame, int decayStates)
{
for (; decayStates > 0 && _tsm.Count > 1;)
{
int baseStateIndex = _tsm.GetStateIndexByFrame(Global.Emulator.Frame);
int baseStateIndex = _tsm.GetStateIndexByFrame(frame);
int baseStateFrame = _tsm.GetStateFrameByIndex(baseStateIndex) / _step; // reduce right away
int forwardPriority = -1000000;
int backwardPriority = -1000000;

View File

@ -301,7 +301,7 @@ namespace BizHawk.Client.Common
{
if (Count + 1 > MaxStates)
{
_decay.Trigger(Count + 1 - MaxStates);
_decay.Trigger(Emulator.Frame, Count + 1 - MaxStates);
}
}