Added an argument to backface culling

This commit is contained in:
MysterD 2021-08-18 22:52:48 -07:00
parent d31eb41e7e
commit 1d23f07429

View file

@ -783,17 +783,17 @@ Gfx* geo_mirror_mario_backface_culling(s32 callContext, struct GraphNode* node,
if (callContext == GEO_CONTEXT_RENDER && isMirrorMario) { if (callContext == GEO_CONTEXT_RENDER && isMirrorMario) {
gfx = alloc_display_list(3 * sizeof(*gfx)); gfx = alloc_display_list(3 * sizeof(*gfx));
if (asGenerated->parameter == 0) { if ((asGenerated->parameter & 0x01) == 0) {
gSPClearGeometryMode(&gfx[0], G_CULL_BACK); gSPClearGeometryMode(&gfx[0], G_CULL_BACK);
gSPSetGeometryMode(&gfx[1], G_CULL_FRONT); gSPSetGeometryMode(&gfx[1], G_CULL_FRONT);
gSPEndDisplayList(&gfx[2]); gSPEndDisplayList(&gfx[2]);
} } else {
else {
gSPClearGeometryMode(&gfx[0], G_CULL_FRONT); gSPClearGeometryMode(&gfx[0], G_CULL_FRONT);
gSPSetGeometryMode(&gfx[1], G_CULL_BACK); gSPSetGeometryMode(&gfx[1], G_CULL_BACK);
gSPEndDisplayList(&gfx[2]); 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; return gfx;
} }