Skip to content

Commit

Permalink
Improve animation duration calculations
Browse files Browse the repository at this point in the history
  • Loading branch information
Eli2 committed Aug 20, 2016
1 parent 6daf17d commit 5b0f3ff
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/animation/Animation.cpp
Expand Up @@ -297,7 +297,7 @@ static EERIE_ANIM * TheaToEerie(const char * adr, size_t size, const res::path &
eerie->frames[i].f_rotate = (tkf2015->key_orient != 0);
eerie->frames[i].f_translate = (tkf2015->key_move != 0);

eerie->frames[i].time = AnimationDurationUs(tkf2015->num_frame * 1000 * 1000 * (1.f/24));
eerie->frames[i].time = AnimationDurationUs(s64(tkf2015->num_frame) * 1000 * 1000 / 24);

arx_assert(tkf2015->flag_frame == -1 || tkf2015->flag_frame == 9);
eerie->frames[i].stepSound = (tkf2015->flag_frame == 9);
Expand Down Expand Up @@ -447,7 +447,7 @@ static EERIE_ANIM * TheaToEerie(const char * adr, size_t size, const res::path &
}
}

eerie->anim_time = AnimationDurationMs(th->nb_frames * 1000.f * (1.f/24));
eerie->anim_time = AnimationDurationUs(s64(th->nb_frames) * 1000 * 1000 / 24);
if(eerie->anim_time < AnimationDurationMs(1)) {
eerie->anim_time = AnimationDurationMs(1);
}
Expand Down

0 comments on commit 5b0f3ff

Please sign in to comment.