[ZScript] Unexpected results from color math

Bugs that have been investigated and resolved somehow.

Moderator: GZDoom Developers

Forum rules
Please don't bump threads here if you have a problem - it will often be forgotten about if you do. Instead, make a new thread here.
Post Reply
User avatar
Marisa the Magician
Posts: 3886
Joined: Fri Feb 08, 2008 9:15 am
Preferred Pronouns: She/Her
Operating System Version (Optional): (btw I use) Arch
Graphics Processor: nVidia with Vulkan support
Location: Vigo, Galicia
Contact:

[ZScript] Unexpected results from color math

Post by Marisa the Magician »

Multiplying/dividing a color by a scalar has some unexpected results. I would have assumed it'd go component by component, but instead what it does is run the operation on the whole unsigned int. What this means is that, for example, halving pure white (FF FF FF) results in light cyan (7F FF FF) instead of gray (7F 7F 7F). Should this be corrected?
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49067
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: [ZScript] Unexpected results from color math

Post by Graf Zahl »

A color is just an integer internally. The fact that you can extract the channels separately does not change this. It's very much what the internal PalEntry represents, that also applies to the features it exposes.
Post Reply

Return to “Closed Bugs [GZDoom]”