diff options
author | Marisa-Chan | 2014-03-01 20:39:24 +0700 |
---|---|---|
committer | Marisa-Chan | 2014-03-01 20:39:24 +0700 |
commit | 665014033d2163f5029a3284c3dd3cbad8d7bf1d (patch) | |
tree | 0299c0b056e6260fe4240ae524e46e057c9e4443 /engines | |
parent | 3608a0f6c6be65cc86aac7b75dbed5505859f267 (diff) | |
download | scummvm-rg350-665014033d2163f5029a3284c3dd3cbad8d7bf1d.tar.gz scummvm-rg350-665014033d2163f5029a3284c3dd3cbad8d7bf1d.tar.bz2 scummvm-rg350-665014033d2163f5029a3284c3dd3cbad8d7bf1d.zip |
ZVISION: Add functions for framedelay controlling in animation_node
Diffstat (limited to 'engines')
-rw-r--r-- | engines/zvision/animation_node.cpp | 17 | ||||
-rw-r--r-- | engines/zvision/animation_node.h | 3 |
2 files changed, 20 insertions, 0 deletions
diff --git a/engines/zvision/animation_node.cpp b/engines/zvision/animation_node.cpp index 89d0f5e451..365ff747f4 100644 --- a/engines/zvision/animation_node.cpp +++ b/engines/zvision/animation_node.cpp @@ -191,4 +191,21 @@ bool AnimationNode::stop() { return false; } +void AnimationNode::setNewFrameDelay(int32 newDelay) { + if (newDelay > 0) { + PlayNodes::iterator it = _playList.begin(); + if (it != _playList.end()) { + playnode *nod = &(*it); + float percent = (float)nod->_delay / (float)_frmDelay; + nod->_delay = percent * newDelay; // Scale to new max + } + + _frmDelay = newDelay; + } +} + +int32 AnimationNode::getFrameDelay() { + return _frmDelay; +} + } // End of namespace ZVision diff --git a/engines/zvision/animation_node.h b/engines/zvision/animation_node.h index 556ab8a51f..ff7636a31f 100644 --- a/engines/zvision/animation_node.h +++ b/engines/zvision/animation_node.h @@ -74,6 +74,9 @@ public: void addPlayNode(int32 slot, int x, int y, int x2, int y2, int start_frame, int end_frame, int loops = 1); bool stop(); + + void setNewFrameDelay(int32 newDelay); + int32 getFrameDelay(); }; } // End of namespace ZVision |