diff options
author | Torbjörn Andersson | 2003-06-08 15:17:14 +0000 |
---|---|---|
committer | Torbjörn Andersson | 2003-06-08 15:17:14 +0000 |
commit | ab7f8b337869b367a7a18d6235a9b481f9d05cfb (patch) | |
tree | f845c8e1f1a6a866d9018bb7a20a090ef4c56bde /scumm/string.cpp | |
parent | 8ab745de662d1f58284a72b2db84ec69319d3491 (diff) | |
download | scummvm-rg350-ab7f8b337869b367a7a18d6235a9b481f9d05cfb.tar.gz scummvm-rg350-ab7f8b337869b367a7a18d6235a9b481f9d05cfb.tar.bz2 scummvm-rg350-ab7f8b337869b367a7a18d6235a9b481f9d05cfb.zip |
Fixed recent regression (too many blast texts) in The Dig's end credits and
made the text scroll off the screen instead of just vanishing at the top.
(The latter also applies to Full Throttle's end credits.)
svn-id: r8402
Diffstat (limited to 'scumm/string.cpp')
-rw-r--r-- | scumm/string.cpp | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/scumm/string.cpp b/scumm/string.cpp index 8f21d2d49e..aab1d45147 100644 --- a/scumm/string.cpp +++ b/scumm/string.cpp @@ -690,8 +690,25 @@ void Scumm::initCharset(int charsetno) { } void Scumm::enqueueText(const byte *text, int x, int y, byte color, byte charset, bool center) { + // The Dig will keep enqueueing texts long after they've scrolled off + // the screen, eventually overflowing the blast text queue if left + // unchecked. + + if (y < 0) { + byte old_charset; + int font_height; + + old_charset = _charset->getCurID(); + _charset->setCurID(charset); + font_height = _charset->getFontHeight(); + _charset->setCurID(old_charset); + + if (y <= -font_height) + return; + } + BlastText &bt = _blastTextQueue[_blastTextQueuePos++]; - assert(_blastTextQueuePos <= 32); + assert(_blastTextQueuePos <= ARRAYSIZE(_blastTextQueue)); strcpy((char *)bt.text, (const char *)text); bt.xpos = x; |