mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-13 21:31:53 +00:00
Fix bug when some animations were playing too fast.
svn-id: r28924
This commit is contained in:
parent
dfde70d218
commit
9778bec419
@ -668,6 +668,14 @@ int Anim::getFrameTime(uint16 animId) {
|
||||
return anim->frameTime;
|
||||
}
|
||||
|
||||
bool Anim::isPlaying(uint16 animId) {
|
||||
AnimationData *anim;
|
||||
|
||||
anim = getAnimation(animId);
|
||||
|
||||
return (anim->state == ANIM_PLAYING);
|
||||
}
|
||||
|
||||
int16 Anim::getCurrentFrame(uint16 animId) {
|
||||
AnimationData *anim;
|
||||
|
||||
|
@ -143,6 +143,7 @@ public:
|
||||
int16 getCurrentFrame(uint16 animId);
|
||||
int getFrameTime(uint16 animId);
|
||||
int getCycles(uint16 animId);
|
||||
bool isPlaying(uint16 animId);
|
||||
|
||||
bool hasAnimation(uint16 animId) {
|
||||
if (animId >= MAX_ANIMATIONS) {
|
||||
|
@ -452,7 +452,9 @@ void Script::sfStartBgdAnim(SCRIPTFUNC_PARAMS) {
|
||||
|
||||
_vm->_anim->setCycles(animId, cycles);
|
||||
_vm->_anim->setFrameTime(animId, _vm->ticksToMSec(kRepeatSpeedTicks));
|
||||
_vm->_anim->play(animId, 0);
|
||||
|
||||
if (!_vm->_anim->isPlaying(animId))
|
||||
_vm->_anim->play(animId, 0);
|
||||
|
||||
debug(1, "sfStartBgdAnim(%d, %d)", animId, cycles);
|
||||
}
|
||||
@ -699,7 +701,9 @@ void Script::sfStartBgdAnimSpeed(SCRIPTFUNC_PARAMS) {
|
||||
|
||||
_vm->_anim->setCycles(animId, cycles);
|
||||
_vm->_anim->setFrameTime(animId, _vm->ticksToMSec(speed));
|
||||
_vm->_anim->play(animId, 0);
|
||||
|
||||
if (!_vm->_anim->isPlaying(animId))
|
||||
_vm->_anim->play(animId, 0);
|
||||
|
||||
debug(1, "sfStartBgdAnimSpeed(%d, %d, %d)", animId, cycles, speed);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user