Skip to content

Icon closeup zoom and pos for ships and weapons#7398

Open
MjnMixael wants to merge 1 commit intoscp-fs2open:masterfrom
MjnMixael:icon-closeup-values
Open

Icon closeup zoom and pos for ships and weapons#7398
MjnMixael wants to merge 1 commit intoscp-fs2open:masterfrom
MjnMixael:icon-closeup-values

Conversation

@MjnMixael
Copy link
Copy Markdown
Contributor

@MjnMixael MjnMixael commented Apr 22, 2026

Adds +icon_closesup_pos and +icon_closeup_zoom to both weapons and ships. Fixes #601 and Fixes #1986 .

Issue 601 was reported in 2016 and the codebase has changed a lot in ten years. [Citation needed] Best I can tell, weapons actually do respect closeup_zoom in the icon rendering method these days. In fact the render method had params specifically to pass that value for weapons. It also passed closeup_pos but that's immediately discarded for auto-centering. I suspect the auto-centering is the root cause of both reported issues.

Auto-centering is needed for weapons because if a tech model is not defined, then the in-mission model is used and most missiles in retail have their centerpoint at the engine bell rather than at visual center. That, however, is not always true so no assumptions can be made and the auto-centering was doing the best it could. This could be fixed in a hacky way by moving the centerpoint in the POF to force the auto-centering to pick a camera position that got the model to be a proper size. This is what modern MediaVPs releases do. Of course, that only works for tech models, not in-game models because the centerpoint doesn't really matter for tech models.

To complicate the issue, closeup_zoom and closeup_pos are really intended for tech room or weapon closeup views in weapon select. There's no value that will work for both view locations AND icons because the icons are just rendered and positioned differently.

So the fix here is to add icon-specific closeup zoom/pos values, leaving the old methods intact because they do a passable job. The new values provide designers a way to really make this work correctly and tweak exactly how their icons are sized and positioned in the icon frame.

I added ships versions here, too, because it's cheap and keeps them in sync in a way that feels intuitive.

I also took the liberty of cleaning up the params of model_render_icon() because it was pretty terrible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Weapon models should be larger in ship loadout +Closeup Zoom: doesn't work for 3D Weapon Icons

1 participant