MovieSession - simplify and improve performance - remove unnecessary CopyController wrapper on MovieIn, and don't set movie controller state unless recording

This commit is contained in:
adelikat 2020-06-13 11:38:30 -05:00
parent 268ab96ae9
commit 51e1ee3a46
3 changed files with 4 additions and 5 deletions
src/BizHawk.Client.Common

View File

@ -68,7 +68,7 @@ namespace BizHawk.Client.Common
StickyXorAdapter.Source = UdLRControllerAdapter;
AutofireStickyXorAdapter.Source = StickyXorAdapter;
session.MovieIn.Source = AutofireStickyXorAdapter;
session.MovieIn = AutofireStickyXorAdapter;
session.StickySource = AutofireStickyXorAdapter;
ControllerOutput.Source = session.MovieOut;
}

View File

@ -49,7 +49,7 @@ namespace BizHawk.Client.Common
public bool NewMovieQueued => _queuedMovie != null;
public string QueuedSyncSettings => _queuedMovie.SyncSettingsJson;
public IInputAdapter MovieIn { get; } = new CopyControllerAdapter();
public IInputAdapter MovieIn { private get; set; }
public IInputAdapter MovieOut { get; } = new CopyControllerAdapter();
public IStickyController StickySource { get; set; }
@ -318,7 +318,6 @@ namespace BizHawk.Client.Common
private void LatchInputToUser()
{
MovieOut.Source = MovieIn;
MovieController.SetFrom(MovieIn); // TODO: this shouldn't be necessary anymore
}
// Latch input from the input log, if available
@ -385,7 +384,7 @@ namespace BizHawk.Client.Common
}
else
{
LatchInputToUser();
MovieController.SetFrom(MovieIn);
}
Movie.RecordFrame(Movie.Emulator.Frame, MovieController);

View File

@ -32,7 +32,7 @@ namespace BizHawk.Client.Common
/// the movie for the purpose of recording, if active,
/// or to simply pass through if inactive
/// </summary>
IInputAdapter MovieIn { get; }
IInputAdapter MovieIn { set; }
/// <summary>
/// Represents the movie input in the input chain