Digimon World 3 decomp
The European version, SLES_039.36
Loading...
Searching...
No Matches
step_looping_animation.inc.c
Go to the documentation of this file.
1
/*
2
* Steps ANIM through FRAMES by the frame time (at most 4), looping at the
3
* end (frame 0xFF), and returns its frame. depth is 0 for the caller: a
4
* frame that runs out goes on to the next one.
5
*/
6
s32
stepLoopingAnimation
(
AnimState
*anim,
AnimFrame
*frames,
s32
depth) {
7
AnimFrame
*frame = &frames[anim->
index
];
8
s32
dt =
GFX
.
funcs
.
getFrameTime
();
9
10
if
(dt > 4) {
11
dt = 4;
12
}
13
if
(depth == 0) {
14
anim->
timer
-= dt;
15
}
16
if
(anim->
timer
<= 0) {
17
frame++;
18
anim->
index
++;
19
anim->
timer
+= frame->
duration
;
20
if
(frame->
frame
== 0xFF) {
21
frame = frames;
22
anim->
index
= 0;
23
anim->
timer
+= frame->
duration
;
24
}
25
stepLoopingAnimation
(anim, frames, depth + 1);
26
}
27
return
frame->
frame
;
28
}
s32
signed int s32
Definition
common.h:11
GFX
GfxState GFX
GFX: the graphics state and its methods.
Definition
display.c:209
stepLoopingAnimation
s32 stepLoopingAnimation(AnimState *anim, AnimFrame *frames, s32 depth)
Steps ANIM through FRAMES by the frame time (at most 4), looping at the end (frame 0xFF),...
Definition
step_looping_animation.inc.c:6
AnimFrame
One frame of a sprite animation; frame 0xFF ends it (or loops it)
Definition
gfx.h:296
AnimFrame::frame
s16 frame
Definition
gfx.h:297
AnimFrame::duration
s16 duration
Definition
gfx.h:298
AnimState
Definition
gfx.h:301
AnimState::index
s16 index
Definition
gfx.h:302
AnimState::timer
s16 timer
Definition
gfx.h:303
GfxFuncs::getFrameTime
s32(* getFrameTime)(void)
Definition
gfx.h:32
GfxState::funcs
GfxFuncs funcs
Definition
gfx.h:77
src
field
stages
common
step_looping_animation.inc.c
Generated by
1.9.8