diff options
author | Andrew Kurushin | 2005-06-25 15:55:43 +0000 |
---|---|---|
committer | Andrew Kurushin | 2005-06-25 15:55:43 +0000 |
commit | 353e8586d478c60f2da5d1d95ece50e98b044574 (patch) | |
tree | b66bc36410015859ac1240fb5772d1be59f731cd /saga | |
parent | 003081fd5377f9daf32fcd18abe957f577b2bb81 (diff) | |
download | scummvm-rg350-353e8586d478c60f2da5d1d95ece50e98b044574.tar.gz scummvm-rg350-353e8586d478c60f2da5d1d95ece50e98b044574.tar.bz2 scummvm-rg350-353e8586d478c60f2da5d1d95ece50e98b044574.zip |
fix animation timings (now Shiala scene not stucks)
svn-id: r18463
Diffstat (limited to 'saga')
-rw-r--r-- | saga/animation.cpp | 7 | ||||
-rw-r--r-- | saga/animation.h | 8 | ||||
-rw-r--r-- | saga/saga.h | 2 | ||||
-rw-r--r-- | saga/sfuncs.cpp | 6 |
4 files changed, 13 insertions, 10 deletions
diff --git a/saga/animation.cpp b/saga/animation.cpp index 6ce761187e..b3a48a3b80 100644 --- a/saga/animation.cpp +++ b/saga/animation.cpp @@ -133,7 +133,6 @@ void Anim::play(uint16 animId, int vectorTime, bool playing) { anim = getAnimation(animId); - _vm->_render->getBufferInfo(&buf_info); displayBuffer = buf_info.bg_buf; @@ -171,7 +170,9 @@ void Anim::play(uint16 animId, int vectorTime, bool playing) { } anim->currentFrame++; - anim->completed++; + if (anim->completed != 65535) { + anim->completed++; + } if (anim->currentFrame > anim->maxFrame) { anim->currentFrame = anim->loopFrame; @@ -182,7 +183,7 @@ void Anim::play(uint16 animId, int vectorTime, bool playing) { anim->cur_frame_len = anim->resourceLength - SAGA_FRAME_HEADER_LEN; } - if (anim->flags & ANIM_STOPPING || anim->currentFrame == (uint16)-1) { + if (anim->flags & ANIM_STOPPING || anim->currentFrame == -1) { anim->state = ANIM_PAUSE; } } diff --git a/saga/animation.h b/saga/animation.h index 184c122ce9..ef6ebbd7d4 100644 --- a/saga/animation.h +++ b/saga/animation.h @@ -79,12 +79,12 @@ struct AnimationData { byte unknown06; byte unknown07; - uint16 maxFrame; - uint16 loopFrame; + int16 maxFrame; + int16 loopFrame; - uint16 start; + int16 start; - uint16 currentFrame; + int16 currentFrame; size_t *frameOffsets; uint16 completed; diff --git a/saga/saga.h b/saga/saga.h index 64a3c82725..95ef5217d7 100644 --- a/saga/saga.h +++ b/saga/saga.h @@ -105,7 +105,7 @@ enum GameObjectTypes { enum ScriptTimings { kScriptTimeTicksPerSecond = (728L/10L), - kRepeatSpeed = 40, // 25 frames/sec + kRepeatSpeedTicks = (728L/10L)/3, kNormalFadeDuration = 320, // 64 steps, 5 msec each kQuickFadeDuration = 64, // 64 steps, 1 msec each kPuzzleHintTime = 30000000L // 30 secs. used in timer diff --git a/saga/sfuncs.cpp b/saga/sfuncs.cpp index 107d315c3f..f0ef31c8ac 100644 --- a/saga/sfuncs.cpp +++ b/saga/sfuncs.cpp @@ -343,7 +343,8 @@ void Script::sfStartBgdAnim(SCRIPTFUNC_PARAMS) { int16 cycles = thread->pop(); _vm->_anim->setCycles(animId, cycles); - _vm->_anim->play(animId, kRepeatSpeed); + _vm->_anim->setFrameTime(animId, ticksToMSec(kRepeatSpeedTicks)); + _vm->_anim->play(animId, 0); debug(1, "sfStartBgdAnim(%d, %d)", animId, cycles); } @@ -656,7 +657,8 @@ void Script::sfStartBgdAnimSpeed(SCRIPTFUNC_PARAMS) { int16 speed = thread->pop(); _vm->_anim->setCycles(animId, cycles); - _vm->_anim->play(animId, ticksToMSec(speed)); + _vm->_anim->setFrameTime(animId, ticksToMSec(speed)); + _vm->_anim->play(animId, 0); debug(1, "sfStartBgdAnimSpeed(%d, %d, %d)", animId, cycles, speed); } |