diff options
author | Simon Howard | 2011-10-16 16:59:19 +0000 |
---|---|---|
committer | Simon Howard | 2011-10-16 16:59:19 +0000 |
commit | 8f980fe24cb3144bf7bcb6dbcb4f29ef554fbaa3 (patch) | |
tree | 244b4dc0d50c1a6514b941ebb1d7f08a7288879a /src | |
parent | e7e8858adbf310c319dcca1a13667984d22826f6 (diff) | |
download | chocolate-doom-8f980fe24cb3144bf7bcb6dbcb4f29ef554fbaa3.tar.gz chocolate-doom-8f980fe24cb3144bf7bcb6dbcb4f29ef554fbaa3.tar.bz2 chocolate-doom-8f980fe24cb3144bf7bcb6dbcb4f29ef554fbaa3.zip |
Zero out bottom two bits of palette data, to more accurately emulate the
PC hardware that only supports 6 bits per channel (thanks GhostlyDeath).
Subversion-branch: /trunk/chocolate-doom
Subversion-revision: 2433
Diffstat (limited to 'src')
-rw-r--r-- | src/i_video.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/i_video.c b/src/i_video.c index 15e4a6b7..d671a228 100644 --- a/src/i_video.c +++ b/src/i_video.c @@ -956,11 +956,14 @@ void I_SetPalette (byte *doompalette) { int i; - for (i=0; i<256; ++i) + for (i=0; i<256; ++i) { - palette[i].r = gammatable[usegamma][*doompalette++]; - palette[i].g = gammatable[usegamma][*doompalette++]; - palette[i].b = gammatable[usegamma][*doompalette++]; + // Zero out the bottom two bits of each channel - the PC VGA + // controller only supports 6 bits of accuracy. + + palette[i].r = gammatable[usegamma][*doompalette++] & ~3; + palette[i].g = gammatable[usegamma][*doompalette++] & ~3; + palette[i].b = gammatable[usegamma][*doompalette++] & ~3; } palette_to_set = true; |