Paper Mario DX
Paper Mario (N64) modding
 
Loading...
Searching...
No Matches
overlay.h File Reference

Go to the source code of this file.

Data Structures

struct  ScreenOverlay
 

Functions

void _render_transition_stencil (u8, f32, ScreenOverlay *)
 
void appendGfx_screen_transition_stencil (s32, s32, f32, s32, s32, s32, s32, s32)
 
void appendGfx_darkness_stencil (s32, s32, s32, f32, f32)
 

Data Structure Documentation

◆ ScreenOverlay

struct ScreenOverlay
Data Fields
Color_RGB8 color
char unk_03
s32 screenPos[2][2]
f32 alpha

Function Documentation

◆ _render_transition_stencil()

void _render_transition_stencil ( u8 stencilType,
f32 progress,
ScreenOverlay * overlay )

Definition at line 174 of file screen_overlays.c.

174 {
176 u8 colR, colG, colB;
177 s32 x1, y1, x2, y2;
178 f32 alpha;
179 s16 v0;
180 s16 s0;
181 Mtx* matrixStack = gDisplayContext->matrixStack;
182
183 if (progress == 0.0f) {
184 return;
185 }
186
187 if (overlay != nullptr) {
188 colR = overlay->color.r;
189 colG = overlay->color.g;
190 colB = overlay->color.b;
191 x1 = overlay->screenPos[0][0];
192 y1 = overlay->screenPos[0][1];
193 x2 = overlay->screenPos[1][0];
194 y2 = overlay->screenPos[1][1];
195 alpha = overlay->alpha;
196 } else {
197 colR = colG = colB = 0;
198 x1 = y1 = x2 = y2 = 0;
199 alpha = 0.0f;
200 }
201
202 switch (stencilType) {
208 if (progress == 255.0f) {
210 } else {
212 }
218 return;
224 if (progress == 255.0f) {
226 } else {
228 }
232 gDPFillRectangle(gMainGfxPos++, camera->viewportStartX, camera->viewportStartY,
233 camera->viewportStartX + camera->viewportW, camera->viewportStartY + camera->viewportH);
235 return;
236 }
237
238 guOrtho(&matrixStack[gMatrixListPos], 0.0f, 320.0f, 0.0f, 240.0f, -1000.0f, 1000.0f, 1.0f);
240
241 switch (stencilType) {
245 break;
249 break;
253 break;
257 break;
261 break;
265 break;
266 case OVERLAY_TYPE_2:
267 s0 = progress;
268 guTranslate(&matrixStack[gMatrixListPos], 80.0f, 120.0f, 0.0f);
270 guScale(&matrixStack[gMatrixListPos], (1.0f - s0 / 255.0f) * 0.8, (1.0f - s0 / 255.0f) * 0.8, 1.0f);
272 guRotate(&matrixStack[gMatrixListPos], s0 * 0.5f, 0.0f, 0.0f, 1.0f);
276
277 guTranslate(&matrixStack[gMatrixListPos], 240.0f, 120.0f, 0.0f);
279 guScale(&matrixStack[gMatrixListPos], (1.0f - s0 / 255.0f) * 0.8, (1.0f - s0 / 255.0f) * 0.8, 1.0f);
281 guRotate(&matrixStack[gMatrixListPos], s0 * 0.5f, 0.0f, 0.0f, 1.0f);
285
286 guTranslate(&matrixStack[gMatrixListPos], 0.0f, 0.0f, 0.0f);
290 break;
291 case OVERLAY_TYPE_9:
292 s0 = progress;
293 gDPSetPrimColor(gMainGfxPos++, 0, 0, 0, 0, 0, 0);
294 guTranslate(&matrixStack[gMatrixListPos], x1, SCREEN_HEIGHT - y1, 0.0f);
296 guScale(&matrixStack[gMatrixListPos], (1.0f - s0 / 255.0f) * 0.8, (1.0f - s0 / 255.0f) * 0.8, 1.0f);
298 guRotate(&matrixStack[gMatrixListPos], -s0, 0.0f, 0.0f, 1.0f);
302
303 guTranslate(&matrixStack[gMatrixListPos], x2, SCREEN_HEIGHT - y2, 0.0f);
305 guScale(&matrixStack[gMatrixListPos], (1.0f - s0 / 255.0f) * 0.8, (1.0f - s0 / 255.0f) * 0.8, 1.0f);
307 guRotate(&matrixStack[gMatrixListPos], -s0, 0.0f, 0.0f, 1.0f);
311
312 guTranslate(&matrixStack[gMatrixListPos], 0.0f, 0.0f, 0.0f);
314 gDPSetPrimColor(gMainGfxPos++, 0, 0, 0, 0, 0, alpha);
317 break;
319 s0 = progress;
320 gDPSetPrimColor(gMainGfxPos++, 0, 0, 0, 0, 0, 0);
321 guTranslate(&matrixStack[gMatrixListPos], x1, SCREEN_HEIGHT - y1, 0.0f);
323 guScale(&matrixStack[gMatrixListPos], (1.0f - s0 / 255.0f) * 0.8, (1.0f - s0 / 255.0f) * 0.8, 1.0f);
325 guRotate(&matrixStack[gMatrixListPos], (f32)(-s0) * 0.5, 0.0f, 0.0f, 1.0f);
329
330 guTranslate(&matrixStack[gMatrixListPos], 0.0f, 0.0f, 0.0f);
332 gDPSetPrimColor(gMainGfxPos++, 0, 0, 0, 0, 0, alpha);
335 v0 = progress + 40;
336 if (progress > 170) {
337 v0 = 170;
338 }
340 break;
344 break;
345 case OVERLAY_BLUR:
347 break;
350 appendGfx_darkness_stencil(false, x1, y1, alpha, progress);
351 break;
352 case OVERLAY_INTRO_1:
353 case OVERLAY_INTRO_2:
354 break;
355 }
356
358}
BSS s32 PopupMenu_SelectedIndex
Mtx matrixStack[0x200]
#define draw_prev_frame_buffer_at_screen_pos
#define guTranslate
@ OVERLAY_VIEWPORT_STAR
Definition enums.h:2379
@ OVERLAY_BLUR
Definition enums.h:2386
@ OVERLAY_SCREEN_MARIO
Definition enums.h:2381
@ OVERLAY_VIEWPORT_MARIO
Definition enums.h:2378
@ OVERLAY_START_BATTLE
Definition enums.h:2384
@ OVERLAY_SCREEN_SPOTLIGHT
Definition enums.h:2380
@ OVERLAY_SCREEN_COLOR
Definition enums.h:2374
@ OVERLAY_VIEWPORT_COLOR
Definition enums.h:2375
@ OVERLAY_INTRO_2
Definition enums.h:2389
@ OVERLAY_INTRO_1
Definition enums.h:2388
@ OVERLAY_BATTLE_DARKNESS
Definition enums.h:2387
@ OVERLAY_TYPE_2
Definition enums.h:2376
@ OVERLAY_WORLD_DARKNESS
Definition enums.h:2385
@ OVERLAY_VIEWPORT_SPOTLIGHT
Definition enums.h:2377
@ OVERLAY_TYPE_9
Definition enums.h:2383
@ OVERLAY_SCREEN_STAR
Definition enums.h:2382
Color_RGB8 color
Definition overlay.h:7
void appendGfx_darkness_stencil(s32, s32, s32, f32, f32)
s32 screenPos[2][2]
Definition overlay.h:9
void appendGfx_screen_transition_stencil(s32, s32, f32, s32, s32, s32, s32, s32)
Gfx D_8014E8F0[]
Gfx D_8014EA48[]
Gfx Gfx_LoadStencilTex_Star[]
Gfx Gfx_LoadStencilTex_BlurryCircle[]
Gfx Gfx_LoadStencilTex_SharpCircle[]
Gfx D_8014E9A8[]
Gfx Gfx_LoadStencilTex_Mario[]
#define SCREEN_WIDTH
Definition macros.h:109
#define SCREEN_HEIGHT
Definition macros.h:110
Camera gCameras[4]
Definition cam_main.c:16
Gfx * gMainGfxPos
Definition cam_main.c:14
u16 gMatrixListPos
Definition main_loop.c:44
s32 gCurrentCameraID
Definition cam_math.c:5
DisplayContext * gDisplayContext
Definition cam_main.c:15

