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

Fix color when decoding image 4444 #10

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

Aireil
Copy link

@Aireil Aireil commented Apr 3, 2023

I'm guessing the same issue applies to decodeImage4444split1channel and decodeImage4444split in the same file, but I couldn't find a texture using those to test, so I didn't touch them.

@goaaats
Copy link
Owner

goaaats commented Apr 3, 2023

Could you leave a comment explaining the fix, and point to it in the implementations you didn't touch?

@Aireil
Copy link
Author

Aireil commented Apr 3, 2023

Well, not sure why it works, just saw that a status effect icon that was red in-game was blue in Explorer, so I swapped those two and it worked 🐮. I can add a comment to say that it's probably swapped in the untouched ones though yeah.

@Aireil
Copy link
Author

Aireil commented Apr 3, 2023

There, not sure if that's what you wanted? 😳

@Charlignon
Copy link

Hello ! I ran into the same issue and independently found the same fix.
For reference, it happens on tex files 060000.win32.index/ui/icon/010000 to .../013000 (specifically status icons)

I don't think there is a need for commenting on the part that this PR fixes : the implementation was simply wrong to begin with, the LITTLE_ENDIAN byte order imply to read bgra and not argb. This seems to be a simple oversight, because other decoding methods using LITTLE_ENDIAN do use this order.

As per the split and splitChannel methods , I browsed a few thousand tex files and couldn't find any. We could blindly apply the fix or not, but in both cases I agree that there should be a comment on these methods (not on the one that was fixed though)
For the wording I suggest something like

// The channels may not be read in the correct order. If any issue occurs, check that the bytes are read in accordance to ByteOrder. You can refer to decodeImageRGBA or decodeImage4444 for other implementations.

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.

3 participants