fix animation timings (now Shiala scene not stucks)

svn-id: r18463
This commit is contained in:
Andrew Kurushin 2005-06-25 15:55:43 +00:00
parent 003081fd53
commit 353e8586d4
4 changed files with 13 additions and 10 deletions

View file

@ -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;
}
}

View file

@ -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;

View file

@ -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

View file

@ -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);
}