From 1d23f074299c7856f04cef10ad1e45f3d4987ba6 Mon Sep 17 00:00:00 2001 From: MysterD Date: Wed, 18 Aug 2021 22:52:48 -0700 Subject: [PATCH] Added an argument to backface culling --- src/game/mario_misc.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/game/mario_misc.c b/src/game/mario_misc.c index 45cf61b9..18ff59d1 100644 --- a/src/game/mario_misc.c +++ b/src/game/mario_misc.c @@ -783,17 +783,17 @@ Gfx* geo_mirror_mario_backface_culling(s32 callContext, struct GraphNode* node, if (callContext == GEO_CONTEXT_RENDER && isMirrorMario) { gfx = alloc_display_list(3 * sizeof(*gfx)); - if (asGenerated->parameter == 0) { + if ((asGenerated->parameter & 0x01) == 0) { gSPClearGeometryMode(&gfx[0], G_CULL_BACK); gSPSetGeometryMode(&gfx[1], G_CULL_FRONT); gSPEndDisplayList(&gfx[2]); - } - else { + } else { gSPClearGeometryMode(&gfx[0], G_CULL_FRONT); gSPSetGeometryMode(&gfx[1], G_CULL_BACK); gSPEndDisplayList(&gfx[2]); } - asGenerated->fnNode.node.flags = (asGenerated->fnNode.node.flags & 0xFF) | (LAYER_OPAQUE << 8); + u32 layer = ((asGenerated->parameter & 0x02) == 2) ? LAYER_TRANSPARENT : LAYER_OPAQUE; + asGenerated->fnNode.node.flags = (asGenerated->fnNode.node.flags & 0xFF) | (layer << 8); } return gfx; }