Digimon World 3 decomp
The European version, SLES_039.36
Loading...
Searching...
No Matches
step_tile_animation3.inc.c
Go to the documentation of this file.
1
/*
2
* stepTileAnimation under a third name: steps OBJ's animation through FRAMES
3
* by the frame time (at most 4) and returns its frame: at the end (frame
4
* 0xFF) it loops, or returns 0xFF if once. depth is 0 for the caller.
5
*/
6
s32
stepTileAnimation3
(
StageTileAnim
*obj,
AnimFrame
*frames,
s32
once,
s32
depth) {
7
AnimFrame
*frame = &frames[obj->
anim
.
index
];
8
s32
dt =
GFX
.
funcs
.
getFrameTime
();
9
10
if
(dt > 4) {
11
dt = 4;
12
}
13
if
(depth == 0) {
14
obj->
anim
.
timer
-= dt;
15
}
16
if
(obj->
anim
.
timer
<= 0) {
17
frame++;
18
obj->
anim
.
index
++;
19
obj->
anim
.
timer
+= frame->
duration
;
20
if
(once) {
21
if
(frame->
frame
== 0xFF) {
22
return
0xFF;
23
}
24
}
else
if
(frame->
frame
== 0xFF) {
25
frame = frames;
26
obj->
anim
.
index
= 0;
27
obj->
anim
.
timer
+= frame->
duration
;
28
}
29
stepTileAnimation3
(obj, frames, once, depth + 1);
30
}
31
return
frame->
frame
;
32
}
s32
signed int s32
Definition
common.h:11
GFX
GfxState GFX
GFX: the graphics state and its methods.
Definition
display.c:209
stepTileAnimation3
s32 stepTileAnimation3(StageTileAnim *obj, AnimFrame *frames, s32 once, s32 depth)
stepTileAnimation under a third name: steps OBJ's animation through FRAMES by the frame time (at most...
Definition
step_tile_animation3.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::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
StageTileAnim
A map object with the animation that sets its frame.
Definition
stage.h:108
StageTileAnim::anim
AnimState anim
Definition
stage.h:110
src
field
stages
common
step_tile_animation3.inc.c
Generated by
1.9.8