diff options
| author | Archez <Archez@users.noreply.github.com> | 2024-02-27 08:04:35 -0500 |
|---|---|---|
| committer | Garrett Cox <garrettjcox@gmail.com> | 2024-05-22 09:04:59 -0500 |
| commit | f4aec1ed0a228e62543ccd8bc9b667eaeea1c6ec (patch) | |
| tree | bb8a4ef2170a7148d29957f975cae4d531be8181 /mm/src/code | |
| parent | 45bf29faded4730c2ffcffe8fd2de0d7d9333201 (diff) | |
Implement VisMono with custom framebuffer effects (#136)
Diffstat (limited to 'mm/src/code')
| -rw-r--r-- | mm/src/code/z_play.c | 9 | ||||
| -rw-r--r-- | mm/src/code/z_visfbuf.c | 4 |
2 files changed, 9 insertions, 4 deletions
diff --git a/mm/src/code/z_play.c b/mm/src/code/z_play.c index 51baee7c4..305e1f687 100644 --- a/mm/src/code/z_play.c +++ b/mm/src/code/z_play.c @@ -1276,8 +1276,13 @@ void Play_DrawMain(PlayState* this) { TransitionFade_Draw(&this->unk_18E48, &sp218); if (gVisMonoColor.a != 0) { - sPlayVisMono.primColor.rgba = gVisMonoColor.rgba; - VisMono_Draw(&sPlayVisMono, &sp218); + // 2S2H [Port] Implement VisMono by performing a framebuffer copy and redraw with an active + // grayscale command to set the mono color + FB_CopyToFramebuffer(&sp218, 0, gReusableFrameBuffer, false, NULL); + gDPSetGrayscaleColor(sp218++, gVisMonoColor.r, gVisMonoColor.g, gVisMonoColor.b, gVisMonoColor.a); + gSPGrayscale(sp218++, true); + FB_DrawFromFramebuffer(&sp218, gReusableFrameBuffer, 255); + gSPGrayscale(sp218++, false); } gSPEndDisplayList(sp218++); diff --git a/mm/src/code/z_visfbuf.c b/mm/src/code/z_visfbuf.c index bf777d986..b1d3fa4e1 100644 --- a/mm/src/code/z_visfbuf.c +++ b/mm/src/code/z_visfbuf.c @@ -170,7 +170,7 @@ void VisFbuf_ApplyEffects(VisFbuf* this, Gfx** gfxP, void* source, void* img, s3 G_AD_PATTERN | G_CD_MAGICSQ | G_CK_NONE | G_TC_CONV | G_TF_POINT | G_TT_NONE | G_TL_TILE | G_TD_CLAMP | G_TP_NONE | G_CYC_COPY | G_PM_NPRIMITIVE, G_AC_NONE | G_ZS_PIXEL | G_RM_NOOP | G_RM_NOOP2); - FB_CopyToFramebuffer(&gfx, 0, gShrinkFrameBuffer, false, NULL); + FB_CopyToFramebuffer(&gfx, 0, gReusableFrameBuffer, false, NULL); gDPPipeSync(gfx++); // fill framebuffer with primColor @@ -224,7 +224,7 @@ void VisFbuf_ApplyEffects(VisFbuf* this, Gfx** gfxP, void* source, void* img, s3 // 2S2H [Port][Widescreen] // Draw shrunk window using an adjusted horizontal scale accounting for different aspect ratios - FB_DrawFromFramebufferScaled(&gfx, gShrinkFrameBuffer, 255, + FB_DrawFromFramebufferScaled(&gfx, gReusableFrameBuffer, 255, (1.0f - scale) * (OTRGetAspectRatio() / ((float)SCREEN_WIDTH / SCREEN_HEIGHT)), (1.0f - scale)); } |
