mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2026-02-02 23:42:21 +03:00
Don't use function pointer to print room name
This improves the readability of the code.
This commit is contained in:
@@ -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)
|
||||||
|
|||||||
Reference in New Issue
Block a user