- Just remembered that the true color stuff generates textures differently. Changed the previous commit to expand 1, 2, and 4 bit grayscale images while reading the PNG instead of changing the palette.

SVN r4289 (trunk)
This commit is contained in:
Braden Obrzut 2013-05-26 04:56:52 +00:00
commit b493d8e823
4 changed files with 30 additions and 43 deletions

View file

@ -297,33 +297,17 @@ FPNGTexture::FPNGTexture (FileReader &lump, int lumpnum, const FString &filename
case 0: // Grayscale
if (!bAlphaTexture)
{
BYTE *GrayMapSrc;
switch(BitDepth)
{
default:
GrayMapSrc = GrayMap;
break;
case 4:
GrayMapSrc = GrayMap4bit;
break;
case 2:
GrayMapSrc = GrayMap2bit;
break;
case 1:
GrayMapSrc = GrayMap1bit;
break;
}
if (colortype == 0 && havetRNS && trans[0] != 0)
{
bMasked = true;
PaletteSize = 1<<BitDepth;
PaletteMap = new BYTE[PaletteSize];
memcpy (PaletteMap, GrayMapSrc, 256);
PaletteSize = 256;
PaletteMap = new BYTE[256];
memcpy (PaletteMap, GrayMap, 256);
PaletteMap[trans[0]] = 0;
}
else
{
PaletteMap = GrayMapSrc;
PaletteMap = GrayMap;
}
}
break;