This commit is contained in:
adelikat 2019-06-15 15:44:34 -05:00
parent 2a8b4504cd
commit d4432db7f9
3 changed files with 12 additions and 13 deletions

View File

@ -38,16 +38,15 @@ namespace BizHawk.Client.Common
bool IsMarkerState(int frame);
void UpdateStateFrequency();
int GetStateIndexByFrame(int frame);
int GetStateFrameByIndex(int index);
void UpdateStateFrequency();
bool Remove(int frame);
// ********* Delete these **********
void MountWriteAccess();
// *********** Reconsider these ************/
bool RemoveState(int frame);
}
}

View File

@ -90,7 +90,7 @@ namespace BizHawk.Client.Common
else if (currentFrame % _step > 0)
{
// ignore the pattern if the state doesn't belong already, drop it blindly and skip everything
if (_tsm.RemoveState(currentFrame))
if (_tsm.Remove(currentFrame))
{
// decrementing this if no state was removed is BAD
decayStates--;
@ -131,7 +131,7 @@ namespace BizHawk.Client.Common
else if ((currentFrame % _step > 0) && (currentFrame + 1 != _movie.LastEditedFrame))
{
// ignore the pattern if the state doesn't belong already, drop it blindly and skip everything
if (_tsm.RemoveState(currentFrame))
if (_tsm.Remove(currentFrame))
{
// decrementing this if no state was removed is BAD
decayStates--;
@ -167,7 +167,7 @@ namespace BizHawk.Client.Common
{
if (baseStateFrame - forwardFrame > backwardFrame - baseStateFrame)
{
if (_tsm.RemoveState(forwardFrame * _step))
if (_tsm.Remove(forwardFrame * _step))
{
// decrementing this if no state was removed is BAD
decayStates--;
@ -175,7 +175,7 @@ namespace BizHawk.Client.Common
}
else
{
if (_tsm.RemoveState(backwardFrame * _step))
if (_tsm.Remove(backwardFrame * _step))
{
// decrementing this if no state was removed is BAD
decayStates--;
@ -184,7 +184,7 @@ namespace BizHawk.Client.Common
}
else if (forwardFrame > -1)
{
if (_tsm.RemoveState(forwardFrame * _step))
if (_tsm.Remove(forwardFrame * _step))
{
// decrementing this if no state was removed is BAD
decayStates--;
@ -192,7 +192,7 @@ namespace BizHawk.Client.Common
}
else if (backwardFrame > -1)
{
if (_tsm.RemoveState(backwardFrame * _step))
if (_tsm.Remove(backwardFrame * _step))
{
// decrementing this if no state was removed is BAD
decayStates--;
@ -203,7 +203,7 @@ namespace BizHawk.Client.Common
// this shouldn't happen, but if we don't do it here, nothing good will happen either
if (decayStatesLast == decayStates)
{
if (_tsm.RemoveState(_tsm.GetStateFrameByIndex(1)))
if (_tsm.Remove(_tsm.GetStateFrameByIndex(1)))
{
// decrementing this if no state was removed is BAD
decayStates--;

View File

@ -210,7 +210,7 @@ namespace BizHawk.Client.Common
foreach (var state in statesToRemove)
{
RemoveState(state.Key);
Remove(state.Key);
}
CallInvalidateCallback(frame);
@ -229,7 +229,7 @@ namespace BizHawk.Client.Common
return _movie.Markers.IsMarker(frame + 1);
}
public bool RemoveState(int frame)
public bool Remove(int frame)
{
int index = _states.IndexOfKey(frame);