Remove dead modelinterp code and fix big-endian BSP swapping - #7782
Open
Goober5000 wants to merge 3 commits into
Open
Goober5000 wants to merge 3 commits into
Goober5000 wants to merge 3 commits into
Conversation
Contributor
|
This includes #7781, was that intentional? |
Contributor
Author
Yes, because this branch is based on that one. I'd do a stacked PR, but those aren't supported across forks unfortunately. |
model_interp_defpoints has had no callers since model_interp_sub was removed (1ef7688), and the parse_bsp and find_tri_counts chains have had no entry point since bsp_polygon_data replaced them (c620372). Remove them, along with the globals that only they read: tri_count, model_radius, GEOMETRY_NOISE, Interp_flags, Interp_lights, Interp_thrust_scale_subobj and Interp_warp_scale_*. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
…x list On big-endian builds, swap_bsp_defpoints was the only remaining caller of model_allocate_interp_data, and swap_bsp_flatpoly the only reader of the buffers it allocated (Interp_verts). Pass a local vertex list through the BSP swap functions instead, and remove the allocator, the deallocator, and the Interp_* buffers and lighting globals it managed. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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
force-pushed
the
cleanup/modelinterp
branch
from
September 15, 2026 16:47
69d1ccb to
9d55df5
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up cleanup from the memory leak investigation in #7781.
model_interp_defpointshas had no callers sincemodel_interp_subwas removed in 2016. Theparse_bspandfind_tri_countschains have had no entry point sincebsp_polygon_datareplaced them in 2015. This also removes the globals that only they used.swap_bsp_defpointswas the last caller ofmodel_allocate_interp_data, andswap_bsp_flatpolythe last reader ofInterp_verts. The BSP swap functions now pass a local vertex list instead, so the allocator, the deallocator, and theInterp_*buffers are gone.swap_bsp_sortnorm2swapped the bounding box at the wrong offsets, andswap_bsp_tmap2polynever swapped its bounding box or normal. Both corrupted models that use these newer chunks on big-endian builds.Tested with Debug builds of fs2_open, FRED2, qtfred and the unit tests. The big-endian code was compile-checked by temporarily enabling it, since there's no big-endian hardware to test on.