Digimon World 3 decomp
The European version, SLES_039.36
Loading...
Searching...
No Matches
stage.h
Go to the documentation of this file.
1#ifndef FIGHTSTG_STAGE_H
2#define FIGHTSTG_STAGE_H
3
4/* FIGHTSTG's fight stages and their lights (stage.c and lights.c). */
5
8
9/* The fight stages, the battle's backgrounds: WFIGHTTS lists them as
10 MFSTG001-027 */
11#if VERSION_US || VERSION_JP
12#define FILE_FIGHT_STAGES 0x1BD
13#elif VERSION_EU
14#define FILE_FIGHT_STAGES 0x1CB
15#endif
16
17/* A fight stage's lights: three flat lights and the ambient colour */
18typedef struct LightSet {
19 /* 0x00 */ GsF_LIGHT lights[3];
20 /* 0x30 */ s32 ambient[3];
21} LightSet;
22
23/* A fight stage, in FILE_FIGHT_STAGES */
24typedef struct FightStageInfo {
25 /* 0x00 */ s32 model; /* file << 16 | index */
26 /* 0x04 */ s32 motions;
27 /* 0x08 */ s32 music; /* an index in FIGHTSTG_stageMusic, or -1 */
28 /* 0x0C */ u8 bgColor[3];
29 /* 0x0F */ u8 padF; /* 0 in every stage; never read or written */
30 /* 0x10 */ u8 noBoundsBones[8]; /* bones given to the model's setBoneNoBoundsCheck, up to a 0 */
31 /* 0x18 */ LightSet lights;
32 /* 0x54 */ s32 pad54; /* 0 in every stage; never read: the file's stages are 0x58 bytes apart */
34
35/* The fight stage (FIGHTSTG_createStage), registered as BATTLE_TASK_STAGE: its model,
36 which fades in from black, and its music. setStage fades it out and
37 the new one in. */
38typedef struct FightStage {
40 /* 0x50 */ s32 stage;
41 /* 0x54 */ s32 prevStage;
43 /* 0xA4 */ s32 fade; /* 0-0x1000 */
44 /* 0xA8 */ s32 fadeStep;
45 /* 0xAC */ s32 fadeInTime;
46 /* 0xB0 */ s32 fadeOutTime;
47 /* 0xB4 */ SVECTOR colorFrom; /* the model's */
48 /* 0xBC */ SVECTOR colorTo;
49 /* 0xC4 */ SVECTOR color;
50 /* 0xCC */ SVECTOR bgFrom; /* SCREEN_LAYER's background */
51 /* 0xD4 */ SVECTOR bgTo;
52 /* 0xDC */ SVECTOR bg;
53 /* 0xE4 */ s16 voice; /* the music's */
54 /* 0xE8 */ void (*setStage)(struct FightStage *task, s32 stage, s32 fadeOutTime, s32 fadeInTime);
56
57/* The stage lights (FIGHTSTG_createLights), registered as BATTLE_TASK_LIGHTS: set puts a
58 light set, fade goes from one to another in time frames */
59typedef struct Lights {
61 /* 0x050 */ s32 layerId;
62 /* 0x054 */ LightSet current;
63 /* 0x090 */ LightSet to;
64 /* 0x0CC */ LightSet from;
65 /* 0x108 */ s32 t; /* 0-0x1000 */
66 /* 0x10C */ s32 tStep; /* per frame */
67 /* 0x110 */ void (*set)(struct Lights *task, LightSet *set);
68 /* 0x114 */ void (*fade)(struct Lights *task, LightSet *from, LightSet *to, s32 time); /* from: NULL for the current */
69 /* 0x118 */ LightSet *(*getStageLights)(struct Lights *task, s32 stage);
70} Lights;
71
72/* The tasks FIGHTSTG starts for WFIGHTMN and WFIGHTTS */
73FightStage *FIGHTSTG_createStage(s32 id, s32 fadeInTime);
75
76/* Shared between the overlay's objects */
80void FIGHTSTG_setStage(FightStage *task, s32 id, s32 fadeOutTime, s32 fadeInTime);
87
88#endif /* FIGHTSTG_STAGE_H */
s32 FIGHTSTG_getStageMotionsFile(s32 id)
The file of fight stage ID's motions.
Definition stage.c:205
LightSet * FIGHTSTG_getStageLights(Lights *task, s32 stage)
Lights.getStageLights: fight stage STAGE's lights.
Definition lights.c:111
void FIGHTSTG_updateStage(FightStage *task, Model **children)
The fight stage's task: loads the stage's model, starts its music and fades in its lights,...
Definition stage.c:118
s32 FIGHTSTG_stageMusic[]
Shared between the overlay's objects.
Definition stage.c:31
s32 FIGHTSTG_randomStage(void)
A random fight stage, 1-27.
Definition stage.c:200
void FIGHTSTG_updateLights(Lights *task)
The stage lights' task: steps their fade, then sets the three flat lights and the ambient color for t...
Definition lights.c:7
Lights * FIGHTSTG_createLights(s32 layerId)
Creates the stage lights (id 0x13) for layer layerId.
Definition lights.c:118
void FIGHTSTG_setStage(FightStage *task, s32 id, s32 fadeOutTime, s32 fadeInTime)
FightStage.setStage: changes to stage ID, fading the old one out over FADEOUTTIME and the new one in ...
Definition stage.c:189
void FIGHTSTG_fadeLights(Lights *task, LightSet *from, LightSet *to, s32 time)
Lights.fade: fades from FROM (NULL for the current lights) to TO over TIME.
Definition lights.c:98
void FIGHTSTG_setLights(Lights *task, LightSet *set)
Lights.set: switches to SET at once.
Definition lights.c:92
void FIGHTSTG_fadeStage(FightStage *task, Model **children)
Sets the stage model's color and SCREEN_LAYER's background to their fades' current values (a black ba...
Definition stage.c:8
FightStage * FIGHTSTG_createStage(s32 id, s32 fadeInTime)
The tasks FIGHTSTG starts for WFIGHTMN and WFIGHTTS.
Definition stage.c:213
FIGHTSTG's shared declarations: the headers it builds on, the ids its tasks register with,...
signed int s32
Definition common.h:11
signed short s16
Definition common.h:9
unsigned char u8
Definition common.h:8
#define TASK_HEADER(Type)
Definition task.h:39
FIGHTSTG's models: meshes and their drawing, bones, motions, the models task and its controls,...
A fight stage, in FILE_FIGHT_STAGES.
Definition stage.h:24
s32 model
file << 16 | index
Definition stage.h:25
s32 motions
Definition stage.h:26
s32 music
an index in FIGHTSTG_stageMusic, or -1
Definition stage.h:27
u8 bgColor[3]
Definition stage.h:28
s32 pad54
0 in every stage; never read: the file's stages are 0x58 bytes apart
Definition stage.h:32
u8 noBoundsBones[8]
bones given to the model's setBoneNoBoundsCheck, up to a 0
Definition stage.h:30
LightSet lights
Definition stage.h:31
u8 padF
0 in every stage; never read or written
Definition stage.h:29
The fight stage (FIGHTSTG_createStage), registered as BATTLE_TASK_STAGE: its model,...
Definition stage.h:38
SVECTOR bg
Definition stage.h:52
s32 fadeInTime
Definition stage.h:45
s32 fadeOutTime
Definition stage.h:46
SVECTOR colorTo
Definition stage.h:48
void(* setStage)(struct FightStage *task, s32 stage, s32 fadeOutTime, s32 fadeInTime)
Definition stage.h:54
SVECTOR colorFrom
the model's
Definition stage.h:47
s16 voice
the music's
Definition stage.h:53
SVECTOR color
Definition stage.h:49
s32 prevStage
Definition stage.h:41
s32 fadeStep
Definition stage.h:44
s32 stage
Definition stage.h:40
SVECTOR bgTo
Definition stage.h:51
s32 fade
0-0x1000
Definition stage.h:43
SVECTOR bgFrom
SCREEN_LAYER's background.
Definition stage.h:50
ModelControl control
Definition stage.h:42
A fight stage's lights: three flat lights and the ambient colour.
Definition stage.h:18
s32 ambient[3]
Definition stage.h:20
GsF_LIGHT lights[3]
Definition stage.h:19
The stage lights (FIGHTSTG_createLights), registered as BATTLE_TASK_LIGHTS: set puts a light set,...
Definition stage.h:59
LightSet from
Definition stage.h:64
void * children
Definition stage.h:60
s32 layerId
Definition stage.h:61
void(* fade)(struct Lights *task, LightSet *from, LightSet *to, s32 time)
from: NULL for the current
Definition stage.h:68
LightSet to
Definition stage.h:63
s32 t
0-0x1000
Definition stage.h:65
void(* set)(struct Lights *task, LightSet *set)
Definition stage.h:67
s32 tStep
per frame
Definition stage.h:66
LightSet current
Definition stage.h:62
What drives a Model, owned by whoever created it.
Definition model.h:99
A 3D model (FIGHTSTG_createModel), registered with id 0x11: a tree of bones, each drawn by a Mesh chi...
Definition model.h:132