Digimon World 3 decomp
The European version, SLES_039.36
Loading...
Searching...
No Matches
update_sound_tile.inc.c
Go to the documentation of this file.
1/*
2 * The map object of animation 1: frame 5 until substate 1 plays the stage's
3 * updateSoundTileFrames once, then frame 10, keying off SOUND_COMCD115
4 */
6 StageTile *object;
7 StageTile *tile;
8 s32 frame;
9
10 switch (task->state) {
11 case TASK_INIT:
12 default:
13 for (object = FIELDSTG_state.objects; object->margin != 0; object++) {
14 if (object->anim == 1) {
15 task->obj.anim.index = 0;
17 task->obj.tile = object;
18 }
19 }
20 task->nextState(task);
21 break;
22 case TASK_RUN:
23 tile = task->obj.tile;
24 switch (task->substate) {
25 case 0:
26 default:
27 tile->frame = 5;
28 tile->visible = 1;
29 break;
30 case 1:
31 tile->visible = 1;
33 if (frame != 0xFF) {
34 tile->frame = frame;
35 } else {
36 tile->frame = 10;
37 task->nextSubstate(task);
39 }
40 break;
41 case 2:
42 tile->visible = 1;
43 tile->frame = 10;
44 break;
45 }
46 break;
47 case TASK_DONE:
48 case TASK_KILL:
49 break;
50 }
51}
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
SoundState SOUND
rsin and rcos (libgte) read rsin_tbl[a - 0x800] and the like: their addresses before the table fall i...
Definition sound.c:180
#define SOUND_COMCD115
held until SOUND.keyOff
Definition sound.h:54
s32 stepAnimationOnce(StageTileAnim *obj, AnimFrame *frames, s32 depth)
Steps OBJ's animation through FRAMES by the frame time (at most 4) and returns its frame,...
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
void(* keyOff)(s32 id, s16 voice)
Definition sound.h:189
The map object with animation 1, played once with a sound when the substate is set to 1 (frame 5 befo...
Definition stage.h:283
StageTileAnim obj
Definition stage.h:286
void(* nextSubstate)(struct StageSoundTile *task)
Definition stage.h:284
void(* nextState)(struct StageSoundTile *task)
Definition stage.h:284
s16 voice
what SOUND.playSound returned
Definition stage.h:285
StageTile * tile
Definition stage.h:109
AnimState anim
Definition stage.h:110
An object of a map, which FIELDSTG draws: a record of the table at FieldState.objects,...
Definition field_map.h:208
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 updateSoundTile(StageSoundTile *task)
The map object of animation 1: frame 5 until substate 1 plays the stage's updateSoundTileFrames once,...
AnimFrame updateSoundTileFrames[]
Defined below, after the code that uses them.
Definition wstag306.c:267