From 89d919e6a9139fed2d38769f1daab81ec67b7a2d Mon Sep 17 00:00:00 2001 From: feos Date: Sun, 4 Oct 2015 21:10:40 +0300 Subject: [PATCH] tastudio: loop guid dup check. don't remove marker 0. update when going to frame 0. don't check hasDuplicate against current states if branch is not current (what was it for at all?). releases Used per branch removal. --- BizHawk.Client.Common/movie/tasproj/TasBranch.cs | 7 ++----- BizHawk.Client.Common/movie/tasproj/TasMovieMarker.cs | 2 ++ BizHawk.Client.Common/movie/tasproj/TasStateManager.cs | 4 ++-- .../tools/TAStudio/TAStudio.Navigation.cs | 2 +- 4 files changed, 7 insertions(+), 8 deletions(-) diff --git a/BizHawk.Client.Common/movie/tasproj/TasBranch.cs b/BizHawk.Client.Common/movie/tasproj/TasBranch.cs index f5a42191e6..80f0d720dd 100644 --- a/BizHawk.Client.Common/movie/tasproj/TasBranch.cs +++ b/BizHawk.Client.Common/movie/tasproj/TasBranch.cs @@ -27,11 +27,8 @@ namespace BizHawk.Client.Common { var currentHashes = this.Select(b => b.UniqueIdentifier.GetHashCode()).ToList(); - // TODO: loop until this is unique - if (currentHashes.Contains(item.UniqueIdentifier.GetHashCode())) - { - item.UniqueIdentifier = Guid.NewGuid(); - } + do item.UniqueIdentifier = Guid.NewGuid(); + while (currentHashes.Contains(item.UniqueIdentifier.GetHashCode())); base.Add(item); } diff --git a/BizHawk.Client.Common/movie/tasproj/TasMovieMarker.cs b/BizHawk.Client.Common/movie/tasproj/TasMovieMarker.cs index 1ecce08ea7..41fca12525 100644 --- a/BizHawk.Client.Common/movie/tasproj/TasMovieMarker.cs +++ b/BizHawk.Client.Common/movie/tasproj/TasMovieMarker.cs @@ -218,6 +218,8 @@ namespace BizHawk.Client.Common { if (this[i].Frame >= startFrame) { + if (i == 0) + continue; _movie.ChangeLog.AddMarkerChange(null, this[i].Frame, this[i].Message); RemoveAt(i); deletedCount++; diff --git a/BizHawk.Client.Common/movie/tasproj/TasStateManager.cs b/BizHawk.Client.Common/movie/tasproj/TasStateManager.cs index 1ad2ce7a0a..9811f9d2e4 100644 --- a/BizHawk.Client.Common/movie/tasproj/TasStateManager.cs +++ b/BizHawk.Client.Common/movie/tasproj/TasStateManager.cs @@ -698,8 +698,8 @@ namespace BizHawk.Client.Common if (!BranchStates[frame].ContainsKey(branchHash)) return -2; stateToMatch = BranchStates[frame][branchHash]; - if (States.ContainsKey(frame) && States[frame] == stateToMatch) - return -1; + //if (States.ContainsKey(frame) && States[frame] == stateToMatch) + // return -1; } // there's no state for that frame at all diff --git a/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.Navigation.cs b/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.Navigation.cs index 88899f8814..ddeb65f5ce 100644 --- a/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.Navigation.cs +++ b/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.Navigation.cs @@ -39,7 +39,7 @@ namespace BizHawk.Client.EmuHawk MaybeFollowCursor(); - return; + //return; seriously? well, maybe it's for some insane speedup, but it skipped updating when putting playback to frame zero. } else // Emulate to a future frame {