diff --git a/desktop_version/src/Render.cpp b/desktop_version/src/Render.cpp index 36558b5b..457dba39 100644 --- a/desktop_version/src/Render.cpp +++ b/desktop_version/src/Render.cpp @@ -2013,6 +2013,26 @@ void gamerender(void) graphics.renderwithscreeneffects(); } +static void draw_roomname_menu(void) +{ + const char* name; + + if (map.hiddenname[0] != '\0') + { + name = map.hiddenname; + } + else if (map.finalmode) + { + name = map.glitchname; + } + else + { + name = map.roomname; + } + + graphics.Print(5, 2, name, 196, 196, 255 - help.glow, true); +} + /* Used to keep some graphics positions on the map screen * the same in Flip Mode. */ #define FLIP(y, h) (graphics.flipmode ? 220 - (y) - (h) : (y)) @@ -2021,20 +2041,7 @@ void maprender(void) { ClearSurface(graphics.backBuffer); - //draw screen alliteration - //Roomname: - if (map.hiddenname[0] != '\0') - { - graphics.Print(5, 2, map.hiddenname, 196, 196, 255 - help.glow, true); - } - else - { - if (map.finalmode){ - graphics.Print(5, 2, map.glitchname, 196, 196, 255 - help.glow, true); - }else{ - graphics.Print(5, 2, map.roomname, 196, 196, 255 - help.glow, true); - } - } + draw_roomname_menu(); //Background color FillRect(graphics.backBuffer,0, 12, 320, 240, 10, 24, 26 ); @@ -2721,17 +2728,8 @@ void teleporterrender(void) ClearSurface(graphics.backBuffer); int tempx; int tempy; - //draw screen alliteration - //Roomname: - int temp = map.area(game.roomx, game.roomy); - if (temp < 2 && !map.custommode && graphics.fademode==0) - { - graphics.Print(5, 2, map.hiddenname, 196, 196, 255 - help.glow, true); - } - else - { - graphics.Print(5, 2, map.roomname, 196, 196, 255 - help.glow, true); - } + + draw_roomname_menu(); //Background color FillRect(graphics.backBuffer, 0, 12, 320, 240, 10, 24, 26); @@ -2778,13 +2776,13 @@ void teleporterrender(void) { if (map.showteleporters && map.isexplored(map.teleporters[i].x, map.teleporters[i].y)) { - temp = 1126 + (int) map.isexplored(map.teleporters[i].x, map.teleporters[i].y); + int temp = 1126 + (int) map.isexplored(map.teleporters[i].x, map.teleporters[i].y); if (graphics.flipmode) temp += 3; graphics.drawtile(40 + 3 + (map.teleporters[i].x * 12), 22 + (map.teleporters[i].y * 9), temp); } else if(map.showtargets && !map.isexplored(map.teleporters[i].x, map.teleporters[i].y)) { - temp = 1126 + (int) map.isexplored(map.teleporters[i].x, map.teleporters[i].y); + int temp = 1126 + (int) map.isexplored(map.teleporters[i].x, map.teleporters[i].y); if (graphics.flipmode) temp += 3; graphics.drawtile(40 + 3 + (map.teleporters[i].x * 12), 22 + (map.teleporters[i].y * 9), temp); } @@ -2796,7 +2794,7 @@ void teleporterrender(void) { if (!obj.collect[i]) { - temp = 1086; + int temp = 1086; if (graphics.flipmode) temp += 3; graphics.drawtile(40 + 3 + (map.shinytrinkets[i].x * 12), 22 + (map.shinytrinkets[i].y * 9), temp); } @@ -2808,7 +2806,7 @@ void teleporterrender(void) if (game.useteleporter && ((help.slowsine%16)>8)) { //colour in the legend - temp = 1128; + int temp = 1128; if (graphics.flipmode) temp += 3; graphics.drawtile(40 + 3 + (tempx * 12), 22 + (tempy * 9), temp); }