Referenced by gfx_draw_frame(), render_screen_overlay_backUI(), and render_screen_overlay_frontUI().

◆ appendGfx_screen_transition_stencil()

void appendGfx_screen_transition_stencil ( s32 arg0,
s32 arg1,
f32 progress,
s32 primR,
s32 primG,
s32 primB,
s32 primA,
s32 camID )

Definition at line 246 of file screen_render_util.c.

246 {
247 s32 x1, y1, x2, y2, t5, t6;
249
250 if (camID >= 0) {
255 t5 = x1;
256 t6 = y1;
257 } else {
258 x1 = 0;
259 y1 = 0;
262 t5 = 0;
263 t6 = 0;
264 }
265
266 if (progress == 0.0f) {
267 return;
268 }
269
271 if (progress == 255.0f) {
273 }
274 gDPSetPrimColor(gMainGfxPos++, 0, 0, primR, primG, primB, primA);
275 texScale = (255.0f - progress) * 10.5f / 255.0f + 0.09; // range from
277 (t5 - arg0) * 32.0f / texScale + 16.0f + 1024.0f, (t6 - arg1) * 32.0f / texScale + 16.0f + 1024.0f,
278 1024.0f / texScale, 1024.0f / texScale);
280}
#define PM_CC_PRIM_FULL_ALPHA
Definition macros.h:296
s16 viewportStartX
s16 viewportStartY

Referenced by _render_transition_stencil().

◆ appendGfx_darkness_stencil()

void appendGfx_darkness_stencil ( s32 ,
s32 ,
s32 ,
f32 ,
f32  )