diff --git a/BizHawk.Client.Common/movie/SubtitleList.cs b/BizHawk.Client.Common/movie/SubtitleList.cs index 064036021d..e0331cc579 100644 --- a/BizHawk.Client.Common/movie/SubtitleList.cs +++ b/BizHawk.Client.Common/movie/SubtitleList.cs @@ -24,6 +24,7 @@ namespace BizHawk.Client.Common public override string ToString() { var sb = new StringBuilder(); + this.Sort(); ForEach(subtitle => sb.AppendLine(subtitle.ToString())); return sb.ToString(); } @@ -64,13 +65,13 @@ namespace BizHawk.Client.Common return false; } - public new SubtitleList Sort() + public new void Sort() { - List subs = this.OrderBy(s => s.Frame).ThenBy(s => s.Y).ToList(); - SubtitleList ret = new SubtitleList(); - foreach (var subtitle in subs) - ret.Add(subtitle); - return ret; + this.Sort((x, y) => + { + int result = x.Frame.CompareTo(y.Frame); + return result != 0 ? result : x.Y.CompareTo(y.Y); + }); } public string ToSubRip(double fps) diff --git a/BizHawk.Client.Common/movie/bk2/Bk2Movie.IO.cs b/BizHawk.Client.Common/movie/bk2/Bk2Movie.IO.cs index bdc2af155a..429174b7b2 100644 --- a/BizHawk.Client.Common/movie/bk2/Bk2Movie.IO.cs +++ b/BizHawk.Client.Common/movie/bk2/Bk2Movie.IO.cs @@ -97,7 +97,7 @@ namespace BizHawk.Client.Common Subtitles.AddFromString(line); } } - Subtitles = Subtitles.Sort(); + Subtitles.Sort(); }); }