I'm loading an 16 bit TGA file and want to calculate the color like in one GAPI tutorial (for 16 bit displays):
It didnt work, so i tried to change from 0,0,0 to 255,0,0. But while changing from 0 to 255, the color changed 4 or 5 times from black to red.
- Code:
unsigned short PixelCol = 0;
if (g_gxdp.ffFormat | kfDirect565) {
PixelCol = (unsigned short)
((R & 0xff)<< 11 | (G & 0xff) << 5 | (B & 0xff));
} else if (g_gxdp.ffFormat | kfDirect555) {
PixelCol = (unsigned short)
((R & 0xff)<< 10 | (G & 0xff) << 5 | (B & 0xff));
It didnt work, so i tried to change from 0,0,0 to 255,0,0. But while changing from 0 to 255, the color changed 4 or 5 times from black to red.