1
0
Fork 0
mirror of https://github.com/TerryCavanagh/VVVVVV.git synced 2024-12-22 17:49:43 +01:00

Don't use function pointer to print room name

This improves the readability of the code.
This commit is contained in:
Misa 2021-12-26 10:08:21 -08:00
parent 81aa02e29b
commit 017d54adb0

View file

@ -1733,19 +1733,8 @@ void gamerender(void)
if(map.extrarow==0 || (map.custommode && map.roomname[0] != '\0'))
{
const char* roomname;
void (Graphics::*printfunc)(int, int, const std::string&, int, int, int, bool);
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)
{
@ -1756,7 +1745,16 @@ void gamerender(void)
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)