Icon closeup zoom and pos for ships and weapons#7398
Open
MjnMixael wants to merge 1 commit intoscp-fs2open:masterfrom
Open
Icon closeup zoom and pos for ships and weapons#7398MjnMixael wants to merge 1 commit intoscp-fs2open:masterfrom
MjnMixael wants to merge 1 commit intoscp-fs2open:masterfrom
Conversation
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.
Adds
+icon_closesup_posand+icon_closeup_zoomto 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_zoomin the icon rendering method these days. In fact the render method had params specifically to pass that value for weapons. It also passedcloseup_posbut 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_zoomandcloseup_posare 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.