aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTorbjörn Andersson2005-01-12 11:07:56 +0000
committerTorbjörn Andersson2005-01-12 11:07:56 +0000
commit3f211bdc323d5f7885761ca6e3af6912e4208933 (patch)
treec21ca93454a28762cd51f1b186a6f7b48a1db996
parent2f77e27ca3b8022e3ef4149cd0ce433c975d6398 (diff)
downloadscummvm-rg350-3f211bdc323d5f7885761ca6e3af6912e4208933.tar.gz
scummvm-rg350-3f211bdc323d5f7885761ca6e3af6912e4208933.tar.bz2
scummvm-rg350-3f211bdc323d5f7885761ca6e3af6912e4208933.zip
There was a slight but noticeable pause in linked animations at the moment
it changes to the link. I'm guessing that the last frame in the animation is identical to the first frame in the link. The original calls SetAlarm(&deltaAlarm[i], delta->timer) between each frame, but amends itself by calling SetAlarm(&deltaAlarm[i], 0) when the link happens. I'm trying to simulate that effect by using 0 as frame time instead of anim->frame_time. I think that's the right thing to do. svn-id: r16548
-rw-r--r--saga/animation.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/saga/animation.cpp b/saga/animation.cpp
index 998351e5a3..5022c7fa96 100644
--- a/saga/animation.cpp
+++ b/saga/animation.cpp
@@ -178,6 +178,7 @@ int Anim::play(uint16 anim_id, int vector_time, bool playing) {
size_t nextf_len;
uint16 frame;
+ int frame_time;
int result;
if (anim_id >= _anim_count) {
@@ -284,13 +285,16 @@ int Anim::play(uint16 anim_id, int vector_time, bool playing) {
link_anim->state = ANIM_PLAYING;
}
anim_id = link_anim_id;
+ frame_time = 0;
+ } else {
+ frame_time = anim->frame_time;
}
event.type = ONESHOT_EVENT;
event.code = ANIM_EVENT;
event.op = EVENT_FRAME;
event.param = anim_id;
- event.time = anim->frame_time + vector_time;
+ event.time = frame_time + vector_time;
_vm->_events->queue(&event);