Movies - rework some things so that MovieSession is in charge of sending a movie into finished mode, as opposed to GetInutState() having the side effect of MovieFInished
This commit is contained in:
parent
f79a674219
commit
02a5337cd6
|
@ -103,13 +103,15 @@ namespace BizHawk.Client.Common
|
|||
/// </summary>
|
||||
public void LatchInputFromLog()
|
||||
{
|
||||
var input = Movie.GetInputState(Global.Emulator.Frame);
|
||||
|
||||
// Attempting to get a frame past the end of a movie changes the mode to finished
|
||||
if (!Movie.IsFinished)
|
||||
if (Global.Emulator.Frame < Movie.InputLogLength)
|
||||
{
|
||||
var input = Movie.GetInputState(Global.Emulator.Frame);
|
||||
MovieControllerAdapter.LatchFromSource(input);
|
||||
}
|
||||
else
|
||||
{
|
||||
Movie.FinishedMode();
|
||||
}
|
||||
}
|
||||
|
||||
public bool MovieLoad()
|
||||
|
|
|
@ -69,12 +69,9 @@ namespace BizHawk.Client.Common
|
|||
_mode = Moviemode.Inactive;
|
||||
}
|
||||
|
||||
protected void Finish()
|
||||
public void FinishedMode()
|
||||
{
|
||||
if (_mode == Moviemode.Play)
|
||||
{
|
||||
_mode = Moviemode.Finished;
|
||||
}
|
||||
_mode = Moviemode.Finished;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -128,7 +128,6 @@ namespace BizHawk.Client.Common
|
|||
return adapter;
|
||||
}
|
||||
|
||||
Finish();
|
||||
return null;
|
||||
}
|
||||
|
||||
|
|
|
@ -85,15 +85,9 @@ namespace BizHawk.Client.Common
|
|||
_mode = Moviemode.Inactive;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// If a movie is in playback mode, this will set it to movie finished
|
||||
/// </summary>
|
||||
private void Finish()
|
||||
public void FinishedMode()
|
||||
{
|
||||
if (_mode == Moviemode.Play)
|
||||
{
|
||||
_mode = Moviemode.Finished;
|
||||
}
|
||||
_mode = Moviemode.Finished;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -106,7 +106,6 @@ namespace BizHawk.Client.Common
|
|||
return adapter;
|
||||
}
|
||||
|
||||
Finish();
|
||||
return null;
|
||||
}
|
||||
|
||||
|
|
|
@ -157,6 +157,11 @@ namespace BizHawk.Client.Common
|
|||
/// </summary>
|
||||
void SwitchToPlay();
|
||||
|
||||
/// <summary>
|
||||
/// Tells the movie to go into "Finished" mode, where the user resumes control of input but the movie is still loaded in memory
|
||||
/// </summary>
|
||||
void FinishedMode();
|
||||
|
||||
#endregion
|
||||
|
||||
#region Editing API
|
||||
|
|
|
@ -205,7 +205,6 @@ namespace BizHawk.Client.Common
|
|||
return _log[getframe];
|
||||
}
|
||||
|
||||
Finish();
|
||||
return string.Empty;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue