[Scummvm-cvs-logs] scummvm master -> a77a9bf0bf909dd80b55c6e6714361937258b579

waltervn walter at vanniftrik-it.nl
Thu Aug 11 16:45:28 CEST 2016


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:
a77a9bf0bf ADL: Make text blinking event-recorder-compatible


Commit: a77a9bf0bf909dd80b55c6e6714361937258b579
    https://github.com/scummvm/scummvm/commit/a77a9bf0bf909dd80b55c6e6714361937258b579
Author: Walter van Niftrik (walter at scummvm.org)
Date: 2016-08-11T16:41:05+02:00

Commit Message:
ADL: Make text blinking event-recorder-compatible

Changed paths:
    engines/adl/display.cpp
    engines/adl/display.h



diff --git a/engines/adl/display.cpp b/engines/adl/display.cpp
index 858d3ac..d052577 100644
--- a/engines/adl/display.cpp
+++ b/engines/adl/display.cpp
@@ -133,6 +133,8 @@ Display::Display() :
 	_textBufSurface->create(DISPLAY_WIDTH * 2, DISPLAY_HEIGHT * 2, Graphics::PixelFormat::createFormatCLUT8());
 
 	createFont();
+
+	_startMillis = g_system->getMillis();
 }
 
 Display::~Display() {
@@ -487,7 +489,11 @@ void Display::updateTextSurface() {
 			r.translate(((c & 0x3f) % 16) * 7 * 2, (c & 0x3f) / 16 * 8 * 2);
 
 			if (!(c & 0x80)) {
-				if (!(c & 0x40) || ((g_system->getMillis() / 270) & 1))
+				// Blink text. We subtract _startMillis to make this compatible
+				// with the event recorder, which returns offsetted values on
+				// playback.
+				const uint32 millisPassed = g_system->getMillis() - _startMillis;
+				if (!(c & 0x40) || ((millisPassed / 270) & 1))
 					r.translate(0, 4 * 8 * 2);
 			}
 
diff --git a/engines/adl/display.h b/engines/adl/display.h
index bc27b7c..e761e63 100644
--- a/engines/adl/display.h
+++ b/engines/adl/display.h
@@ -102,6 +102,7 @@ private:
 	Graphics::Surface *_font;
 	uint _cursorPos;
 	bool _showCursor;
+	uint32 _startMillis;
 };
 
 } // End of namespace Adl






More information about the Scummvm-git-logs mailing list