Digimon World 3 decomp
The European version, SLES_039.36
Loading...
Searching...
No Matches
scene.c
Go to the documentation of this file.
1/* STGTRAIN's scene: the mode's root task */
2
3#include "menus/gym.h"
4
5/* The mode's root task: sets up the display and starts the screen */
6void STGTRAIN_updateRoot(Task *task, TrainScreen **children) {
7 RECT rect;
8 Layer *layer;
9
10 switch (task->state) {
11 case TASK_INIT:
12 default:
13 GFX.funcs.reset();
14 GFX.funcs.allocPrimBuffers(0x14000);
16 rect.x = 0;
17 rect.y = 0;
18 rect.w = 0x140;
19 rect.h = 0xF0;
20 layer = GFX.funcs.createLayer(&rect, 3, SCREEN_LAYER);
21 layer->setBgColor(layer, 0, 0, 0);
22 rect.x = 0x7B;
23 rect.y = 0x53;
24 rect.w = 0xA8;
25 rect.h = 0x58;
26 GFX.funcs.createLayer(&rect, 3, 0x1001);
27 GFX.funcs.moveLayer(0x1001, 0x1000, 1);
28 rect.x = 0;
29 rect.y = 0;
30 rect.w = 0x140;
31 rect.h = 0xF0;
32 GFX.funcs.createLayer(&rect, 3, 0x1002);
33 GFX.funcs.moveLayer(0x1002, 0x1001, 1);
34 children[0] = STGTRAIN_createScreen();
35 task->nextState(task);
36 break;
37 case TASK_RUN:
38 case TASK_DONE:
39 case TASK_KILL:
40 break;
41 }
42}
43
44/* The mode's entry point (MODE_ENTRY_POINTS): starts the root task */
46 return createTask(STGTRAIN_updateRoot, sizeof(Task), sizeof(TrainScreen *));
47}
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
STGTRAIN.PRO: the gyms, where the partners train their stats.
Task * STGTRAIN_start(void)
The mode's entry point (MODE_ENTRY_POINTS): starts the root task.
Definition scene.c:45
void STGTRAIN_updateRoot(Task *task, TrainScreen **children)
The mode's root task: sets up the display and starts the screen.
Definition scene.c:6
TrainScreen * STGTRAIN_createScreen(void)
Creates the training screen.
Definition screen.c:646
void(* reset)(void)
Definition gfx.h:17
void(* moveLayer)()
Definition gfx.h:29
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
The training screen's main task (STGTRAIN_createScreen)
Definition gym.h:106
void * createTask(void(*update)(), s32 size, s32 childrenSize)
createTaskWithId for a task nothing needs to find
Definition task.c:105