Star.cpp cleanup

This commit is contained in:
Clownacy 2019-11-14 00:14:50 +00:00
parent d641f508f2
commit b1f698f863

View file

@ -27,12 +27,12 @@ static struct
RECT rect; RECT rect;
} star[3]; } star[3];
void InitStar() void InitStar(void)
{ {
//Clear stars // Clear stars
memset(star, 0, sizeof(star)); memset(star, 0, sizeof(star));
//Position // Position
star[0].x = gMC.x; star[0].x = gMC.x;
star[0].y = gMC.y; star[0].y = gMC.y;
@ -42,7 +42,7 @@ void InitStar()
star[2].x = gMC.x; star[2].x = gMC.x;
star[2].y = gMC.y; star[2].y = gMC.y;
//Speed // Speed
star[0].xm = 0x400; star[0].xm = 0x400;
star[0].ym = -0x200; star[0].ym = -0x200;
@ -53,15 +53,17 @@ void InitStar()
star[2].ym = 0x200; star[2].ym = 0x200;
} }
void ActStar() void ActStar(void)
{ {
int i;
static int a; static int a;
a++;
++a;
a %= 3; a %= 3;
for (int i = 0; i < 3; i++) for (i = 0; i < 3; ++i)
{ {
if (i) if (i != 0)
{ {
if (star[i - 1].x < star[i].x) if (star[i - 1].x < star[i].x)
star[i].xm -= 0x80; star[i].xm -= 0x80;