diff options
author | uruk | 2014-07-15 15:17:00 +0200 |
---|---|---|
committer | uruk | 2014-07-15 15:17:00 +0200 |
commit | d9471679319e5a5bbc61c71fc3a07548d242fe6d (patch) | |
tree | 2b0d94bb1332d8af509a898e087bab88158c8ad1 | |
parent | 8861b0b583f1cd56ff5e8f7a8b408f696c85f545 (diff) | |
download | scummvm-rg350-d9471679319e5a5bbc61c71fc3a07548d242fe6d.tar.gz scummvm-rg350-d9471679319e5a5bbc61c71fc3a07548d242fe6d.tar.bz2 scummvm-rg350-d9471679319e5a5bbc61c71fc3a07548d242fe6d.zip |
CGE2: Fix the intro animation.
-rw-r--r-- | engines/cge2/cge2_main.cpp | 1 | ||||
-rw-r--r-- | engines/cge2/snail.cpp | 54 |
2 files changed, 29 insertions, 26 deletions
diff --git a/engines/cge2/cge2_main.cpp b/engines/cge2/cge2_main.cpp index 29592d73f1..d0a11643e3 100644 --- a/engines/cge2/cge2_main.cpp +++ b/engines/cge2/cge2_main.cpp @@ -402,6 +402,7 @@ void CGE2Engine::movie(const char *ext) { _commandHandler->addCommand(kCmdClear, -1, 0, nullptr); _commandHandlerTurbo->addCommand(kCmdClear, -1, 0, nullptr); _spare->clear(); + _vga->_showQ->clear(); _now = now; } } diff --git a/engines/cge2/snail.cpp b/engines/cge2/snail.cpp index df4c67cbcc..7ba0c3638e 100644 --- a/engines/cge2/snail.cpp +++ b/engines/cge2/snail.cpp @@ -848,33 +848,35 @@ void CGE2Engine::feedSnail(Sprite *spr, Action snq, Hero *hero) { CommandHandler::Command *c = &comtab[ptr]; CommandHandler::Command *q = &comtab[cnt]; - int pocFre = freePockets(hero->_ref & 1); - int pocReq = 0; - CommandHandler::Command *p = c; - for (; p < q && p->_commandType != kCmdNext; p++) { // scan commands - // drop from pocket? - if ((p->_commandType == kCmdSend && p->_val != _now) - || p->_commandType == kCmdGive) { - int ref = p->_ref; - if (ref < 0) - ref = spr->_ref; - if (findActivePocket(ref) >= 0) - --pocReq; - } - // make/dispose additional room? - if (p->_commandType == kCmdRoom) { - if (p->_val == 0) + if (hero != nullptr) { + int pocFre = freePockets(hero->_ref & 1); + int pocReq = 0; + CommandHandler::Command *p = c; + for (; p < q && p->_commandType != kCmdNext; p++) { // scan commands + // drop from pocket? + if ((p->_commandType == kCmdSend && p->_val != _now) + || p->_commandType == kCmdGive) { + int ref = p->_ref; + if (ref < 0) + ref = spr->_ref; + if (findActivePocket(ref) >= 0) + --pocReq; + } + // make/dispose additional room? + if (p->_commandType == kCmdRoom) { + if (p->_val == 0) + ++pocReq; + else + --pocReq; + } + // put into pocket? + if (p->_commandType == kCmdKeep) ++pocReq; - else - --pocReq; - } - // put into pocket? - if (p->_commandType == kCmdKeep) - ++pocReq; - // overloaded? - if (pocReq > pocFre) { - pocFul(); - return; + // overloaded? + if (pocReq > pocFre) { + pocFul(); + return; + } } } |