Skip to content

[GEN] Fix wrong water color on radar #823

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

Merged
merged 1 commit into from
May 7, 2025

Conversation

roossienb
Copy link

@roossienb roossienb commented May 7, 2025

@roossienb roossienb self-assigned this May 7, 2025
@roossienb roossienb added Minor Severity: Minor < Major < Critical < Blocker Generals Related Generals only Fix Is fixing something labels May 7, 2025
@Mauller
Copy link

Mauller commented May 7, 2025

Did you see how this is handled in zero hour?

It's likely that zero hour implicitly sets these between 0 and 1 in config somewhere else.

@roossienb
Copy link
Author

roossienb commented May 7, 2025

The radar water color has a default value defined in water.h in integer-notation (0-255)
When the application starts, it first assigns this default value.
Then it tries to load any overrides from ini's. However in the INI parser the integers (0-255) is parsed into a float value (0-1)

RadarWaterColor is defined in ZH's ini file, but not in Generals. Generals didn't use an INI reader for radar water calor before the backport introduced in #777 So Generals returns to the default value (in integer notation), while ZH returns the INI value that is converted to float-notation by the INI parser.

The original bug was in ZH (default values being integer, rather then float), but wasn't discovered, because INI overwrote them. With no INI in generals, the bug appeared.

The fix should be to convert the default value from integer to float notation for both games, although ZH uses the INI. Will adjust accordingly

@roossienb roossienb force-pushed the hotfix/fix-water-radar branch from 7784eac to 17596b7 Compare May 7, 2025 08:51
@OmniBlade
Copy link

The radar water color has a default value defined in water.h in integer-notation (0-255) When the application starts, it first assigns this default value. Then it tries to load any overrides from ini's. However in the INI parser the integers (0-255) is parsed into a float value (0-1)

RadarWaterColor is defined in ZH's ini file, but not in Generals. So Generals returns to the default value (in integer notation), while ZH returns the INI value that is converted to float-notation by the INI parser.

RadarWaterColor is a value that can be overridden by maps as well. So not all maps in GEN may bug out - which may explain why we didn't pick up on it initially.

The fix should be to convert the default value from integer to float notation for both games, although ZH uses the INI. Will adjust accordingly

Does Generals have a parser for the ini and just not have it defined? Might want to also back port the parser if not to align things more with the ZH code?

@roossienb
Copy link
Author

roossienb commented May 7, 2025

Does Generals have a parser for the ini and just not have it defined? Might want to also back port the parser if not to align things more with the ZH code?

RGB parser is present, its just the INI configuration that is the issue

@roossienb roossienb force-pushed the hotfix/fix-water-radar branch from 17596b7 to fd24bed Compare May 7, 2025 09:37
@xezon xezon changed the title [GEN] Fix water on radar not being rendered [GEN] Fix wrong water color on radar May 7, 2025
@xezon xezon merged commit dffe08d into TheSuperHackers:main May 7, 2025
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Fix Is fixing something Generals Related Generals only Minor Severity: Minor < Major < Critical < Blocker
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[GEN] Radar does not render water
4 participants