TasMovie - small todo

This commit is contained in:
adelikat 2013-12-09 17:24:32 +00:00
parent de71c0d8c7
commit ada517d433
3 changed files with 15 additions and 1 deletions

View File

@ -9,7 +9,7 @@ namespace BizHawk.Client.Common
{ {
public class MovieRecord public class MovieRecord
{ {
private readonly byte[] _state; private byte[] _state = new byte[0];
private Dictionary<string, bool> _boolButtons = new Dictionary<string, bool>(); private Dictionary<string, bool> _boolButtons = new Dictionary<string, bool>();
public MovieRecord(Dictionary<string, bool> buttons, bool captureState) public MovieRecord(Dictionary<string, bool> buttons, bool captureState)
@ -55,6 +55,11 @@ namespace BizHawk.Client.Common
_boolButtons.Clear(); _boolButtons.Clear();
} }
public void ClearState()
{
_state = new byte[0];
}
public bool HasState public bool HasState
{ {
get { return State.Any(); } get { return State.Any(); }

View File

@ -41,5 +41,13 @@ namespace BizHawk.Client.Common
RemoveRange(index, Count - index); RemoveRange(index, Count - index);
} }
} }
public void TruncateStates(int index)
{
for (int i = index; i < Count; i++)
{
this[i].ClearState();
}
}
} }
} }

View File

@ -35,6 +35,7 @@ namespace BizHawk.Client.Common
public void ToggleButton(int frame, string buttonName) public void ToggleButton(int frame, string buttonName)
{ {
_records[frame].Buttons[buttonName] ^= true; _records[frame].Buttons[buttonName] ^= true;
Changes = true;
} }
public void SetButton(int frame, string buttonName, bool value) public void SetButton(int frame, string buttonName, bool value)