Digimon World 3 decomp
The European version, SLES_039.36
Loading...
Searching...
No Matches
tile_six.inc.c
Go to the documentation of this file.
1/* The parts of updateTileSix, the same in WSTAG310 and WSTAG311 */
2
3/*
4 * Finds the map objects with animations 5 to 10 and starts the
5 * animations of the first four
6 */
7static inline void findTileSix(StageTileSix *task) {
8 StageTile *object;
9
10 for (object = FIELDSTG_state.objects; object->margin != 0; object++) {
11 if (object->anim >= 5 && object->anim <= 10) {
12 switch (object->anim) {
13 case 5:
14 task->tiles[0].tile = object;
15 task->tiles[0].anim.index = 0;
17 break;
18 case 6:
19 task->tiles[1].tile = object;
20 task->tiles[1].anim.index = 0;
22 break;
23 case 7:
24 task->tiles[2].tile = object;
25 task->tiles[2].anim.index = 0;
27 break;
28 case 8:
29 task->tiles[3].tile = object;
30 task->tiles[3].anim.index = 0;
32 break;
33 case 9:
34 task->tiles[4].tile = object;
35 task->tiles[4].anim.index = 0;
36 task->tiles[4].anim.timer = 0;
37 break;
38 case 10:
39 task->tiles[5].tile = object;
40 task->tiles[5].anim.index = 0;
41 task->tiles[5].anim.timer = 0;
42 break;
43 }
44 }
45 }
46}
47
48/*
49 * Mode 2: hides the first two map objects and shows the other four, the
50 * third and fourth with their looping palettes and the last two still
51 */
52static inline void showLastFourTiles(StageTileSix *task, StageTile *tile, s32 i) {
53 switch (i) {
54 case 0:
55 case 1:
56 tile->visible = 0;
57 break;
58 case 2:
59 tile->frame = 0x28;
60 tile->clutRow = stepTileAnimation(&task->tiles[i], updateTileSixFrames2, 0, 0);
61 tile->visible = 1;
62 break;
63 case 3:
64 tile->frame = 2;
65 tile->clutRow = stepTileAnimation(&task->tiles[i], updateTileSixFrames3, 0, 0);
66 tile->visible = 1;
67 break;
68 case 4:
69 tile->visible = 1;
70 tile->frame = 3;
71 tile->clutRow = 0;
72 break;
73 case 5:
74 tile->visible = 1;
75 tile->frame = 4;
76 tile->clutRow = 0;
77 break;
78 }
79}
signed int s32
Definition common.h:11
FieldState FIELDSTG_state
Definition fieldstg.c:2641
s32 stepTileAnimation(StageTileAnim *obj, AnimFrame *frames, s32 once, s32 depth)
Steps OBJ's animation through FRAMES by the frame time (at most 4) and returns its frame: at the end ...
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
StageTile * tile
Definition stage.h:109
AnimState anim
Definition stage.h:110
Six map objects, animated by mode.
Definition stage.h:430
StageTileAnim tiles[6]
Definition stage.h:433
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
static void findTileSix(StageTileSix *task)
Finds the map objects with animations 5 to 10 and starts the animations of the first four.
Definition tile_six.inc.c:7
static void showLastFourTiles(StageTileSix *task, StageTile *tile, s32 i)
Mode 2: hides the first two map objects and shows the other four, the third and fourth with their loo...
AnimFrame updateTileSixFrames3[]
Definition wstag311.c:996
AnimFrame updateTileSixFrames0[]
Definition wstag311.c:981
AnimFrame updateTileSixFrames1[]
Definition wstag311.c:987
AnimFrame updateTileSixFrames2[]
Definition wstag311.c:993