Skip to content

Remove dead modelinterp code - #7782

Open
Goober5000 wants to merge 2 commits into
scp-fs2open:masterfrom
Goober5000:cleanup/modelinterp
Open

Goober5000 wants to merge 2 commits into
scp-fs2open:masterfrom
Goober5000:cleanup/modelinterp

Conversation

@Goober5000

@Goober5000 Goober5000 commented Sep 13, 2026

Copy link
Copy Markdown
Contributor

Follow-up cleanup from the memory leak investigation in #7781.

  • Remove dead code. model_interp_defpoints has had no callers since model_interp_sub was removed in 2016. The parse_bsp and find_tri_counts chains have had no entry point since bsp_polygon_data replaced them in 2015. This also removes the globals that only they used.
  • Remove the interp-data allocator. On big-endian builds, swap_bsp_defpoints was the last caller of model_allocate_interp_data, and swap_bsp_flatpoly the last reader of Interp_verts. The BSP swap functions now pass a local vertex list instead, so the allocator, the deallocator, and the Interp_* buffers are gone.

Tested with Debug builds of fs2_open, FRED2, qtfred and the unit tests.

Now in draft as it depends on #7791

@Goober5000 Goober5000 added the cleanup A modification or rewrite of code to make it more understandable or easier to maintain. label Sep 13, 2026
@notimaginative

Copy link
Copy Markdown
Contributor

This includes #7781, was that intentional?

@Goober5000

Copy link
Copy Markdown
Contributor Author

This includes #7781, was that intentional?

Yes, because this branch is based on that one. I'd do a stacked PR, but those aren't supported across forks unfortunately.

@notimaginative

Copy link
Copy Markdown
Contributor

Nothing is jumping out at me. Except that the big-endian change is a proper fix for 26.2 and the rest really isn't. Any chance of getting that that one split into it's own PR?

@Goober5000

Copy link
Copy Markdown
Contributor Author

Nothing is jumping out at me. Except that the big-endian change is a proper fix for 26.2 and the rest really isn't. Any chance of getting that that one split into it's own PR?

Can do -- #7791

@Goober5000
Goober5000 marked this pull request as draft September 18, 2026 02:47
Goober5000 and others added 2 commits September 19, 2026 14:43
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>
@Goober5000
Goober5000 marked this pull request as ready for review September 19, 2026 18:43
@Goober5000

Copy link
Copy Markdown
Contributor Author

Rebased now that #7781 and #7791 have been merged.

@Goober5000 Goober5000 changed the title Remove dead modelinterp code and fix big-endian BSP swapping Remove dead modelinterp code Sep 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cleanup A modification or rewrite of code to make it more understandable or easier to maintain.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants