172 {
174 u8 colR, colG, colB;
175 s32 x1, y1, x2, y2;
176 f32 alpha;
177 s16 v0;
178 s16 s0;
180
181 if (progress == 0.0f) {
182 return;
183 }
184
185 if (overlay != NULL) {
193 alpha = overlay->
alpha;
194 } else {
195 colR = colG = colB = 0;
196 x1 = y1 = x2 = y2 = 0;
197 alpha = 0.0f;
198 }
199
200 switch (stencilType) {
206 if (progress == 255.0f) {
207 gDPSetRenderMode(
gMainGfxPos++, CVG_DST_SAVE | G_RM_OPA_SURF, CVG_DST_SAVE | G_RM_OPA_SURF2);
208 } else {
209 gDPSetRenderMode(
gMainGfxPos++, G_RM_CLD_SURF, G_RM_CLD_SURF2);
210 }
211 gDPSetCombineMode(
gMainGfxPos++, G_CC_PRIMITIVE, G_CC_PRIMITIVE);
212 gDPSetPrimColor(
gMainGfxPos++, 0, 0, colR, colG, colB, progress);
216 return;
222 if (progress == 255.0f) {
223 gDPSetRenderMode(
gMainGfxPos++, CVG_DST_SAVE | G_RM_OPA_SURF, CVG_DST_SAVE | G_RM_OPA_SURF2);
224 } else {
225 gDPSetRenderMode(
gMainGfxPos++, G_RM_CLD_SURF, G_RM_CLD_SURF2);
226 }
227 gDPSetCombineMode(
gMainGfxPos++, G_CC_PRIMITIVE, G_CC_PRIMITIVE);
228 gDPSetPrimColor(
gMainGfxPos++, 0, 0, colR, colG, colB, progress);
233 return;
234 }
235
236 guOrtho(&matrixStack[
gMatrixListPos], 0.0f, 320.0f, 0.0f, 240.0f, -1000.0f, 1000.0f, 1.0f);
238
239 switch (stencilType) {
243 break;
247 break;
251 break;
255 break;
259 break;
263 break;
265 s0 = progress;
268 guScale(&matrixStack[
gMatrixListPos], (1.0f - s0 / 255.0f) * 0.8, (1.0f - s0 / 255.0f) * 0.8, 1.0f);
270 guRotate(&matrixStack[
gMatrixListPos], s0 * 0.5f, 0.0f, 0.0f, 1.0f);
274
277 guScale(&matrixStack[
gMatrixListPos], (1.0f - s0 / 255.0f) * 0.8, (1.0f - s0 / 255.0f) * 0.8, 1.0f);
279 guRotate(&matrixStack[
gMatrixListPos], s0 * 0.5f, 0.0f, 0.0f, 1.0f);
283
288 break;
290 s0 = progress;
294 guScale(&matrixStack[
gMatrixListPos], (1.0f - s0 / 255.0f) * 0.8, (1.0f - s0 / 255.0f) * 0.8, 1.0f);
300
303 guScale(&matrixStack[
gMatrixListPos], (1.0f - s0 / 255.0f) * 0.8, (1.0f - s0 / 255.0f) * 0.8, 1.0f);
309
312 gDPSetPrimColor(
gMainGfxPos++, 0, 0, 0, 0, 0, alpha);
315 break;
317 s0 = progress;
321 guScale(&matrixStack[
gMatrixListPos], (1.0f - s0 / 255.0f) * 0.8, (1.0f - s0 / 255.0f) * 0.8, 1.0f);
323 guRotate(&matrixStack[
gMatrixListPos], (f32)(-s0) * 0.5, 0.0f, 0.0f, 1.0f);
327
330 gDPSetPrimColor(
gMainGfxPos++, 0, 0, 0, 0, 0, alpha);
333 v0 = progress + 40;
334 if (progress > 170) {
335 v0 = 170;
336 }
338 break;
342 break;
345 break;
349 break;
352 break;
353 }
354
356}
#define draw_prev_frame_buffer_at_screen_pos
@ OVERLAY_SCREEN_SPOTLIGHT
@ OVERLAY_BATTLE_DARKNESS
@ OVERLAY_VIEWPORT_SPOTLIGHT
void appendGfx_darkness_stencil(s32, s32, s32, f32, f32)
void appendGfx_screen_transition_stencil(s32, s32, f32, s32, s32, s32, s32, s32)
Gfx Gfx_LoadStencilTex_Star[]
Gfx Gfx_LoadStencilTex_BlurryCircle[]
Gfx Gfx_LoadStencilTex_SharpCircle[]
Gfx Gfx_LoadStencilTex_Mario[]
DisplayContext * gDisplayContext