From 8c99e87867766ad8c8682b9da911e783f0bde184 Mon Sep 17 00:00:00 2001 From: adelikat Date: Sun, 2 Feb 2020 11:06:30 -0600 Subject: [PATCH] MovieSession - cleanup --- BizHawk.Client.Common/movie/MovieSession.cs | 52 ++++++++++----------- 1 file changed, 24 insertions(+), 28 deletions(-) diff --git a/BizHawk.Client.Common/movie/MovieSession.cs b/BizHawk.Client.Common/movie/MovieSession.cs index 5c16e1afe6..fb83ad47fd 100644 --- a/BizHawk.Client.Common/movie/MovieSession.cs +++ b/BizHawk.Client.Common/movie/MovieSession.cs @@ -316,33 +316,6 @@ namespace BizHawk.Client.Common } // TODO: maybe someone who understands more about what's going on here could rename these step1 and step2 into something more descriptive - public bool HandleMovieLoadState_HackyStep2(TextReader reader) - { - if (Movie.NotActive()) - { - return true; - } - - if (ReadOnly) - { - } - else - { - //// fixme: this is evil (it causes crashes in binary states because InflaterInputStream can't have its position set, even to zero. - ////((StreamReader)reader).BaseStream.Position = 0; - ////((StreamReader)reader).DiscardBufferedData(); - // edit: zero 18-apr-2014 - this was solved by HackyStep1 and HackyStep2, so that the zip stream can be re-acquired instead of needing its position reset - var result = Movie.ExtractInputLog(reader, out var errorMsg); - if (!result) - { - Output(errorMsg); - return false; - } - } - - return true; - } - public bool HandleMovieLoadState_HackyStep1(TextReader reader) { if (!Movie.IsActive()) @@ -372,7 +345,7 @@ namespace BizHawk.Client.Common { if (Movie.IsFinished()) { - Movie.StartNewRecording(); + Movie.StartNewRecording(); } else if (Movie.IsPlaying()) { @@ -383,6 +356,29 @@ namespace BizHawk.Client.Common return true; } + public bool HandleMovieLoadState_HackyStep2(TextReader reader) + { + if (Movie.NotActive()) + { + return true; + } + + if (ReadOnly) + { + } + else + { + var result = Movie.ExtractInputLog(reader, out var errorMsg); + if (!result) + { + Output(errorMsg); + return false; + } + } + + return true; + } + public void ToggleMultitrack() { if (Movie.IsActive())