Move title usages of towerbg to titlebg

With the previous commit in place, we can now simply move some usages of
the previous towerbg to use a separate object instead. That way, we
don't have to mess with a monolithic state, or some better way to phrase
what I just said, and we instead have two separate objects that can
coexist side-by-side.
This commit is contained in:
Misa
2020-11-02 15:23:53 -08:00
committed by Ethan Lee
parent 72c048d71e
commit 70f3d457dd
10 changed files with 54 additions and 44 deletions

View File

@@ -628,10 +628,10 @@ void mapclass::updatetowerglow(TowerBG& bg_obj)
void mapclass::nexttowercolour()
{
graphics.towerbg.colstate+=5;
if (graphics.towerbg.colstate >= 30) graphics.towerbg.colstate = 0;
int check = graphics.towerbg.colstate % 5; //current state of phase
int cmode = (graphics.towerbg.colstate - check) / 5; // current colour transition
graphics.titlebg.colstate+=5;
if (graphics.titlebg.colstate >= 30) graphics.titlebg.colstate = 0;
int check = graphics.titlebg.colstate % 5; //current state of phase
int cmode = (graphics.titlebg.colstate - check) / 5; // current colour transition
switch(cmode)
{
@@ -655,15 +655,15 @@ void mapclass::nexttowercolour()
break;
}
graphics.towerbg.tdrawback = true;
graphics.titlebg.tdrawback = true;
}
void mapclass::settowercolour(int t)
{
graphics.towerbg.colstate=t*5;
if (graphics.towerbg.colstate >= 30) graphics.towerbg.colstate = 0;
int check = graphics.towerbg.colstate % 5; //current state of phase
int cmode = (graphics.towerbg.colstate - check) / 5; // current colour transition
graphics.titlebg.colstate=t*5;
if (graphics.titlebg.colstate >= 30) graphics.titlebg.colstate = 0;
int check = graphics.titlebg.colstate % 5; //current state of phase
int cmode = (graphics.titlebg.colstate - check) / 5; // current colour transition
switch(cmode)
{
@@ -687,7 +687,7 @@ void mapclass::settowercolour(int t)
break;
}
graphics.towerbg.tdrawback = true;
graphics.titlebg.tdrawback = true;
}
bool mapclass::spikecollide(int x, int y)