mirror of https://github.com/PCSX2/pcsx2.git
recording: Disable currently active frame advancing when opening a different recording
This commit is contained in:
parent
9936fc7f15
commit
11fe2619eb
|
@ -265,6 +265,7 @@ bool InputRecording::Create(wxString FileName, bool fromSaveState, wxString auth
|
||||||
// Write header contents
|
// Write header contents
|
||||||
inputRecordingData.WriteHeader();
|
inputRecordingData.WriteHeader();
|
||||||
state = InputRecordingMode::Recording;
|
state = InputRecordingMode::Recording;
|
||||||
|
g_InputRecordingControls.DisableFrameAdvance();
|
||||||
recordingConLog(wxString::Format(L"[REC]: Started new recording - [%s]\n", FileName));
|
recordingConLog(wxString::Format(L"[REC]: Started new recording - [%s]\n", FileName));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -309,6 +310,7 @@ bool InputRecording::Play(wxString fileName)
|
||||||
|
|
||||||
incrementUndo = true;
|
incrementUndo = true;
|
||||||
state = InputRecordingMode::Replaying;
|
state = InputRecordingMode::Replaying;
|
||||||
|
g_InputRecordingControls.DisableFrameAdvance();
|
||||||
recordingConLog(wxString::Format(L"[REC]: Replaying input recording - [%s]\n", inputRecordingData.GetFilename()));
|
recordingConLog(wxString::Format(L"[REC]: Replaying input recording - [%s]\n", inputRecordingData.GetFilename()));
|
||||||
recordingConLog(wxString::Format(L"[REC]: PCSX2 Version Used: %s\n", inputRecordingData.GetHeader().emu));
|
recordingConLog(wxString::Format(L"[REC]: PCSX2 Version Used: %s\n", inputRecordingData.GetHeader().emu));
|
||||||
recordingConLog(wxString::Format(L"[REC]: Recording File Version: %d\n", inputRecordingData.GetHeader().version));
|
recordingConLog(wxString::Format(L"[REC]: Recording File Version: %d\n", inputRecordingData.GetHeader().version));
|
||||||
|
|
|
@ -80,13 +80,12 @@ void InputRecordingControls::HandleFrameAdvanceAndPausing()
|
||||||
switchToReplay = false;
|
switchToReplay = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (g_InputRecording.IsReplaying()
|
if ((g_InputRecording.IsReplaying() && g_InputRecording.GetFrameCounter() >= g_InputRecording.GetInputRecordingData().GetTotalFrames())
|
||||||
&& g_InputRecording.GetFrameCounter() >= g_InputRecording.GetInputRecordingData().GetTotalFrames())
|
|| g_InputRecording.GetFrameCounter() == INT_MAX)
|
||||||
pauseEmulation = true;
|
pauseEmulation = true;
|
||||||
|
|
||||||
// If we havn't yet advanced atleast a single frame from when we paused, setup things to be paused
|
// If we haven't yet advanced atleast a single frame from when we paused, setup things to be paused
|
||||||
if (frameAdvancing
|
if (frameAdvancing && frameAdvanceMarker < g_InputRecording.GetFrameCounter())
|
||||||
&& (frameAdvanceMarker < g_InputRecording.GetFrameCounter() || g_InputRecording.GetFrameCounter() == INT_MAX))
|
|
||||||
{
|
{
|
||||||
frameAdvancing = false;
|
frameAdvancing = false;
|
||||||
pauseEmulation = true;
|
pauseEmulation = true;
|
||||||
|
@ -163,6 +162,11 @@ void InputRecordingControls::SetFrameCountTracker(u32 newFrame)
|
||||||
frameCountTracker = newFrame;
|
frameCountTracker = newFrame;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void InputRecordingControls::DisableFrameAdvance()
|
||||||
|
{
|
||||||
|
frameAdvancing = false;
|
||||||
|
}
|
||||||
|
|
||||||
void InputRecordingControls::TogglePause()
|
void InputRecordingControls::TogglePause()
|
||||||
{
|
{
|
||||||
if (pauseEmulation && g_InputRecording.IsReplaying()
|
if (pauseEmulation && g_InputRecording.IsReplaying()
|
||||||
|
|
|
@ -49,6 +49,9 @@ public:
|
||||||
// Resume emulation when the next pcsx2 App event is handled
|
// Resume emulation when the next pcsx2 App event is handled
|
||||||
void Resume();
|
void Resume();
|
||||||
void SetFrameCountTracker(u32 newFrame);
|
void SetFrameCountTracker(u32 newFrame);
|
||||||
|
// Sets frameAdvancing variable to false
|
||||||
|
// Used to restrict a frameAdvaceTravker value from transferring between recordings
|
||||||
|
void DisableFrameAdvance();
|
||||||
// Alternates emulation between a paused and unpaused state
|
// Alternates emulation between a paused and unpaused state
|
||||||
void TogglePause();
|
void TogglePause();
|
||||||
// Switches between recording and replaying the active input recording file
|
// Switches between recording and replaying the active input recording file
|
||||||
|
|
|
@ -82,8 +82,6 @@ public:
|
||||||
// Writes the current frame's input data to the file so it can be replayed
|
// Writes the current frame's input data to the file so it can be replayed
|
||||||
bool WriteKeyBuffer(const uint &frame, const uint port, const uint bufIndex, const u8 &buf);
|
bool WriteKeyBuffer(const uint &frame, const uint port, const uint bufIndex, const u8 &buf);
|
||||||
|
|
||||||
unsigned long recordingFrameCounter = 0;
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static const int controllerPortsSupported = 2;
|
static const int controllerPortsSupported = 2;
|
||||||
static const int controllerInputBytes = 18;
|
static const int controllerInputBytes = 18;
|
||||||
|
|
Loading…
Reference in New Issue