Fixed Multitrack-load crash.

Also, read-only can't be toggled while no movie active. 
Same for multitrack.
This commit is contained in:
kylethomson 2011-08-17 02:06:50 +00:00
parent c5f2d02f68
commit 2243c7dcad
3 changed files with 28 additions and 14 deletions

View File

@ -1394,16 +1394,23 @@ namespace BizHawk.MultiClient
case "Toggle MultiTrack":
{
Global.MovieSession.MultiTrack.IsActive = !Global.MovieSession.MultiTrack.IsActive;
if (Global.MovieSession.MultiTrack.IsActive)
if (Global.MainForm.UserMovie.Mode > MOVIEMODE.INACTIVE)
{
Global.RenderPanel.AddMessage("MultiTrack Enabled");
Global.RenderPanel.MT = "Recording None";
Global.MovieSession.MultiTrack.IsActive = !Global.MovieSession.MultiTrack.IsActive;
if (Global.MovieSession.MultiTrack.IsActive)
{
Global.RenderPanel.AddMessage("MultiTrack Enabled");
Global.RenderPanel.MT = "Recording None";
}
else
Global.RenderPanel.AddMessage("MultiTrack Disabled");
Global.MovieSession.MultiTrack.RecordAll = false;
Global.MovieSession.MultiTrack.CurrentPlayer = 0;
}
else
Global.RenderPanel.AddMessage("MultiTrack Disabled");
Global.MovieSession.MultiTrack.RecordAll = false;
Global.MovieSession.MultiTrack.CurrentPlayer = 0;
{
Global.RenderPanel.AddMessage("MultiTrack cannot be enabled while not recording.");
}
break;
}
case "Increment Player":
@ -2140,11 +2147,19 @@ namespace BizHawk.MultiClient
public void ToggleReadOnly()
{
ReadOnly ^= true;
if (ReadOnly)
Global.RenderPanel.AddMessage("Movie read-only mode");
if (Global.MainForm.UserMovie.Mode > MOVIEMODE.INACTIVE)
{
ReadOnly ^= true;
if (ReadOnly)
Global.RenderPanel.AddMessage("Movie read-only mode");
else
Global.RenderPanel.AddMessage("Movie read+write mode");
}
else
Global.RenderPanel.AddMessage("Movie read+write mode");
{
Global.RenderPanel.AddMessage("No movie active");
}
}
public void SetReadOnly(bool read_only)

View File

@ -326,8 +326,7 @@ namespace BizHawk.MultiClient
public void LoadLogFromSavestateText(TextReader reader)
{
//We are in record mode so replace the movie log with the one from the savestate
Global.MovieSession.MultiTrack.IsActive = false; //adelikat: Hack because this is causing crashes by being true when it shouldn't!
//We are in record mode so replace the movie log with the one from the savestate
if (!Global.MovieSession.MultiTrack.IsActive)
{
if (Global.Config.EnableBackupMovies && MakeBackup && Log.Length() > 0)

View File

@ -40,7 +40,7 @@ namespace BizHawk.MultiClient
if (MovieRecords.Count > frameNum)
MovieRecords[frameNum] = frame;
else
MovieRecords.Insert(frameNum, frame);
MovieRecords.Add(frame);
}
public void AddFrameAt(string frame, int frameNum)
{