diff --git a/BizHawk.Client.Common/movie/MovieRecord.cs b/BizHawk.Client.Common/movie/MovieRecord.cs index a285fef9a7..267e92dad2 100644 --- a/BizHawk.Client.Common/movie/MovieRecord.cs +++ b/BizHawk.Client.Common/movie/MovieRecord.cs @@ -9,7 +9,7 @@ namespace BizHawk.Client.Common { public class MovieRecord { - private readonly byte[] _state; + private byte[] _state = new byte[0]; private Dictionary _boolButtons = new Dictionary(); public MovieRecord(Dictionary buttons, bool captureState) @@ -55,6 +55,11 @@ namespace BizHawk.Client.Common _boolButtons.Clear(); } + public void ClearState() + { + _state = new byte[0]; + } + public bool HasState { get { return State.Any(); } diff --git a/BizHawk.Client.Common/movie/MovieRecordList.cs b/BizHawk.Client.Common/movie/MovieRecordList.cs index 34e7a74420..af78bb9166 100644 --- a/BizHawk.Client.Common/movie/MovieRecordList.cs +++ b/BizHawk.Client.Common/movie/MovieRecordList.cs @@ -41,5 +41,13 @@ namespace BizHawk.Client.Common RemoveRange(index, Count - index); } } + + public void TruncateStates(int index) + { + for (int i = index; i < Count; i++) + { + this[i].ClearState(); + } + } } } diff --git a/BizHawk.Client.Common/movie/TasMovie.cs b/BizHawk.Client.Common/movie/TasMovie.cs index 7d3db941ec..8995663f26 100644 --- a/BizHawk.Client.Common/movie/TasMovie.cs +++ b/BizHawk.Client.Common/movie/TasMovie.cs @@ -35,6 +35,7 @@ namespace BizHawk.Client.Common public void ToggleButton(int frame, string buttonName) { _records[frame].Buttons[buttonName] ^= true; + Changes = true; } public void SetButton(int frame, string buttonName, bool value)