ref: 7918e6067d9b8c6fcba78491e1b19de0ed24d8a7
parent: c06b30c680d0ce270892e1fa1cf5cc1a09193026
parent: cc23ef2718384d0cff8346b67d2f5df36172cb67
author: Clownacy <Clownacy@users.noreply.github.com>
date: Tue May 7 14:04:07 EDT 2019
Merge pull request #22 from GabrielRavier/improveBullet Improve Bullet
--- a/src/BulHit.cpp
+++ b/src/BulHit.cpp
@@ -28,7 +28,7 @@
if (bul->x - bul->blockXL < (0x10 * x + 8) * 0x200
&& bul->x + bul->blockXL > (0x10 * x - 8) * 0x200
&& bul->y - bul->blockYL < (0x10 * y + 8) * 0x200
- && bul->y + bul->blockYL> (0x10 * y - 8) * 0x200)
+ && bul->y + bul->blockYL > (0x10 * y - 8) * 0x200)
hit |= 0x200;
if (hit && (bul->bbits & 0x60) && GetAttribute(x, y) == 0x43)
@@ -81,7 +81,7 @@
workX = (0x10 * x + 8) * 0x200;
workY = (0x10 * y + 8) * 0x200;
- //Left wall
+ // Left wall
if (block[0] && block[2])
{
if (bul->x - bul->blockXL < workX)
@@ -98,7 +98,7 @@
hit |= 1;
}
- //Right wall
+ // Right wall
if (block[1] && block[3])
{
if (bul->x + bul->blockXL > workX)
@@ -115,7 +115,7 @@
hit |= 4;
}
- //Ceiling
+ // Ceiling
if (block[0] && block[1])
{
if (bul->y - bul->blockYL < workY)
@@ -132,7 +132,7 @@
hit |= 2;
}
- //Ground
+ // Ground
if (block[2] && block[3])
{
if (bul->y + bul->blockYL > workY)
@@ -149,7 +149,7 @@
hit |= 8;
}
- //Clip
+ // Clip
if (bul->bbits & 8)
{
if (hit & 1)
@@ -324,7 +324,7 @@
x = gBul[i].x / 0x10 / 0x200;
y = gBul[i].y / 0x10 / 0x200;
- //Get surrounding tiles
+ // Get surrounding tiles
offx[0] = 0;
offx[1] = 1;
offx[2] = 0;
@@ -339,12 +339,13 @@
atrb[2] = GetAttribute(x, y + 1);
atrb[3] = GetAttribute(x + 1, y + 1);
- //Clear hit tiles
+ // Clear hit tiles
gBul[i].flag = 0;
if (gBul[i].bbits & 4)
{
- // For some reason a 'continue' just doesn't produce the same assembly
+ // Using "continue" here doesn't produce accurate assembly
+ // TODO Figure out what Pixel actually did (it's unlikely he left the brackets empty)
}
else
{
@@ -401,3 +402,4 @@
}
}
}
+
--- a/src/Bullet.cpp
+++ b/src/Bullet.cpp
@@ -346,13 +346,13 @@
bul->y += bul->ym;
}
- if ( ++bul->ani_wait > 0 )
+ if (++bul->ani_wait > 0)
{
bul->ani_wait = 0;
++bul->ani_no;
}
- if ( bul->ani_no > 2 )
+ if (bul->ani_no > 2)
bul->ani_no = 0;
RECT rect[3] = {
@@ -387,7 +387,7 @@
{
bul->act_no = 1;
- //Set speed
+ // Set speed
switch (bul->direct)
{
case 0:
@@ -404,7 +404,7 @@
break;
}
- //Set hitbox
+ // Set hitbox
switch (level)
{
case 1:
@@ -445,7 +445,7 @@
}
else
{
- //Move
+ // Move
bul->x += bul->xm;
bul->y += bul->ym;
}
@@ -1800,7 +1800,7 @@
if (bul->xm < -0x1400)
bul->xm = -0x1400;
- if (bul->xm > 0x1400 )
+ if (bul->xm > 0x1400)
bul->xm = 0x1400;
if (bul->ym < -0x1400)
@@ -2147,11 +2147,11 @@
void ActBullet_SpurTail(BULLET *bul, int level)
{
- if ( ++bul->count1 > 20 )
+ if (++bul->count1 > 20)
bul->ani_no = bul->count1 - 20;
- if ( bul->ani_no > 2 )
+ if (bul->ani_no > 2)
bul->cond = 0;
- if ( bul->damage && bul->life != 100 )
+ if (bul->damage && bul->life != 100)
bul->damage = 0;
RECT rc_h_lv1[3] = {