Skip to content

Fix tint color RGB mode conversion#2200

Merged
Coronia merged 5 commits intoPhobos-developers:developfrom
shatyuka:fix/tint-color
May 8, 2026
Merged

Fix tint color RGB mode conversion#2200
Coronia merged 5 commits intoPhobos-developers:developfrom
shatyuka:fix/tint-color

Conversation

@shatyuka
Copy link
Copy Markdown
Contributor

@shatyuka shatyuka commented May 5, 2026

The game's code looks weird because the switch case forgot to add break.

Has very little impact on the vanilla game:

TintColor RGB565 Before RGB565 After RGB24 Before RGB24 After
IronCurtain 0x0000 0x0000 #000000 #000000
ForceShield 0x0018 0x0018 #0000C6 #0000C6
Berserk 0xE000 0xC000 #E70000 #C60000

Vanilla Berserk tint in game:

Before After
before after

Update: Custom tint color for better comparison, R=21, G=21, B=0

RGB565 Before RGB565 After RGB24 Before RGB24 After
0xFFE0 0xAAA0 #FFFF00 #AD5500

Custom tint in game:

Before After
before after

@DeathFishAtEase DeathFishAtEase added ⚙️T1 T1 maintainer review is sufficient Bugfix This is a bugfix that does not need documentation beyond mention in changelog labels May 5, 2026
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 6, 2026

Nightly build for this pull request:

This comment is automatic and is meant to allow guests to get latest nightly builds for this pull request without registering. It is updated on every successful build.

@Coronia Coronia added the Tested label May 6, 2026
@Coronia Coronia requested a review from TaranDahl May 6, 2026 09:31
@DeathFishAtEase
Copy link
Copy Markdown
Collaborator

How was this PR tested? I don't seem to see a comparison of Berserk in vanilla YR before and after the changes in this PR, although I'm afraid we need to compare the color codes in the game screen to see the difference.

@shatyuka
Copy link
Copy Markdown
Contributor Author

shatyuka commented May 6, 2026

How was this PR tested? I don't seem to see a comparison of Berserk in vanilla YR before and after the changes in this PR, although I'm afraid we need to compare the color codes in the game screen to see the difference.

Comparison attached.

Comment thread src/Utilities/GeneralUtils.cpp
@TaranDahl TaranDahl added Will be merged in 24h This PR will be merged in 24 hours if no one has further instructions. Tested and removed Tested labels May 8, 2026
@Coronia
Copy link
Copy Markdown
Contributor

Coronia commented May 8, 2026

The game's code looks weird because the switch case forgot to add break.

Has very little impact on the vanilla game:

TintColor RGB565 Before RGB565 After RGB24 Before RGB24 After
IronCurtain 0x0000 0x0000 #000000 #000000
ForceShield 0x0018 0x0018 #0000C6 #0000C6
Berserk 0xE000 0xC000 #E70000 #C60000
Vanilla Berserk tint in game:

Before After
before after
Update: Custom tint color for better comparison, R=21, G=21, B=0

RGB565 Before RGB565 After RGB24 Before RGB24 After
0xFFE0 0xAAA0 #FFFF00 #AD5500
Custom tint in game:

Before After
before after

if R and G have the same values, then the final RGB24 should still have R and G being the same I assume? While #FFFF00 is too deep of a yellow color, think it should at least be a shallow yellow after the fix?

@Coronia Coronia requested a review from NetsuNegi May 8, 2026 05:21
@shatyuka
Copy link
Copy Markdown
Contributor Author

shatyuka commented May 8, 2026

if R and G have the same values, then the final RGB24 should still have R and G being the same I assume? While #FFFF00 is too deep of a yellow color, think it should at least be a shallow yellow after the fix?

No, it's RGB565, and the range of the green value is twice that of the red and blue.

Comment in [ColorAdd] section:

At the level that the blitters opperate, colors are 16 bit numbers, using the 5,6,5 RGB scheme. This
means that values of red range from 0 to 31, values of green from 0 to 63, and values of blue from 0
to 31.

@Coronia Coronia merged commit 32e02b4 into Phobos-developers:develop May 8, 2026
15 checks passed
DeathFishAtEase added a commit to DeathFishAtEase/Phobos that referenced this pull request May 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bugfix This is a bugfix that does not need documentation beyond mention in changelog ⚙️T1 T1 maintainer review is sufficient Tested Will be merged in 24h This PR will be merged in 24 hours if no one has further instructions.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants