- Fixed: Memory error when loading BMF palettes.

- Fixed: When locating WhiteIndex and BlackIndex in the palette index 0 was skipped.
- Fixed: When filling an area black for vid_fps or pillarbox/letterbox use GPalette.BlackIndex instead of assuming palette index 0 is black.

SVN r3807 (trunk)
This commit is contained in:
Braden Obrzut 2012-08-06 09:49:15 +00:00
parent 4ac8f5eae4
commit cb413c600e
4 changed files with 9 additions and 9 deletions

View File

@ -837,10 +837,10 @@ void DCanvas::FillBorder (FTexture *img)
}
else
{
Clear (0, 0, Width, bordtop, 0, 0); // Top
Clear (0, bordtop, bordleft, Height - bordbottom, 0, 0); // Left
Clear (Width - bordright, bordtop, Width, Height - bordbottom, 0, 0); // Right
Clear (0, Height - bordbottom, Width, Height, 0, 0); // Bottom
Clear (0, 0, Width, bordtop, GPalette.BlackIndex, 0); // Top
Clear (0, bordtop, bordleft, Height - bordbottom, GPalette.BlackIndex, 0); // Left
Clear (Width - bordright, bordtop, Width, Height - bordbottom, GPalette.BlackIndex, 0); // Right
Clear (0, Height - bordbottom, Width, Height, GPalette.BlackIndex, 0); // Bottom
}
}

View File

@ -1304,7 +1304,7 @@ void FSingleLumpFont::FixupPalette (BYTE *identity, double *luminosity, const BY
identity[0] = 0;
palette += 3; // Skip the transparent color
for (i = 1; i <= ActiveColors; ++i, palette += 3)
for (i = 1; i < ActiveColors; ++i, palette += 3)
{
int r = palette[0];
int g = palette[1];
@ -1331,7 +1331,7 @@ void FSingleLumpFont::FixupPalette (BYTE *identity, double *luminosity, const BY
{
diver = 1.0 / 255.0;
}
for (i = 1; i <= ActiveColors; ++i)
for (i = 1; i < ActiveColors; ++i)
{
luminosity[i] = (luminosity[i] - minlum) * diver;
}

View File

@ -159,8 +159,8 @@ void FPalette::SetPalette (const BYTE *colors)
// Find white and black from the original palette so that they can be
// used to make an educated guess of the translucency % for a BOOM
// translucency map.
WhiteIndex = BestColor ((DWORD *)BaseColors, 255, 255, 255);
BlackIndex = BestColor ((DWORD *)BaseColors, 0, 0, 0);
WhiteIndex = BestColor ((DWORD *)BaseColors, 255, 255, 255, 0, 255);
BlackIndex = BestColor ((DWORD *)BaseColors, 0, 0, 0, 0, 255);
}
// In ZDoom's new texture system, color 0 is used as the transparent color.

View File

@ -859,7 +859,7 @@ void DFrameBuffer::DrawRateStuff ()
chars = mysnprintf (fpsbuff, countof(fpsbuff), "%2u ms (%3u fps)", howlong, LastCount);
rate_x = Width - chars * 8;
Clear (rate_x, 0, Width, 8, 0, 0);
Clear (rate_x, 0, Width, 8, GPalette.BlackIndex, 0);
DrawText (ConFont, CR_WHITE, rate_x, 0, (char *)&fpsbuff[0], TAG_DONE);
DWORD thisSec = ms/1000;