2023-12-19 08:54:50 -06:00
|
|
|
#include "global.h"
|
|
|
|
|
2024-05-11 15:53:37 -05:00
|
|
|
void Wipe_Horizontal(s32 frame) {
|
|
|
|
Graphics_FillRectangle(&gMasterDisp, 0, 0, frame, SCREEN_HEIGHT, 0, 0, 0, 255);
|
|
|
|
Graphics_FillRectangle(&gMasterDisp, SCREEN_WIDTH - frame, 0, SCREEN_WIDTH, SCREEN_HEIGHT, 0, 0, 0, 255);
|
2023-12-19 08:54:50 -06:00
|
|
|
}
|
|
|
|
|
2024-05-11 15:53:37 -05:00
|
|
|
void Wipe_Vertical(s32 frame) {
|
|
|
|
Graphics_FillRectangle(&gMasterDisp, 0, 0, SCREEN_WIDTH, frame, 0, 0, 0, 255);
|
|
|
|
Graphics_FillRectangle(&gMasterDisp, 0, SCREEN_HEIGHT - frame, SCREEN_WIDTH, SCREEN_HEIGHT, 0, 0, 0, 255);
|
2023-12-19 08:54:50 -06:00
|
|
|
}
|
|
|
|
|
2024-05-11 15:53:37 -05:00
|
|
|
void Wipe_Circular(s32 frame) {
|
2024-09-17 02:04:15 -03:00
|
|
|
s32 angle;
|
2023-12-19 08:54:50 -06:00
|
|
|
|
|
|
|
RCP_SetupDL_12();
|
|
|
|
Matrix_Push(&gGfxMatrix);
|
2024-04-15 18:38:19 -05:00
|
|
|
Matrix_Translate(gGfxMatrix, 0.0f, 0.0f, -150.0f, MTXF_NEW);
|
2024-09-17 02:04:15 -03:00
|
|
|
for (angle = 0; angle < MIN(360, frame * 15); angle += 15) {
|
|
|
|
gDPSetPrimColor(gMasterDisp++, 0x00, 0x00, 0, 0, 0, MIN((frame - (angle / 15)) * 15, 255));
|
2023-12-19 08:54:50 -06:00
|
|
|
Matrix_Push(&gGfxMatrix);
|
2024-09-17 02:04:15 -03:00
|
|
|
Matrix_RotateZ(gGfxMatrix, angle * M_DTOR, MTXF_APPLY);
|
2024-04-15 18:38:19 -05:00
|
|
|
Matrix_Scale(gGfxMatrix, 0.53f, 1.0f, 1.0f, MTXF_APPLY);
|
2023-12-19 08:54:50 -06:00
|
|
|
Matrix_SetGfxMtx(&gMasterDisp);
|
|
|
|
gSPDisplayList(gMasterDisp++, D_Gfx_800D9688);
|
|
|
|
Matrix_Pop(&gGfxMatrix);
|
|
|
|
}
|
|
|
|
Matrix_Pop(&gGfxMatrix);
|
|
|
|
}
|
|
|
|
|
2024-05-11 15:53:37 -05:00
|
|
|
void Wipe_Draw(WipeMode mode, s32 frame) {
|
|
|
|
if (frame != 0) {
|
|
|
|
switch (mode) {
|
|
|
|
case WIPE_CIRCULAR:
|
|
|
|
Wipe_Circular(frame);
|
2023-12-19 08:54:50 -06:00
|
|
|
break;
|
2024-05-11 15:53:37 -05:00
|
|
|
case WIPE_HORIZONTAL:
|
|
|
|
Wipe_Horizontal(frame);
|
2023-12-19 08:54:50 -06:00
|
|
|
break;
|
2024-05-11 15:53:37 -05:00
|
|
|
case WIPE_VERTICAL:
|
|
|
|
Wipe_Vertical(frame);
|
2023-12-19 08:54:50 -06:00
|
|
|
break;
|
|
|
|
default:
|
2024-08-12 11:58:54 -03:00
|
|
|
PRINTF("そのような フェード は ない (%d)\n"); // There is no such fade
|
2023-12-19 08:54:50 -06:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|