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

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.
This commit is contained in:
Info Teddy 2020-01-24 20:26:34 -08:00 committed by Ethan Lee
parent 4ea4a1e615
commit f6fa8dd84c

View file

@ -3442,15 +3442,13 @@ void editorrender( KeyPoll& key, Graphics& dwgfx, Game& game, mapclass& map, ent
if(ed.tiley<28) if(ed.tiley<28)
{ {
if(ed.roomnamehide>0) ed.roomnamehide--; 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 else
{ {
if(ed.roomnamehide<12) ed.roomnamehide++; if(ed.roomnamehide<12) ed.roomnamehide++;
}
FillRect(dwgfx.backBuffer, 0,230+ed.roomnamehide,320,10, dwgfx.getRGB(0,0,0)); 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.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(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); dwgfx.bprint(268,222, "("+help.String(ed.levx+1)+","+help.String(ed.levy+1)+")",196, 196, 255 - help.glow, false);
} }