diff --git a/include/z64scene.h b/include/z64scene.h index 4809938e47..ad762ba07d 100644 --- a/include/z64scene.h +++ b/include/z64scene.h @@ -128,8 +128,7 @@ typedef struct { } MeshHeaderPrerenderMulti; // size = 0x10 typedef struct { - /* 0x00 */ Vec3s pos; - /* 0x06 */ s16 radius; + /* 0x00 */ Sphere16 bounds; /* 0x08 */ Gfx* opa; /* 0x0C */ Gfx* xlu; } MeshHeaderCullEntry; // size = 0x10 diff --git a/src/code/z_room.c b/src/code/z_room.c index 910552f470..5859a514f5 100644 --- a/src/code/z_room.c +++ b/src/code/z_room.c @@ -135,16 +135,16 @@ void Room_DrawCullMeshes(PlayState* play, Room* room, u32 flags) { for (i = 0; i < meshHeaderCull->numEntries; i++, meshHeaderCullEntry++) { // Project the entry position, to get the depth it is at. - pos.x = meshHeaderCullEntry->pos.x; - pos.y = meshHeaderCullEntry->pos.y; - pos.z = meshHeaderCullEntry->pos.z; + pos.x = meshHeaderCullEntry->bounds.center.x; + pos.y = meshHeaderCullEntry->bounds.center.y; + pos.z = meshHeaderCullEntry->bounds.center.z; SkinMatrix_Vec3fMtxFMultXYZW(&play->viewProjectionMtxF, &pos, &projectedPos, &projectedW); // If the entry isn't fully before the rendered depth range - if (-(f32)meshHeaderCullEntry->radius < projectedPos.z) { + if (-(f32)meshHeaderCullEntry->bounds.radius < projectedPos.z) { // Compute the depth at which this entry starts - entryStartZ = projectedPos.z - meshHeaderCullEntry->radius; + entryStartZ = projectedPos.z - meshHeaderCullEntry->bounds.radius; // If the entry isn't fully beyond the rendered depth range if (entryStartZ < play->lightCtx.fogFar) {