Digimon World 3 decomp
The European version, SLES_039.36
Loading...
Searching...
No Matches
update_tile_anims3_once.inc.c
Go to the documentation of this file.
1/*
2 * Animates the map objects of animations 1 to 3 with updateTileAnimsFrames0
3 * to 2, each stepped once an update
4 */
6 s32 frames[3];
7 StageTile *tile;
8
9 switch (task->state) {
10 case TASK_INIT:
11 default:
12 task->nextState(task);
13 task->anims[0].index = 0;
15 task->anims[1].index = 0;
17 task->anims[2].index = 0;
19 break;
20 case TASK_RUN:
22 frames[0] = stepLoopingAnimation(&task->anims[0], updateTileAnimsFrames0, 0);
23 frames[1] = stepLoopingAnimation(&task->anims[1], updateTileAnimsFrames1, 0);
24 frames[2] = stepLoopingAnimation(&task->anims[2], updateTileAnimsFrames2, 0);
25 for (; tile->margin != 0; tile++) {
26 switch (tile->anim) {
27 case 1:
28 tile->frame = frames[0];
29 break;
30 case 2:
31 tile->frame = frames[1];
32 break;
33 case 3:
34 tile->frame = frames[2];
35 break;
36 }
37 }
38 break;
39 case TASK_DONE:
40 case TASK_KILL:
41 break;
42 }
43}
signed int s32
Definition common.h:11
#define TASK_RUN
Definition task.h:35
#define TASK_KILL
Definition task.h:37
#define TASK_INIT
Tasks: every game object is a task, a heap block that starts with this header and is updated once per...
Definition task.h:34
#define TASK_DONE
Definition task.h:36
FieldState FIELDSTG_state
Definition fieldstg.c:2641
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),...
s16 duration
Definition gfx.h:298
s16 index
Definition gfx.h:302
s16 timer
Definition gfx.h:303
StageTile * objects
the map objects, up to the first margin 0
Definition field_map.h:446
The task that animates the map objects.
Definition stage.h:102
void(* nextState)(struct StageTileAnims *task)
Definition stage.h:103
AnimState anims[4]
as many as the stage uses
Definition stage.h:104
An object of a map, which FIELDSTG draws: a record of the table at FieldState.objects,...
Definition field_map.h:208
u8 margin
how far off the view it is still drawn; 0 ends the table
Definition field_map.h:214
u8 anim
which of a stage's animations sets frame (1-3); FIELDSTG finds objects by it (its lift,...
Definition field_map.h:210
void updateTileAnims(StageTileAnims *task)
Animates the map objects of animations 1 to 3 with updateTileAnimsFrames0 to 2, each stepped once an ...
AnimFrame updateTileAnimsFrames0[]
Defined below, after the code that uses them.
Definition wstag233.c:52
AnimFrame updateTileAnimsFrames1[]
Definition wstag233.c:59
AnimFrame updateTileAnimsFrames2[]
Definition wstag311.c:973