From 9ef68900e24ea75e3965795deeb234d4aad6cffc Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sat, 6 Sep 2014 10:44:04 -0400 Subject: [PATCH] MADS: Fix text not properly being erased when showing quotes --- engines/mads/nebular/menu_nebular.cpp | 11 ++++++++--- engines/mads/nebular/menu_nebular.h | 1 + 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/engines/mads/nebular/menu_nebular.cpp b/engines/mads/nebular/menu_nebular.cpp index d7d98a55cf7f..a217ba684d28 100644 --- a/engines/mads/nebular/menu_nebular.cpp +++ b/engines/mads/nebular/menu_nebular.cpp @@ -639,8 +639,9 @@ void TextView::processText() { // Add the new line to the list of pending lines TextLine tl; - tl._pos = Common::Point(xStart, 155); + tl._pos = Common::Point(xStart, MADS_SCENE_HEIGHT); tl._line = _currentLine; + tl._textDisplayIndex = -1; _textLines.push_back(tl); } @@ -740,14 +741,18 @@ void TextView::doFrame() { } // Scroll all active text lines up - scene._textDisplay.reset(); for (int i = _textLines.size() - 1; i >= 0; --i) { TextLine &tl = _textLines[i]; + if (tl._textDisplayIndex != -1) + // Expire the text line that's already on-screen + scene._textDisplay.expire(tl._textDisplayIndex); + tl._pos.y--; if (tl._pos.y < 0) { _textLines.remove_at(i); } else { - scene._textDisplay.add(tl._pos.x, tl._pos.y, 0x605, -1, tl._line, _font); + tl._textDisplayIndex = scene._textDisplay.add(tl._pos.x, tl._pos.y, + 0x605, -1, tl._line, _font); } } diff --git a/engines/mads/nebular/menu_nebular.h b/engines/mads/nebular/menu_nebular.h index ede4a23970a6..a22cb422b81e 100644 --- a/engines/mads/nebular/menu_nebular.h +++ b/engines/mads/nebular/menu_nebular.h @@ -151,6 +151,7 @@ class AdvertView : public EventTarget { struct TextLine { Common::Point _pos; Common::String _line; + int _textDisplayIndex; }; /**