- Fixed: 4, 2, and 1 bit grayscale images weren't properly supported.
- Fixed: Valgrind uninitialized memory error and a signed/unsigned warning. SVN r4288 (trunk)
This commit is contained in:
parent
17c7c32a58
commit
dabd48ab81
5 changed files with 41 additions and 5 deletions
|
|
@ -56,13 +56,29 @@ struct TexCreateInfo
|
|||
};
|
||||
|
||||
BYTE FTexture::GrayMap[256];
|
||||
BYTE FTexture::GrayMap4bit[16];
|
||||
BYTE FTexture::GrayMap2bit[4];
|
||||
BYTE FTexture::GrayMap1bit[2];
|
||||
|
||||
void FTexture::InitGrayMap()
|
||||
{
|
||||
for (int i = 0; i < 256; ++i)
|
||||
{
|
||||
GrayMap[i] = ColorMatcher.Pick (i, i, i);
|
||||
if(i < 16)
|
||||
{
|
||||
const int i4 = i|(i<<4);
|
||||
GrayMap4bit[i] = ColorMatcher.Pick (i4, i4, i4);
|
||||
}
|
||||
if(i < 4)
|
||||
{
|
||||
const int i2 = i|(i<<2)|(i<<4)|(i<<6);
|
||||
GrayMap4bit[i] = ColorMatcher.Pick (i2, i2, i2);
|
||||
}
|
||||
}
|
||||
|
||||
GrayMap1bit[0] = ColorMatcher.Pick (0, 0, 0);
|
||||
GrayMap1bit[1] = ColorMatcher.Pick (255, 255, 255);
|
||||
}
|
||||
|
||||
FTexture *IMGZTexture_TryCreate(FileReader &, int lumpnum);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue