12 poly->r0 = fader->
color[0];
13 poly->g0 = fader->
color[1];
14 poly->b0 = fader->
color[2];
18 poly->x1 = rect.x + rect.w;
20 poly->x3 = rect.x + rect.w;
23 poly->y2 = rect.y + rect.h;
24 poly->y3 = rect.y + rect.h;
26 mode = (DR_TPAGE *)(poly + 1);
28 mode->code[0] = ((fader->
blend & 3) << 5) | 0xE1000205;
38 if (fader->
time > 0) {
39 for (i = 0; i < 3; i++) {
66 for (i = 0; i < 3; i++) {
80 return fader->
mode == 0;
91 switch (fader->
state) {
97 if (fader->
mode == 1) {
101 if (fader->
mode == 2) {
118 fader->
blend = blend;
CARDGAME.PRO: the card battle (mode 0x700).
CardFader * CARDGAME_createFader(u8 blend)
Creates a fader, with the semi-transparency rate BLEND.
void CARDGAME_tickFader(CardFader *fader)
A fader's task: steps its fade while fading, draws it over CARDGAME_fadeRect every frame and ends onc...
void CARDGAME_setFaderColor(CardFader *fader, u8 r, u8 g, u8 b)
Sets the colour at once.
void CARDGAME_killFader(CardFader *fader)
Ends the task.
void CARDGAME_drawFader(CardFader *fader, RECT rect)
Draws the fader over RECT, in layer 0x100.
void CARDGAME_startFade(CardFader *fader, u8 r, u8 g, u8 b, s32 frames, s32 killWhenDone)
Fades from the current colour to r, g, b in FRAMES vsyncs; the task ends at the end when KILLWHENDONE...
void CARDGAME_stepFader(CardFader *fader)
Moves the colour towards the target as the time runs out.
s32 CARDGAME_isFadeDone(CardFader *fader)
1 once the fade has reached its colour
GfxState GFX
GFX: the graphics state and its methods.
Fades the screen to a colour: a POLY_F4 over it, blended (blend is the semi-transparency rate)
void(* kill)(struct CardFader *fader)
void(* setState)(struct CardFader *task, s32 state)
void(* setColor)(struct CardFader *fader, u8 r, u8 g, u8 b)
s32(* isDone)(struct CardFader *fader)
void(* nextState)(struct CardFader *task)
s32 mode
0 idle, 1 fading, 2 done: the task ends
void(* start)(struct CardFader *fader, u8 r, u8 g, u8 b, s32 frames, s32 killWhenDone)
s32(* getFrameTime)(void)
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)
void * createTask(void(*update)(), s32 size, s32 childrenSize)
createTaskWithId for a task nothing needs to find