Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cleanup 'info_view' parameter. #9646

Merged
merged 2 commits into from Oct 23, 2021
Merged

Conversation

frosch123
Copy link
Member

Motivation / Problem

Everytime 'GetRotorOverrideSprite' comes up, 'info_view' confuses me.
It turns out:

  • 'info_view' is redundant and can be derived from the easier-to-understand 'image_type'.
  • 'info_view' is only used for aircraft helicopter, so the name is quite stupid.
  • When comparing with TTDPatch behavior, 'info_view' is mostly bollocks.

Description

  • Remove the 'info_view' parameter from function signatures and calls, and derive it from 'image_type'.
  • Rename the NewGRF-code internal 'info_view' flag to 'rotor_in_gui', since that is what it means.
  • Add some comments about the bollocks.

Limitations

When it comes to NewGRF rotor sprites, OpenTTD actually differs a lot from TTDPatch.
I have to guess that 'info_view' was added to make the behavior similar to TTDPatch at some point.
But now NewGRF probably rely on the observable behavior of OpenTTD, so it no longer makes sense to adjust the behavior to match TTDPatch, even though TTDPatch exposes "more" internal 80+x variables, that some NewGRF may exploit. ("more" as in "more, but apparently unneeded")

Checklist for review

Some things are not automated, and forgotten often. This list is a reminder for the reviewers.

  • The bug fix is important enough to be backported? (label: 'backport requested')
  • This PR touches english.txt or translations? Check the guidelines
  • This PR affects the save game format? (label 'savegame upgrade')
  • This PR affects the GS/AI API? (label 'needs review: Script API')
    • ai_changelog.hpp, gs_changelog.hpp need updating.
    • The compatibility wrappers (compat_*.nut) need updating.
  • This PR affects the NewGRF API? (label 'needs review: NewGRF')

@frosch123 frosch123 merged commit 111a47a into OpenTTD:master Oct 23, 2021
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.

None yet

2 participants