From 60a0705531e8f48941ba38ddd2824b025e37fbb5 Mon Sep 17 00:00:00 2001 From: "Jasper St. Pierre" Date: Sun, 12 Jan 2025 14:38:35 -0800 Subject: [PATCH] TTYD: Fix crashes with GX_CULL_ALL This shouldn't exist. --- src/PaperMarioTTYD/AnimGroup.ts | 2 +- src/PaperMarioTTYD/world.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/PaperMarioTTYD/AnimGroup.ts b/src/PaperMarioTTYD/AnimGroup.ts index c506d236b..843035e9e 100644 --- a/src/PaperMarioTTYD/AnimGroup.ts +++ b/src/PaperMarioTTYD/AnimGroup.ts @@ -353,7 +353,7 @@ export function parse(buffer: ArrayBufferSlice): AnimGroup { const dispMode = view.getUint32(shapeIdx + 0xA0); const cullModeRaw = view.getUint32(shapeIdx + 0xA4); - const cullModeTable: GX.CullMode[] = [GX.CullMode.BACK, GX.CullMode.FRONT, GX.CullMode.ALL, GX.CullMode.NONE]; + const cullModeTable: GX.CullMode[] = [GX.CullMode.BACK, GX.CullMode.FRONT, GX.CullMode.NONE, GX.CullMode.NONE]; const cullMode = cullModeTable[cullModeRaw]; const shape: AnimGroupData_Shape = { name, vtxArrays, draws, dispMode, cullMode }; diff --git a/src/PaperMarioTTYD/world.ts b/src/PaperMarioTTYD/world.ts index cec3152ec..ef6f99338 100644 --- a/src/PaperMarioTTYD/world.ts +++ b/src/PaperMarioTTYD/world.ts @@ -749,7 +749,7 @@ export function parse(buffer: ArrayBufferSlice): TTYDWorld { computeModelMatrixSRT(modelMatrix, scaleX, scaleY, scaleZ, rotationX, rotationY, rotationZ, translationX, translationY, translationZ); const drawModeStructOffs = mainDataOffs + view.getUint32(offs + 0x58); - const cullModes: GX.CullMode[] = [GX.CullMode.FRONT, GX.CullMode.BACK, GX.CullMode.ALL, GX.CullMode.NONE]; + const cullModes: GX.CullMode[] = [GX.CullMode.FRONT, GX.CullMode.BACK, GX.CullMode.NONE, GX.CullMode.NONE]; const cullMode: GX.CullMode = cullModes[view.getUint8(drawModeStructOffs + 0x01)]; const drawModeFlags: DrawModeFlags = view.getUint8(drawModeStructOffs + 0x02);