mirror of
https://github.com/libretro/scummvm.git
synced 2025-01-20 17:03:05 +00:00
RECORDER: Implement time compensation for playback
This commit is contained in:
parent
05c0c8e98b
commit
83eb8e7ab6
@ -324,6 +324,13 @@ void EventRecorder::processMillis(uint32 &millis) {
|
||||
if (_recordTimeCount > _playbackTimeCount) {
|
||||
d = readTime(_playbackTimeFile);
|
||||
|
||||
while ((_lastMillis + d > millis) && (_lastMillis + d - millis > 50)) {
|
||||
_recordMode = kPassthrough;
|
||||
g_system->delayMillis(50);
|
||||
millis = g_system->getMillis();
|
||||
_recordMode = kRecorderPlayback;
|
||||
}
|
||||
|
||||
millis = _lastMillis + d;
|
||||
_playbackTimeCount++;
|
||||
}
|
||||
@ -334,6 +341,19 @@ void EventRecorder::processMillis(uint32 &millis) {
|
||||
}
|
||||
|
||||
bool EventRecorder::processDelayMillis(uint &msecs) {
|
||||
if (_recordMode == kRecorderPlayback) {
|
||||
_recordMode = kPassthrough;
|
||||
|
||||
uint32 millis = g_system->getMillis();
|
||||
|
||||
_recordMode = kRecorderPlayback;
|
||||
|
||||
if (_lastMillis > millis) {
|
||||
// Skip delay if we're getting late
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user