From ff9030f5fbfecf6e5058b4957028fbd4ea1516ba Mon Sep 17 00:00:00 2001 From: fgsfds Date: Thu, 3 Aug 2023 16:50:14 +0200 Subject: [PATCH] port: swap light bboxes properly --- port/src/preprocess.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/port/src/preprocess.c b/port/src/preprocess.c index a48996bf8..81f1ec8dd 100644 --- a/port/src/preprocess.c +++ b/port/src/preprocess.c @@ -1405,11 +1405,13 @@ void preprocessBgLights(u8 *data, u32 ofs) if (g_Rooms[i].numlights) { struct light *lit = &lbase[g_Rooms[i].lightindex]; for (s32 j = 0; j < g_Rooms[i].numlights; ++j, ++lit) { - PD_SWAP_VAL(lit->bbox->x); - PD_SWAP_VAL(lit->bbox->y); - PD_SWAP_VAL(lit->bbox->z); - PD_SWAP_VAL(lit->colour); // TODO: required? + PD_SWAP_VAL(lit->colour); PD_SWAP_VAL(lit->roomnum); + for (s32 k = 0; k < ARRAYCOUNT(lit->bbox); ++k) { + PD_SWAP_VAL(lit->bbox[k].x); + PD_SWAP_VAL(lit->bbox[k].y); + PD_SWAP_VAL(lit->bbox[k].z); + } } } }