[Scummvm-cvs-logs] scummvm master -> 83eb8e7ab64949f1c039e9b73abf2ae11698148a
sev-
sev at scummvm.org
Tue Aug 9 09:41:15 CEST 2011
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
83eb8e7ab6 RECORDER: Implement time compensation for playback
Commit: 83eb8e7ab64949f1c039e9b73abf2ae11698148a
https://github.com/scummvm/scummvm/commit/83eb8e7ab64949f1c039e9b73abf2ae11698148a
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2011-08-09T00:37:00-07:00
Commit Message:
RECORDER: Implement time compensation for playback
Changed paths:
common/EventRecorder.cpp
diff --git a/common/EventRecorder.cpp b/common/EventRecorder.cpp
index cf3c8b3..7383248 100644
--- a/common/EventRecorder.cpp
+++ b/common/EventRecorder.cpp
@@ -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;
}
More information about the Scummvm-git-logs
mailing list