Digimon World 3 decomp
The European version, SLES_039.36
Loading...
Searching...
No Matches
scene.c
Go to the documentation of this file.
1/* The fight report's mode: its scene, its entry point and the screen fader
2 (src/shared). */
3
4#include "battle/report.h"
5
6/* The mode's scene: resets the graphics, makes the screen layer and creates
7 the report */
8void STFGTREP_updateScene(Task *task, FightReport **children) {
9 RECT rect;
10 Layer *layer;
11
12 switch (task->state) {
13 case TASK_INIT:
14 default:
15 GFX.funcs.reset();
16 GFX.funcs.allocPrimBuffers(0x14000);
18 rect.x = 0;
19 rect.y = 0;
20 rect.w = 0x140;
21 rect.h = 0xF0;
22 layer = GFX.funcs.createLayer(&rect, 3, SCREEN_LAYER);
23 layer->setBgColor(layer, 0, 0, 0);
24 children[0] = STFGTREP_createScreen();
25 task->nextState(task);
26 break;
27 case TASK_RUN:
28 case TASK_DONE:
29 case TASK_KILL:
30 break;
31 }
32}
33
34/* The mode's entry point (MODE_ENTRY_POINTS) */
36 return createTask(STFGTREP_updateScene, sizeof(Task), 4);
37}
38
42#define FADER_DEPTH 6
Task * STFGTREP_start(void)
The mode's entry point (MODE_ENTRY_POINTS)
Definition scene.c:35
void STFGTREP_updateScene(Task *task, FightReport **children)
The mode's scene: resets the graphics, makes the screen layer and creates the report.
Definition scene.c:8
GfxState GFX
GFX: the graphics state and its methods.
Definition display.c:209
#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 SCREEN_WIDTH
The screen the modes draw on (setDisplayMode, their layers' rects)
Definition gfx.h:36
#define SCREEN_HEIGHT
Definition gfx.h:37
#define SCREEN_LAYER
The layer over the whole screen that most modes create first and draw their menus on (FIELDSTG and ST...
Definition gfx.h:45
FightReport * STFGTREP_createScreen(void)
Creates the report (STFGTREP_updateReport) on the screen layer.
Definition report.c:363
STFGTREP.PRO: mode 0x1400, the report after a battle.
The main task of the screen (STFGTREP_createScreen)
Definition report.h:104
void(* reset)(void)
Definition gfx.h:17
void(* allocPrimBuffers)(s32 size)
Definition gfx.h:18
struct Layer *(* createLayer)(RECT *rect, s32 otShift, s32 id)
Definition gfx.h:24
void(* setDisplayMode)(s32 w, s32 h, s32 hires, s32 interlace)
Definition gfx.h:26
GfxFuncs funcs
Definition gfx.h:77
A drawing layer (GFX.funcs.createLayer): a DRAWENV with a pair of ordering tables,...
Definition gfx.h:128
void(* setBgColor)()
no prototype: callers would truncate u8 args
Definition gfx.h:152
Any task, seen through its header.
Definition task.h:62
void(* nextState)(struct Task *task)
Definition task.h:63
s32 state
Definition task.h:63
void * createTask(void(*update)(), s32 size, s32 childrenSize)
createTaskWithId for a task nothing needs to find
Definition task.c:105