diff options
author | Alyssa Milburn | 2010-12-02 21:24:55 +0000 |
---|---|---|
committer | Alyssa Milburn | 2010-12-02 21:24:55 +0000 |
commit | eb729b5f2e5178a652c87fcdc7493eda88c1bddc (patch) | |
tree | 1e15e0ede665094de745d1ebd66b277deb4f92da /engines | |
parent | bf82f16982cc6e0f5ea6069f8ec4f9fbbc38739d (diff) | |
download | scummvm-rg350-eb729b5f2e5178a652c87fcdc7493eda88c1bddc.tar.gz scummvm-rg350-eb729b5f2e5178a652c87fcdc7493eda88c1bddc.tar.bz2 scummvm-rg350-eb729b5f2e5178a652c87fcdc7493eda88c1bddc.zip |
MOHAWK: implement kLBAnimOpDelay
svn-id: r54742
Diffstat (limited to 'engines')
-rw-r--r-- | engines/mohawk/livingbooks.cpp | 17 | ||||
-rw-r--r-- | engines/mohawk/livingbooks.h | 3 |
2 files changed, 13 insertions, 7 deletions
diff --git a/engines/mohawk/livingbooks.cpp b/engines/mohawk/livingbooks.cpp index cbaddc7d0a..cfc4b67071 100644 --- a/engines/mohawk/livingbooks.cpp +++ b/engines/mohawk/livingbooks.cpp @@ -974,8 +974,6 @@ void MohawkEngine_LivingBooks::handleNotify(NotifyEvent &event) { } LBAnimationNode::LBAnimationNode(MohawkEngine_LivingBooks *vm, LBAnimation *parent, uint16 scriptResourceId) : _vm(vm), _parent(parent) { - _currentCel = 0; - loadScript(scriptResourceId); } @@ -1042,6 +1040,7 @@ void LBAnimationNode::reset() { _currentCel = 0; _currentEntry = 0; + _delay = 0; _xPos = 0; _yPos = 0; @@ -1051,6 +1050,9 @@ NodeState LBAnimationNode::update(bool seeking) { if (_currentEntry == _scriptEntries.size()) return kLBNodeDone; + if (_delay > 0 && --_delay) + return kLBNodeRunning; + while (_currentEntry < _scriptEntries.size()) { LBAnimScriptEntry &entry = _scriptEntries[_currentEntry]; _currentEntry++; @@ -1187,11 +1189,14 @@ NodeState LBAnimationNode::update(bool seeking) { } break; - case kLBAnimOpUnknownF: - // TODO: Found in maggiesfa - // Seems to always be a uint32 as the data + case kLBAnimOpDelay: + { assert(entry.size == 4); - warning("f: UnknownF(%d)", READ_BE_UINT32(entry.data)); + uint32 delay = READ_BE_UINT32(entry.data); + debug(4, "f: Delay(%d)", delay); + _delay = delay; + return kLBNodeRunning; + } break; default: diff --git a/engines/mohawk/livingbooks.h b/engines/mohawk/livingbooks.h index 6421471496..b702820253 100644 --- a/engines/mohawk/livingbooks.h +++ b/engines/mohawk/livingbooks.h @@ -81,7 +81,7 @@ enum { kLBAnimOpReleaseSound = 0xc, kLBAnimOpResetSound = 0xd, kLBAnimOpUnknownE = 0xe, - kLBAnimOpUnknownF = 0xf + kLBAnimOpDelay = 0xf }; enum { @@ -179,6 +179,7 @@ protected: uint _currentCel; int16 _xPos, _yPos; + uint32 _delay; }; class LBAnimationItem; |