28 POLY_F4 *poly = &prims->
poly;
29 DR_TPAGE *mode = &prims->
mode;
33 poly->r0 = poly->g0 = poly->b0 = task->
level >> 8;
34 poly->x0 = poly->x2 = 0;
36 poly->y0 = poly->y1 = 0;
37 poly->y2 = poly->y3 = 256;
40 mode->code[0] = 0xE1000245;
47 switch (task->
state) {
62 }
else if (task->
level < 0) {
GfxState GFX
GFX: the graphics state and its methods.
#define TASK_INIT
Tasks: every game object is a task, a heap block that starts with this header and is updated once per...
#define SCREEN_WIDTH
The screen the modes draw on (setDisplayMode, their layers' rects)
#define FADE_LEVEL_MAX
ScreenFade.level when the screen is black: 0xFF in 8.8 fixed point.
ScreenFade * createScreenFade(s32 layerId)
A screen fade task on a layer, idle until started.
void updateScreenFade(ScreenFade *task)
Moves the fade one frame on and draws it; TASK_DONE at the end, still drawn.
void drawScreenFade(ScreenFade *task)
A full-screen POLY_F4 with subtractive blending (tpage 0xE1000245)
void screenFadeStart(ScreenFade *task, s32 fadeIn, s32 duration)
Starts fading the screen to black (fadeIn 0) or back, over duration frames.
The fade's primitives, one after the other in the primitive buffer.
struct Layer *(* getLayer)(s32 id)
void(* setPrim)(void *next)
A drawing layer (GFX.funcs.createLayer): a DRAWENV with a pair of ordering tables,...
u_long *(* getOtEntry)(struct Layer *, s32 depth)
Fades the whole screen to black and back with a subtractive rectangle.
void(* start)(struct ScreenFade *fade, s32 fadeIn, s32 frames)
TASK_DONE when done.
void(* nextState)(struct ScreenFade *task)
void(* setState)(struct ScreenFade *task, s32 state)
s32 level
0-FADE_LEVEL_MAX
void * createTask(void(*update)(), s32 size, s32 childrenSize)
createTaskWithId for a task nothing needs to find