Digimon World 3 decomp
The European version, SLES_039.36
Loading...
Searching...
No Matches
fader.c
Go to the documentation of this file.
1/* FIGHTSTG's screen fader: its start and drawing are src/shared's. */
2
4
7
8/* The screen fade's task: src/shared/update_fader.inc.c, but for its
9 first state, which sets TASK_RUN without nextState, and the running
10 state's own call to draw */
12 switch (task->state) {
13 case TASK_INIT:
14 default:
15 task->state = TASK_RUN;
16 break;
17 case TASK_RUN:
18 if (task->substate == 0) {
19 break;
20 }
21 task->level += task->levelStep;
22 if (task->fadeIn == 0) {
23 if (task->level > FADE_LEVEL_MAX) {
24 task->level = FADE_LEVEL_MAX;
25 task->state = TASK_DONE;
26 }
27 } else if (task->level < 0) {
28 task->level = 0;
29 task->state = TASK_DONE;
30 }
32 break;
33 case TASK_DONE:
35 break;
36 case TASK_KILL:
37 break;
38 }
39}
40
41/* Creates the screen fade, idle until started, on layer BATTLE_LAYER_FRONT */
44
47 task->depth = 0;
48 return task;
49}
void FIGHTSTG_updateFader(ScreenFade *task)
The screen fade's task: src/shared/update_fader.inc.c, but for its first state, which sets TASK_RUN w...
Definition fader.c:11
ScreenFade * FIGHTSTG_createFader(void)
Creates the screen fade, idle until started, on layer BATTLE_LAYER_FRONT.
Definition fader.c:42
#define BATTLE_LAYER_FRONT
the fades, the flashes and the sprite effects over all
Definition types.h:32
FIGHTSTG.PRO: the battle.
void FIGHTSTG_drawFader(ScreenFade *task)
void FIGHTSTG_startFader(ScreenFade *task, s32 fadeIn, s32 duration)
#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
#define FADE_LEVEL_MAX
ScreenFade.level when the screen is black: 0xFF in 8.8 fixed point.
Definition gfx.h:358
Fades the whole screen to black and back with a subtractive rectangle.
Definition gfx.h:361
s32 depth
Definition gfx.h:364
s32 levelStep
Definition gfx.h:367
s32 fadeIn
0: to black
Definition gfx.h:365
void(* start)(struct ScreenFade *fade, s32 fadeIn, s32 frames)
TASK_DONE when done.
Definition gfx.h:368
s32 layerId
Definition gfx.h:363
s32 level
0-FADE_LEVEL_MAX
Definition gfx.h:366
s32 state
Definition gfx.h:362
s32 substate
Definition gfx.h:362
void * createTask(void(*update)(), s32 size, s32 childrenSize)
createTaskWithId for a task nothing needs to find
Definition task.c:105