Page 1 of 1
8bit to 16 bit value

Posted:
Jan 5, 2002 @ 10:34am
by R0B
Ok, here is the deal. I have an 8bit color value stored in a byte. I need to convert it into a 16 bit color value so it can be displayed on the screen. I'm not sure of the exact format of the 8 bit value, but my guess would be 3-3-2. What would you guys recomend I do?
Re: 8bit to 16 bit value

Posted:
Jan 5, 2002 @ 11:03am
by MirekCz
isn't it using a palette?<br>if not, simple convert it to 16bpp and try 3-3-2,3-2-3,2-3-3 formats in case you get some problems. It might also be a "brightness" describing value which simple shouldn't be transfered to 16bpp at all. Hard to say without source.
Re: 8bit to 16 bit value

Posted:
Jan 5, 2002 @ 11:25am
by Dan East
Being your porting an id Software game, I can almost guarantee beyond any doubt that it is a palletized image, as Mirek said. Wolf3D, Quake1 and Quake2 are almost identical in that respect, so Doom would obviously not be radically different. Plus 8 bit RGB would look like total crap.<br>In the display implementation file there should be a SetPalette type function that is passed an array of RGB components which are 24 bit total for each entry. You should convert them to RGB 565 at that time and store them in a global array. When you blit out the display you just look up the bitmap pixel values into that palette array. Look at the PQ source, you should be able to practically copy / paste that over, especially since you modified it for the 720 already.<br><br>Dan East