mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2024-12-23 01:59:43 +01:00
Don't use function pointer to print room name
This improves the readability of the code.
This commit is contained in:
parent
81aa02e29b
commit
017d54adb0
1 changed files with 10 additions and 12 deletions
|
@ -1733,19 +1733,8 @@ 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)
|
|
||||||
{
|
|
||||||
SDL_BlitSurface(graphics.footerbuffer, NULL, graphics.backBuffer, &graphics.footerrect);
|
|
||||||
printfunc = &Graphics::bprint;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
FillRect(graphics.backBuffer, graphics.footerrect, 0);
|
|
||||||
printfunc = &Graphics::Print;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (map.finalmode)
|
if (map.finalmode)
|
||||||
{
|
{
|
||||||
|
@ -1756,7 +1745,16 @@ void gamerender(void)
|
||||||
roomname = map.roomname;
|
roomname = map.roomname;
|
||||||
}
|
}
|
||||||
|
|
||||||
(graphics.*printfunc)(5, 231, roomname, 196, 196, 255 - help.glow, true);
|
if (graphics.translucentroomname)
|
||||||
|
{
|
||||||
|
SDL_BlitSurface(graphics.footerbuffer, NULL, graphics.backBuffer, &graphics.footerrect);
|
||||||
|
graphics.bprint(5, 231, roomname, 196, 196, 255 - help.glow, true);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
FillRect(graphics.backBuffer, graphics.footerrect, 0);
|
||||||
|
graphics.Print(5, 231, roomname, 196, 196, 255 - help.glow, true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (map.roomtexton)
|
if (map.roomtexton)
|
||||||
|
|
Loading…
Reference in a new issue