De-duplicate Graphics::drawmenu() and Graphics::drawlevelmenu()

Graphics::drawmenu() no longer has copy-pasted code for each individual
case. Instead, the individual cases have their own adding on to common
code, which is far easier to maintain.

Also, the only difference Graphics::drawlevelmenu() does is in some
y-positioning stuff. There's no reason to make it a whole separate
function and duplicate everything AGAIN. So it's been consolidated into
Graphics::drawmenu() as well, and I've added a boolean to draw a menu
this way if it's the level menu.
This commit is contained in:
Misa
2020-07-04 14:53:05 -07:00
committed by Ethan Lee
parent fbfeeaccd1
commit fd0dafc16c
3 changed files with 59 additions and 126 deletions

View File

@@ -1188,14 +1188,7 @@ void titlerender()
if(tg>255) tg=255;
if (tb < 0) tb = 0;
if(tb>255) tb=255;
if (game.currentmenuname == Menu::levellist)
{
graphics.drawlevelmenu(tr, tg, tb);
}
else
{
graphics.drawmenu(tr, tg, tb);
}
graphics.drawmenu(tr, tg, tb, game.currentmenuname == Menu::levellist);
}
graphics.drawfade();