Skip to content

Commit

Permalink
MADS: Fix text not properly being erased when showing quotes
Browse files Browse the repository at this point in the history
  • Loading branch information
dreammaster committed Sep 6, 2014
1 parent 556414e commit 9ef6890
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
11 changes: 8 additions & 3 deletions engines/mads/nebular/menu_nebular.cpp
Expand Up @@ -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);
}

Expand Down Expand Up @@ -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);
}
}

Expand Down
1 change: 1 addition & 0 deletions engines/mads/nebular/menu_nebular.h
Expand Up @@ -151,6 +151,7 @@ class AdvertView : public EventTarget {
struct TextLine {
Common::Point _pos;
Common::String _line;
int _textDisplayIndex;
};

/**
Expand Down

0 comments on commit 9ef6890

Please sign in to comment.