From f6fa8dd84ce20e9fcb7d11ac641fd6ebba3bb80b Mon Sep 17 00:00:00 2001 From: Info Teddy Date: Fri, 24 Jan 2020 20:26:34 -0800 Subject: [PATCH] De-duplicate the roomname printing code in the editor For some reason, there are two lines that have been copy-pasted the exact same way and in the exact same place, namely being at the end of each branch of the if-else conditional, which makes them be executed no matter what. If they're going to be executed no matter what, we might as well make it clearer and take those two lines out of each branch. --- desktop_version/src/editor.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/desktop_version/src/editor.cpp b/desktop_version/src/editor.cpp index cd0b0c94..bac77646 100644 --- a/desktop_version/src/editor.cpp +++ b/desktop_version/src/editor.cpp @@ -3442,15 +3442,13 @@ void editorrender( KeyPoll& key, Graphics& dwgfx, Game& game, mapclass& map, ent if(ed.tiley<28) { if(ed.roomnamehide>0) ed.roomnamehide--; - FillRect(dwgfx.backBuffer, 0,230+ed.roomnamehide,320,10, dwgfx.getRGB(0,0,0)); - dwgfx.Print(5,231+ed.roomnamehide,ed.level[ed.levx+(ed.maxwidth*ed.levy)].roomname, 196, 196, 255 - help.glow, true); } else { if(ed.roomnamehide<12) ed.roomnamehide++; - FillRect(dwgfx.backBuffer, 0,230+ed.roomnamehide,320,10, dwgfx.getRGB(0,0,0)); - dwgfx.Print(5,231+ed.roomnamehide,ed.level[ed.levx+(ed.maxwidth*ed.levy)].roomname, 196, 196, 255 - help.glow, true); } + FillRect(dwgfx.backBuffer, 0,230+ed.roomnamehide,320,10, dwgfx.getRGB(0,0,0)); + dwgfx.Print(5,231+ed.roomnamehide,ed.level[ed.levx+(ed.maxwidth*ed.levy)].roomname, 196, 196, 255 - help.glow, true); dwgfx.bprint(4, 222, "SPACE ^ SHIFT ^", 196, 196, 255 - help.glow, false); dwgfx.bprint(268,222, "("+help.String(ed.levx+1)+","+help.String(ed.levy+1)+")",196, 196, 255 - help.glow, false); }