DentonW / DevIL

Developer's Image Library (DevIL) is a cross-platform image library utilizing a simple syntax to load, save, convert, manipulate, filter, and display a variety of images with ease. It is highly portable and has been ported to several platforms.
http://openil.sourceforge.net/
GNU Lesser General Public License v2.1
446 stars 137 forks source link

DXT Endpoint detection problem #83

Open JohnJScott opened 4 years ago

JohnJScott commented 4 years ago

void DxtcReadColor(ILushort Data, Color8888* Out) { ILubyte r, g, b;

b = Data & 0x1f;
g = (Data & 0x7E0) >> 5;
r = (Data & 0xF800) >> 11;

Out->r = r << 3 | r >> 2;
Out->g = g << 2 | g >> 3;
Out->b = b << 3 | r >> 2;

}

I suspect the r >> 2 when calculating Out->b should be b >> 2.

Cheers John