Fix falsey value bug causing certain tinted objects to display colour… #214
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.
We were finding some objects not looking quite right in our fork for Two Hours One Life. I found that when a sprite has its tint/colour modified in the editor, the colouring would not be displayed in some cases. For example, we have one clothing type which has several variants. Default, red, blue and black had no issue, but green showed grey.
In the data for the object, this colour modification is represented as:
color=0.000000,0.521127,0.190835
for this object. But it could just as easily be1.000000,0.000000,0.190835
or1.000000,1.0000000.000000
and be susceptible.Eventually it was narrowed down to this part where the value 0 was being interpreted as false. It would apply whenever any of the 3 values were equal to 0 and any of the preceding values were 1.
As far as I can tell, this has always been a problem. This change (unexpectedly) had an effect on processing of approximately 1,600 sprites for 2HOL.
Our issue tracking this: twohoursonelife#42
This doesn't perfect transparency, but it helps with the effect. See twohoursonelife#43
Before:
After: