MCPcopy Create free account
hub / github.com/PCSX2/pcsx2 / incFrameCounter

Method incFrameCounter

pcsx2/Recording/InputRecording.cpp:226–265  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

224}
225
226void InputRecording::incFrameCounter()
227{
228 if (!m_is_active)
229 {
230 return;
231 }
232
233 if (m_frame_counter == std::numeric_limits<u32>::max())
234 {
235 InputRec::log(TRANSLATE_STR("InputRecording", "Congratulations, you've been playing for far too long and thus have reached the limit of input recording! Stopping recording now..."), Host::OSD_CRITICAL_ERROR_DURATION);
236 stop();
237 return;
238 }
239 m_frame_counter++;
240
241 if (m_controls.isReplaying())
242 {
243 InformGSThread();
244 // If we've reached the end of the recording while replaying, pause
245 if (m_frame_counter == m_file.getTotalFrames())
246 {
247 VMManager::SetPaused(true);
248 // Can also stop watching for re-records, they've watched to the end of the recording
249 m_watching_for_rerecords = false;
250 }
251 }
252 if (m_controls.isRecording())
253 {
254 m_frame_counter_stateless++;
255 m_file.setTotalFrames(m_frame_counter);
256 // If we've been in record mode and moved to the next frame, we've overrote something
257 // if this was following a save-state loading, this is considered a re-record, a.k.a an undo
258 if (m_watching_for_rerecords)
259 {
260 m_file.incrementUndoCount();
261 m_watching_for_rerecords = false;
262 }
263 InformGSThread();
264 }
265}
266
267u32 InputRecording::getFrameCounter() const
268{

Callers 1

PollInputOnCPUThreadMethod · 0.80

Calls 7

logFunction · 0.85
isReplayingMethod · 0.80
getTotalFramesMethod · 0.80
isRecordingMethod · 0.80
setTotalFramesMethod · 0.80
incrementUndoCountMethod · 0.80
maxFunction · 0.50

Tested by

no test coverage detected