Fix projection tagging for zoomboxes when multiple are on screen

This commit is contained in:
Mr-Wiseguy
2025-12-21 17:19:53 -05:00
parent c9a3b857a5
commit a31d5ff623
+9
View File
@@ -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);
}