diff options
author | johndoe123 | 2011-07-08 19:09:33 +0000 |
---|---|---|
committer | Willem Jan Palenstijn | 2013-05-08 20:38:46 +0200 |
commit | 5c69ae21ddf535f862585a4fa5892a9a1146618f (patch) | |
tree | d7c6bbe277a528bcbb1a2f00d91846cef9e01141 /engines/neverhood/sprite.cpp | |
parent | 78d632b0eda3c7be13a265cfb9fa5d16c7b418eb (diff) | |
download | scummvm-rg350-5c69ae21ddf535f862585a4fa5892a9a1146618f.tar.gz scummvm-rg350-5c69ae21ddf535f862585a4fa5892a9a1146618f.tar.bz2 scummvm-rg350-5c69ae21ddf535f862585a4fa5892a9a1146618f.zip |
NEVERHOOD: More work on Klayman (still eye cancerous code)
- Start to implement KmScene1001
- Implement queryPositionSprite and queryPositionRectList
- Implement message list related code (setting and running them)
- Access to message params now with accessors (so compatible types can be converted)
Diffstat (limited to 'engines/neverhood/sprite.cpp')
-rw-r--r-- | engines/neverhood/sprite.cpp | 30 |
1 files changed, 27 insertions, 3 deletions
diff --git a/engines/neverhood/sprite.cpp b/engines/neverhood/sprite.cpp index ce21527384..d9257502a0 100644 --- a/engines/neverhood/sprite.cpp +++ b/engines/neverhood/sprite.cpp @@ -384,7 +384,7 @@ void AnimatedSprite::updateFrameIndex() { } void AnimatedSprite::updateFrameInfo() { - debug("AnimatedSprite::updateFrameInfo()"); + debug(8, "AnimatedSprite::updateFrameInfo()"); const AnimFrameInfo &frameInfo = _animResource.getFrameInfo(_frameIndex); @@ -452,20 +452,44 @@ void AnimatedSprite::setFileHash3(uint32 fileHash2, uint32 fileHash6, uint32 fil _hashListIndex = -1; } +void AnimatedSprite::setCallback1(AnimationCb callback1) { + if (_callback1Cb) { + (this->*_callback1Cb)(); + } + SetAnimationCallback1(callback1); +} + +void AnimatedSprite::setCallback2(AnimationCb callback2) { + + if (_callback1Cb) { + // _callback1Cb has to be cleared before it's called + AnimationCb cb = _callback1Cb; + _callback1Cb = NULL; + (this->*cb)(); + } + + // TODO _callbackList = NULL; + _callback3Cb = NULL; + _callback2Cb = callback2; + + if (_callback2Cb) { + (this->*_callback2Cb)(); + } + +} + void AnimatedSprite::removeCallbacks() { if (_callback1Cb) { // _callback1Cb has to be cleared before it's called AnimationCb cb = _callback1Cb; _callback1Cb = NULL; - debug("Fire _callback1Cb"); (this->*cb)(); } if (_callback3Cb) { _callback2Cb = _callback3Cb; _callback3Cb = NULL; - debug("Fire _callback3Cb"); (this->*_callback2Cb)(); #if 0 // TODO } else if (_callbackList) { |