| 224 | } |
| 225 | |
| 226 | void 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 | |
| 267 | u32 InputRecording::getFrameCounter() const |
| 268 | { |
no test coverage detected