From eb729b5f2e5178a652c87fcdc7493eda88c1bddc Mon Sep 17 00:00:00 2001 From: Alyssa Milburn Date: Thu, 2 Dec 2010 21:24:55 +0000 Subject: MOHAWK: implement kLBAnimOpDelay svn-id: r54742 --- engines/mohawk/livingbooks.cpp | 17 +++++++++++------ 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; -- cgit v1.2.3