mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2025-01-24 09:49:46 +01:00
Move menu rendering to separate function
Just like I moved the menu ACTION press handler, I'm doing this as well. It only removes one level of indentation, but it makes titlerender() easier to understand. Just like before, I have to put the separate function first, else titlerender() won't know what it is.
This commit is contained in:
parent
1e3879b8fe
commit
b835ce3927
1 changed files with 1077 additions and 1072 deletions
|
@ -16,45 +16,8 @@ int tr;
|
||||||
int tg;
|
int tg;
|
||||||
int tb;
|
int tb;
|
||||||
|
|
||||||
void titlerender()
|
void menurender()
|
||||||
{
|
{
|
||||||
|
|
||||||
FillRect(graphics.backBuffer, 0,0,graphics.backBuffer->w, graphics.backBuffer->h, 0x00000000 );
|
|
||||||
|
|
||||||
if (!game.menustart)
|
|
||||||
{
|
|
||||||
tr = (int)(164 - (help.glow / 2) - int(fRandom() * 4));
|
|
||||||
tg = 164 - (help.glow / 2) - int(fRandom() * 4);
|
|
||||||
tb = 164 - (help.glow / 2) - int(fRandom() * 4);
|
|
||||||
|
|
||||||
int temp = 50;
|
|
||||||
graphics.drawsprite((160 - 96) + 0 * 32, temp, 23, tr, tg, tb);
|
|
||||||
graphics.drawsprite((160 - 96) + 1 * 32, temp, 23, tr, tg, tb);
|
|
||||||
graphics.drawsprite((160 - 96) + 2 * 32, temp, 23, tr, tg, tb);
|
|
||||||
graphics.drawsprite((160 - 96) + 3 * 32, temp, 23, tr, tg, tb);
|
|
||||||
graphics.drawsprite((160 - 96) + 4 * 32, temp, 23, tr, tg, tb);
|
|
||||||
graphics.drawsprite((160 - 96) + 5 * 32, temp, 23, tr, tg, tb);
|
|
||||||
#if defined(MAKEANDPLAY)
|
|
||||||
graphics.Print(-1,temp+35," MAKE AND PLAY EDITION",tr, tg, tb, true);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
graphics.Print(5, 175, "[ Press ACTION to Start ]", tr, tg, tb, true);
|
|
||||||
graphics.Print(5, 195, "ACTION = Space, Z, or V", int(tr*0.5f), int(tg*0.5f), int(tb*0.5f), true);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if(!game.colourblindmode) graphics.drawtowerbackgroundsolo();
|
|
||||||
|
|
||||||
tr = map.r - (help.glow / 4) - int(fRandom() * 4);
|
|
||||||
tg = map.g - (help.glow / 4) - int(fRandom() * 4);
|
|
||||||
tb = map.b - (help.glow / 4) - int(fRandom() * 4);
|
|
||||||
if (tr < 0) tr = 0;
|
|
||||||
if(tr>255) tr=255;
|
|
||||||
if (tg < 0) tg = 0;
|
|
||||||
if(tg>255) tg=255;
|
|
||||||
if (tb < 0) tb = 0;
|
|
||||||
if(tb>255) tb=255;
|
|
||||||
|
|
||||||
int temp = 50;
|
int temp = 50;
|
||||||
|
|
||||||
if(game.currentmenuname=="mainmenu")
|
if(game.currentmenuname=="mainmenu")
|
||||||
|
@ -1127,6 +1090,48 @@ void titlerender()
|
||||||
graphics.Print( 320-(tempstring.length()*8), 210, tempstring, tr, tg, tb);
|
graphics.Print( 320-(tempstring.length()*8), 210, tempstring, tr, tg, tb);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void titlerender()
|
||||||
|
{
|
||||||
|
|
||||||
|
FillRect(graphics.backBuffer, 0,0,graphics.backBuffer->w, graphics.backBuffer->h, 0x00000000 );
|
||||||
|
|
||||||
|
if (!game.menustart)
|
||||||
|
{
|
||||||
|
tr = (int)(164 - (help.glow / 2) - int(fRandom() * 4));
|
||||||
|
tg = 164 - (help.glow / 2) - int(fRandom() * 4);
|
||||||
|
tb = 164 - (help.glow / 2) - int(fRandom() * 4);
|
||||||
|
|
||||||
|
int temp = 50;
|
||||||
|
graphics.drawsprite((160 - 96) + 0 * 32, temp, 23, tr, tg, tb);
|
||||||
|
graphics.drawsprite((160 - 96) + 1 * 32, temp, 23, tr, tg, tb);
|
||||||
|
graphics.drawsprite((160 - 96) + 2 * 32, temp, 23, tr, tg, tb);
|
||||||
|
graphics.drawsprite((160 - 96) + 3 * 32, temp, 23, tr, tg, tb);
|
||||||
|
graphics.drawsprite((160 - 96) + 4 * 32, temp, 23, tr, tg, tb);
|
||||||
|
graphics.drawsprite((160 - 96) + 5 * 32, temp, 23, tr, tg, tb);
|
||||||
|
#if defined(MAKEANDPLAY)
|
||||||
|
graphics.Print(-1,temp+35," MAKE AND PLAY EDITION",tr, tg, tb, true);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
graphics.Print(5, 175, "[ Press ACTION to Start ]", tr, tg, tb, true);
|
||||||
|
graphics.Print(5, 195, "ACTION = Space, Z, or V", int(tr*0.5f), int(tg*0.5f), int(tb*0.5f), true);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if(!game.colourblindmode) graphics.drawtowerbackgroundsolo();
|
||||||
|
|
||||||
|
tr = map.r - (help.glow / 4) - int(fRandom() * 4);
|
||||||
|
tg = map.g - (help.glow / 4) - int(fRandom() * 4);
|
||||||
|
tb = map.b - (help.glow / 4) - int(fRandom() * 4);
|
||||||
|
if (tr < 0) tr = 0;
|
||||||
|
if(tr>255) tr=255;
|
||||||
|
if (tg < 0) tg = 0;
|
||||||
|
if(tg>255) tg=255;
|
||||||
|
if (tb < 0) tb = 0;
|
||||||
|
if(tb>255) tb=255;
|
||||||
|
|
||||||
|
menurender();
|
||||||
|
|
||||||
tr = int(tr * .8f);
|
tr = int(tr * .8f);
|
||||||
tg = int(tg * .8f);
|
tg = int(tg * .8f);
|
||||||
|
|
Loading…
Add table
Reference in a new issue