diff --git a/src/v_draw.cpp b/src/v_draw.cpp index f399e4e53..87b4e0842 100644 --- a/src/v_draw.cpp +++ b/src/v_draw.cpp @@ -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 } } diff --git a/src/v_font.cpp b/src/v_font.cpp index b7d5392cd..e95613f7b 100644 --- a/src/v_font.cpp +++ b/src/v_font.cpp @@ -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; } diff --git a/src/v_palette.cpp b/src/v_palette.cpp index fa8ed4615..92182311b 100644 --- a/src/v_palette.cpp +++ b/src/v_palette.cpp @@ -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. diff --git a/src/v_video.cpp b/src/v_video.cpp index ad850f6f4..e6145cc95 100644 --- a/src/v_video.cpp +++ b/src/v_video.cpp @@ -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;