- finished verification of proper texture generation and fixed a few remaining issues.

Aside from PCX 4 bit, uncompressed PCX and TGA grayscale for which I was unable to obtain test images, all others now produce proper textures in both 8 and 32 bit mode.
This commit is contained in:
Christoph Oelckers 2018-03-23 19:52:08 +01:00
commit 4c781a8f65
4 changed files with 17 additions and 16 deletions

View file

@ -392,19 +392,20 @@ uint8_t *FPCXTexture::MakeTexture(FRenderStyle style)
{
if (bitcount < 8)
{
for (int i = 0; i < 16; i++)
{
PaletteMap[i] = RGBToPalettePrecise(alphatex, header.palette[i * 3], header.palette[i * 3 + 1], header.palette[i * 3 + 2]);
}
switch (bitcount)
{
default:
case 1:
PaletteMap[0] = alphatex? 0 : GrayMap[0];
PaletteMap[1] = alphatex? 255 : GrayMap[255];
ReadPCX1bit (Pixels, lump, &header);
break;
case 4:
for (int i = 0; i < 16; i++)
{
PaletteMap[i] = RGBToPalettePrecise(alphatex, header.palette[i * 3], header.palette[i * 3 + 1], header.palette[i * 3 + 2]);
}
ReadPCX4bits (Pixels, lump, &header);
break;
}