aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorWalter van Niftrik2016-08-11 16:40:18 +0200
committerWalter van Niftrik2016-08-11 16:41:05 +0200
commita77a9bf0bf909dd80b55c6e6714361937258b579 (patch)
treeed0c26671d7ba76c79914de932a690fdb18ca74a /engines
parent5b7ad5cd15fc8b99b1a7be7f9bdaa6f4002a8f2c (diff)
downloadscummvm-rg350-a77a9bf0bf909dd80b55c6e6714361937258b579.tar.gz
scummvm-rg350-a77a9bf0bf909dd80b55c6e6714361937258b579.tar.bz2
scummvm-rg350-a77a9bf0bf909dd80b55c6e6714361937258b579.zip
ADL: Make text blinking event-recorder-compatible
Diffstat (limited to 'engines')
-rw-r--r--engines/adl/display.cpp8
-rw-r--r--engines/adl/display.h1
2 files changed, 8 insertions, 1 deletions
diff --git a/engines/adl/display.cpp b/engines/adl/display.cpp
index 858d3ac20b..d05257792c 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 bc27b7cb6b..e761e63f2e 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