Skip to content

Commit

Permalink
TTYD: Fix crashes with GX_CULL_ALL
Browse files Browse the repository at this point in the history
This shouldn't exist.
  • Loading branch information
magcius committed Jan 12, 2025
1 parent 575ed97 commit 60a0705
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/PaperMarioTTYD/AnimGroup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 };
Expand Down
2 changes: 1 addition & 1 deletion src/PaperMarioTTYD/world.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 60a0705

Please sign in to comment.