diff --git a/BizHawk.MultiClient/PlayMovie.cs b/BizHawk.MultiClient/PlayMovie.cs index f42a96a4b8..d22601f90f 100644 --- a/BizHawk.MultiClient/PlayMovie.cs +++ b/BizHawk.MultiClient/PlayMovie.cs @@ -102,7 +102,7 @@ namespace BizHawk.MultiClient private void PreLoadMovieFile(FileInfo path) { Movie m = new Movie(path.FullName, MOVIEMODE.INACTIVE); - //m.PreLoadText(); + m.PreLoadText(); m.LoadMovie(); if (path.Extension.ToUpper() == ".FM2") m.SetHeaderLine(MovieHeader.PLATFORM, "NES"); diff --git a/BizHawk.MultiClient/movie/Movie.cs b/BizHawk.MultiClient/movie/Movie.cs index b06c0db824..4f6447b592 100644 --- a/BizHawk.MultiClient/movie/Movie.cs +++ b/BizHawk.MultiClient/movie/Movie.cs @@ -17,6 +17,7 @@ namespace BizHawk.MultiClient private MOVIEMODE MovieMode = new MOVIEMODE(); + public int Frames = 0; public int lastLog; public int rerecordCount; @@ -234,14 +235,15 @@ namespace BizHawk.MultiClient using (StreamReader sr = file.OpenText()) { string str = ""; - + int length = 0; while ((str = sr.ReadLine()) != null) { + length += str.Length + 1; if (str == "") { continue; } - //TODO: don't reiterate this entire if chain, make a function called by this and loadmovie + //TODO: don't reiterate this entire if chain, make a function called by this and loadmovie else if (str.Contains(MovieHeader.EMULATIONVERSION)) { str = ParseHeader(str, MovieHeader.EMULATIONVERSION); @@ -274,13 +276,16 @@ namespace BizHawk.MultiClient } else if (str[0] == '|') { - break;//This right? + int line = str.Length + 1; + length -= line; + int lines = (int)file.Length - length; + this.Frames = lines / line; + break; //This right? } else { Header.Comments.Add(str); } - } sr.Close(); }