Skip to content

Fix big-endian swapping of SORTNORM2 and TMAP2POLY chunks - #7791

Merged
Goober5000 merged 1 commit into
scp-fs2open:masterfrom
Goober5000:fix/bigendian_bsp_swap
Sep 19, 2026
Merged

Goober5000 merged 1 commit into
scp-fs2open:masterfrom
Goober5000:fix/bigendian_bsp_swap

Conversation

@Goober5000

@Goober5000 Goober5000 commented Sep 18, 2026 •

Copy link
Copy Markdown
Contributor

swap_bsp_sortnorm2 swapped the bounding box at offsets 8 and 20, which re-swapped the front list offset and left the real box (at 16 and 28) unswapped. swap_bsp_tmap2poly never swapped the chunk's bounding box or normal. Both corrupted models using these chunks on big-endian builds.

The big-endian code was compile-checked by temporarily enabling it, since there's no big-endian hardware to test on.

swap_bsp_sortnorm2 swapped the bounding box at offsets 8 and 20, which
re-swapped the front list offset and left the real box (at 16 and 28)
unswapped.  swap_bsp_tmap2poly never swapped the chunk's bounding box
or normal.  Both corrupted models using these chunks on big-endian
builds.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@Goober5000 Goober5000 added the fix A fix for bugs, not-a-bugs, and/or regressions. label Sep 18, 2026
@notimaginative notimaginative added this to the Release 26.2 milestone Sep 19, 2026
@Goober5000
Goober5000 merged commit d841f0a into scp-fs2open:master Sep 19, 2026
18 checks passed
@Goober5000
Goober5000 deleted the fix/bigendian_bsp_swap branch September 19, 2026 18:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fix A fix for bugs, not-a-bugs, and/or regressions.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants