mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2026-01-29 17:38:16 +03: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:
@@ -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));
|
|
||||||
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(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);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user