Digimon World 3 decomp
The European version, SLES_039.36
Loading...
Searching...
No Matches
step_tile_animation_u8.inc.c
Go to the documentation of this file.
1/* stepTileAnimation (step_tile_animation.inc.c) with the durations read as bytes */
2s32 stepTileAnimation(StageTileAnim *obj, AnimFrame *frames, s32 once, s32 depth) {
3 AnimFrame *frame = &frames[obj->anim.index];
5
6 if (dt > 4) {
7 dt = 4;
8 }
9 if (depth == 0) {
10 obj->anim.timer -= dt;
11 }
12 if (obj->anim.timer <= 0) {
13 frame++;
14 obj->anim.index++;
15 obj->anim.timer += (u8)frame->duration;
16 if (once) {
17 if (frame->frame == 0xFF) {
18 return 0xFF;
19 }
20 } else if (frame->frame == 0xFF) {
21 frame = frames;
22 obj->anim.index = 0;
23 obj->anim.timer += (u8)frame->duration;
24 }
25 stepTileAnimation(obj, frames, once, depth + 1);
26 }
27 return frame->frame;
28}
signed int s32
Definition common.h:11
unsigned char u8
Definition common.h:8
GfxState GFX
GFX: the graphics state and its methods.
Definition display.c:209
s32 stepTileAnimation(StageTileAnim *obj, AnimFrame *frames, s32 once, s32 depth)
stepTileAnimation (step_tile_animation.inc.c) with the durations read as bytes
One frame of a sprite animation; frame 0xFF ends it (or loops it)
Definition gfx.h:296
s16 frame
Definition gfx.h:297
s16 duration
Definition gfx.h:298
s16 index
Definition gfx.h:302
s16 timer
Definition gfx.h:303
s32(* getFrameTime)(void)
Definition gfx.h:32
GfxFuncs funcs
Definition gfx.h:77
A map object with the animation that sets its frame.
Definition stage.h:108
AnimState anim
Definition stage.h:110