mirror of
https://github.com/kichikuou/xsystem35-sdl2.git
synced 2026-09-22 22:48:08 +03:00
VSP: Appropriately scale 4-bit color to 8-bit
This fixes a bug where VSP image was displayed slightly darker than the original.
This commit is contained in:
@@ -78,15 +78,10 @@ static vsp_header *extract_header(BYTE *b) {
|
||||
* b : raw data (pointer to palette)
|
||||
*/
|
||||
static void getpal(Palette256 *pal, BYTE *b) {
|
||||
int red, green, blue, i;
|
||||
|
||||
for (i = 0; i < 16; i++) {
|
||||
blue = b[i * 3 + 0];
|
||||
red = b[i * 3 + 1];
|
||||
green = b[i * 3 + 2];
|
||||
pal->red[i] = (red << 4);
|
||||
pal->green[i] = (green << 4);
|
||||
pal->blue[i] = (blue << 4);
|
||||
for (int i = 0; i < 16; i++) {
|
||||
pal->blue[i] = b[i * 3 + 0] * 17;
|
||||
pal->red[i] = b[i * 3 + 1] * 17;
|
||||
pal->green[i] = b[i * 3 + 2] * 17;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user