mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2024-12-22 17:49:43 +01:00
Optimization: Don't outline if room name BG opaque
This is quite simple. Just use a function pointer that switches out which function we're going to use. ...Or not. C++ syntax makes this a bit awful since the function is a member of a class. Did I mention how much I don't like C++?
This commit is contained in:
parent
8f226ced84
commit
dfb1e31d78
1 changed files with 4 additions and 1 deletions
|
@ -1733,15 +1733,18 @@ void gamerender(void)
|
||||||
if(map.extrarow==0 || (map.custommode && map.roomname[0] != '\0'))
|
if(map.extrarow==0 || (map.custommode && map.roomname[0] != '\0'))
|
||||||
{
|
{
|
||||||
const char* roomname;
|
const char* roomname;
|
||||||
|
void (Graphics::*printfunc)(int, int, const std::string&, int, int, int, bool);
|
||||||
|
|
||||||
graphics.footerrect.y = 230;
|
graphics.footerrect.y = 230;
|
||||||
if (graphics.translucentroomname)
|
if (graphics.translucentroomname)
|
||||||
{
|
{
|
||||||
SDL_BlitSurface(graphics.footerbuffer, NULL, graphics.backBuffer, &graphics.footerrect);
|
SDL_BlitSurface(graphics.footerbuffer, NULL, graphics.backBuffer, &graphics.footerrect);
|
||||||
|
printfunc = &Graphics::bprint;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
FillRect(graphics.backBuffer, graphics.footerrect, 0);
|
FillRect(graphics.backBuffer, graphics.footerrect, 0);
|
||||||
|
printfunc = &Graphics::Print;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (map.finalmode)
|
if (map.finalmode)
|
||||||
|
@ -1753,7 +1756,7 @@ void gamerender(void)
|
||||||
roomname = map.roomname;
|
roomname = map.roomname;
|
||||||
}
|
}
|
||||||
|
|
||||||
graphics.bprint(5, 231, map.roomname, 196, 196, 255 - help.glow, true);
|
(graphics.*printfunc)(5, 231, roomname, 196, 196, 255 - help.glow, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (map.roomtexton)
|
if (map.roomtexton)
|
||||||
|
|
Loading…
Reference in a new issue