From 017d54adb039445fe79b5ae06ce4572d1d30c422 Mon Sep 17 00:00:00 2001 From: Misa Date: Sun, 26 Dec 2021 10:08:21 -0800 Subject: [PATCH] Don't use function pointer to print room name This improves the readability of the code. --- desktop_version/src/Render.cpp | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/desktop_version/src/Render.cpp b/desktop_version/src/Render.cpp index 1059c2db..a6fe6691 100644 --- a/desktop_version/src/Render.cpp +++ b/desktop_version/src/Render.cpp @@ -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)