Skip to content
This repository has been archived by the owner on Dec 31, 2020. It is now read-only.

Weird code in BlockCTX1::evaluatePalette #293

Open
Triang3l opened this issue Jan 12, 2019 · 0 comments
Open

Weird code in BlockCTX1::evaluatePalette #293

Triang3l opened this issue Jan 12, 2019 · 0 comments

Comments

@Triang3l
Copy link

In BlockCTX1::evaluatePalette, there appears to be pretty weird logic in two places.

First, color_array[0] is written in BGRA order rather than RGBA, so three indices have something in B (and zero in R), but index 0 has the endpoint color in R (and zero in B).

Also the line color_array[1].g = col0[1]; seems like a bug — it uses the color of the first endpoint where the second endpoint probably should be used, and only for one component — blue has col1[0].

I don't know what // Does bit expansion before interpolation. comment means though, maybe something is intentional here, but that looks completely strange. CTX1 is supposed to be pretty much the equivalent of DXT3/DXT5 color encoding, but for two 8-bit components rather than RGB565 according to http://fileadmin.cs.lth.se/cs/Personal/Michael_Doggett/talks/unc-xenos-doggett.pdf

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant