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

@ -1393,6 +1393,8 @@ namespace BizHawk.MultiClient
case "Soft Reset": SoftReset(); break;
case "Toggle MultiTrack":
{
if (Global.MainForm.UserMovie.Mode > MOVIEMODE.INACTIVE)
{
Global.MovieSession.MultiTrack.IsActive = !Global.MovieSession.MultiTrack.IsActive;
if (Global.MovieSession.MultiTrack.IsActive)
@ -1404,6 +1406,11 @@ namespace BizHawk.MultiClient
Global.RenderPanel.AddMessage("MultiTrack Disabled");
Global.MovieSession.MultiTrack.RecordAll = false;
Global.MovieSession.MultiTrack.CurrentPlayer = 0;
}
else
{
Global.RenderPanel.AddMessage("MultiTrack cannot be enabled while not recording.");
}
break;
}
case "Increment Player":
@ -2139,6 +2146,8 @@ namespace BizHawk.MultiClient
}
public void ToggleReadOnly()
{
if (Global.MainForm.UserMovie.Mode > MOVIEMODE.INACTIVE)
{
ReadOnly ^= true;
if (ReadOnly)
@ -2146,6 +2155,12 @@ namespace BizHawk.MultiClient
else
Global.RenderPanel.AddMessage("Movie read+write mode");
}
else
{
Global.RenderPanel.AddMessage("No movie active");
}
}
public void SetReadOnly(bool read_only)
{

View File

@ -327,7 +327,6 @@ 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!
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)
{