aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorFilippos Karapetis2013-01-13 16:29:25 +0200
committerFilippos Karapetis2013-01-13 16:29:25 +0200
commitbbec4acff5ab800445095d826f7a391f46aaf6a8 (patch)
tree6c6d71fcd0eeec7eafbccf9da8dbf90aafc9306a /engines
parent981bc20337d0a1d083473ba384398ef8777443e3 (diff)
downloadscummvm-rg350-bbec4acff5ab800445095d826f7a391f46aaf6a8.tar.gz
scummvm-rg350-bbec4acff5ab800445095d826f7a391f46aaf6a8.tar.bz2
scummvm-rg350-bbec4acff5ab800445095d826f7a391f46aaf6a8.zip
TOLTECS: Fix bug #3600166 - "TOLTECS: Parrot speech cuts off Fenimore's in Cemetery"
Diffstat (limited to 'engines')
-rw-r--r--engines/toltecs/screen.cpp9
-rw-r--r--engines/toltecs/screen.h1
-rw-r--r--engines/toltecs/toltecs.cpp5
3 files changed, 15 insertions, 0 deletions
diff --git a/engines/toltecs/screen.cpp b/engines/toltecs/screen.cpp
index 2f16c29ab2..be91130c0a 100644
--- a/engines/toltecs/screen.cpp
+++ b/engines/toltecs/screen.cpp
@@ -481,6 +481,15 @@ void Screen::addTalkTextItemsToRenderQueue() {
}
}
+bool Screen::isTalkTextActive(int16 slotIndex) {
+ for (int16 i = 0; i <= _talkTextItemNum; i++) {
+ if (_talkTextItems[i].slotIndex == slotIndex && _talkTextItems[i].duration > 0)
+ return true;
+ }
+
+ return false;
+}
+
int16 Screen::getTalkTextDuration() {
return _talkTextItems[_talkTextItemNum].duration;
}
diff --git a/engines/toltecs/screen.h b/engines/toltecs/screen.h
index f4ecd2ca62..ee565e1882 100644
--- a/engines/toltecs/screen.h
+++ b/engines/toltecs/screen.h
@@ -182,6 +182,7 @@ public:
void addTalkTextRect(Font &font, int16 x, int16 &y, int16 length, int16 width, TalkTextItem *item);
void addTalkTextItemsToRenderQueue();
int16 getTalkTextDuration();
+ bool isTalkTextActive(int16 slotIndex);
void finishTalkTextItems();
void keepTalkTextItemsAlive();
diff --git a/engines/toltecs/toltecs.cpp b/engines/toltecs/toltecs.cpp
index 02a0e338a0..1a399dacc0 100644
--- a/engines/toltecs/toltecs.cpp
+++ b/engines/toltecs/toltecs.cpp
@@ -495,6 +495,11 @@ void ToltecsEngine::updateCamera() {
void ToltecsEngine::talk(int16 slotIndex, int16 slotOffset) {
byte *scanData = _script->getSlotData(slotIndex) + slotOffset;
+ // If there's another talk text at the requested slot and it's still
+ // active, don't overwrite it. Fixes bug #3600166.
+ if (_screen->isTalkTextActive(slotIndex))
+ return;
+
while (*scanData < 0xF0) {
if (*scanData == 0x19) {
scanData++;