From a31d5ff6235d2cb8a87ad6d006e4a2f16fb0af41 Mon Sep 17 00:00:00 2001 From: Mr-Wiseguy Date: Sun, 21 Dec 2025 17:19:53 -0500 Subject: [PATCH] Fix projection tagging for zoomboxes when multiple are on screen --- patches/projection_transform_tagging.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/patches/projection_transform_tagging.c b/patches/projection_transform_tagging.c index 9af7034..957726f 100644 --- a/patches/projection_transform_tagging.c +++ b/patches/projection_transform_tagging.c @@ -346,8 +346,17 @@ RECOMP_PATCH void func_803164B0(GcZoombox *this, Gfx **gfx, Mtx **mtx, s32 arg3, modelRender_setDepthMode(MODEL_RENDER_DEPTH_NONE); func_80344090(arg5, this->unk186, gfx); func_8033687C(gfx); + + // @recomp Set the perpsective projection transform ID before restoring the game's normal projection. + // This is because zoomboxes are drawn in the normal gameplay projection. + u32 prev_projection_id = cur_perspective_projection_transform_id; + cur_perspective_projection_transform_id = PROJECTION_GAMEPLAY_TRANSFORM_ID; + viewport_setRenderViewportAndPerspectiveMatrix(gfx, mtx); + // @recomp Reset the projection ID. + cur_perspective_projection_transform_id = prev_projection_id; + // @recomp Pop the model matrix group. gEXPopMatrixGroup((*gfx)++, G_MTX_MODELVIEW); }