aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorFilippos Karapetis2009-10-21 20:25:05 +0000
committerFilippos Karapetis2009-10-21 20:25:05 +0000
commit8f8af8a19b13e6ed8d0e15709d3cd5a5e972bbe3 (patch)
tree7ef7ba2c6c7bb444ff1eb319a0322ceb5d359284 /engines
parent4f58d913093925b655d9e999210999dff512c1c1 (diff)
downloadscummvm-rg350-8f8af8a19b13e6ed8d0e15709d3cd5a5e972bbe3.tar.gz
scummvm-rg350-8f8af8a19b13e6ed8d0e15709d3cd5a5e972bbe3.tar.bz2
scummvm-rg350-8f8af8a19b13e6ed8d0e15709d3cd5a5e972bbe3.zip
Make the check for global variable 84 inside SciGuiAnimate::invoke() simpler and faster
svn-id: r45313
Diffstat (limited to 'engines')
-rw-r--r--engines/sci/gui/gui_animate.cpp15
1 files changed, 6 insertions, 9 deletions
diff --git a/engines/sci/gui/gui_animate.cpp b/engines/sci/gui/gui_animate.cpp
index cf2472dfcf..4d13fd5a2c 100644
--- a/engines/sci/gui/gui_animate.cpp
+++ b/engines/sci/gui/gui_animate.cpp
@@ -64,21 +64,18 @@ bool SciGuiAnimate::invoke(List *list, int argc, reg_t *argv) {
reg_t curObject;
uint16 signal;
+ // LSL1VGA does use global variable 84, and it does point to the fastCast object. But
+ // it should not abort. Hooray for another game-specific workaround...
+ reg_t fastCastObj = (_s->_gameName != "lsl1sci") ? _s->_segMan->findObjectByName("fastCast") : NULL_REG;
+
while (curNode) {
curObject = curNode->value;
// Check if the game has a fastCast object set
// if we don't abort kAnimate processing, at least in kq5 there will be animation cels drawn into speech boxes.
reg_t global84 = _s->script_000->_localsBlock->_locals[84];
- if (!global84.isNull()) {
- if (!strcmp(_s->_segMan->getObjectName(global84), "fastCast")) {
- // Now at this point, we could safely assume that the we should abort... right? Wrong!
- // LSL1VGA does use global variable 84, and it does point to the fastCast object. But
- // it should not abort. Hooray for another game-specific workaround...
- if (_s->_gameName != "lsl1sci")
- return false;
- }
- }
+ if (!fastCastObj.isNull() && global84 == fastCastObj)
+ return false;
signal = GET_SEL32V(segMan, curObject, signal);
if (!(signal & kSignalFrozen)) {