Use COL_ enum

This commit is contained in:
Elliptic Ellipsis
2022-03-25 01:25:02 +00:00
parent 1580dd1f2c
commit fa1eb01528
30 changed files with 185 additions and 149 deletions
+9 -2
View File
@@ -1,5 +1,6 @@
#define NENT_DEPRECATED
#include "entity.h"
#include "collision.h"
#include "room.h"
#include "asm.h"
#include "sound.h"
@@ -49,7 +50,12 @@ void PlayerClone_Init(PlayerCloneEntity* this) {
SoundReq(SFX_112);
}
const u16 PlayerCloneCollisions[] = { 0x2206, 0x6044, 0x4460, 0x622 };
const u16 PlayerCloneCollisions[] = {
COL_NORTH_FULL | COL_WEST_SOUTH | COL_EAST_SOUTH,
COL_NORTH_EAST | COL_SOUTH_EAST | COL_EAST_FULL,
COL_SOUTH_FULL | COL_WEST_NORTH | COL_EAST_NORTH,
COL_NORTH_WEST | COL_SOUTH_WEST | COL_WEST_FULL,
};
void PlayerClone_Action1(PlayerCloneEntity* this) {
static const Hitbox PlayerCloneHitbox = { 0, -3, { 5, 3, 3, 5 }, 6, 6 };
@@ -104,7 +110,8 @@ void PlayerClone_Action2(PlayerCloneEntity* this) {
super->y.HALF.HI = gPlayerEntity.y.HALF.HI + this->unk7a;
sub_08084CAC(this);
sub_080085B0(super);
if ((super->collisions & 0x6666) != 0x6666) {
if ((super->collisions & (COL_NORTH_FULL | COL_SOUTH_FULL | COL_EAST_FULL | COL_WEST_FULL)) !=
(COL_NORTH_FULL | COL_SOUTH_FULL | COL_EAST_FULL | COL_WEST_FULL)) {
for (index = 0; index <= 3; index++) {
if (PlayerCloneCollisions[index] == (PlayerCloneCollisions[index] & super->collisions)) {
break;
+8 -7
View File
@@ -7,6 +7,7 @@
#define NENT_DEPRECATED
#include "global.h"
#include "collision.h"
#include "object.h"
#include "functions.h"
#include "hitbox.h"
@@ -204,7 +205,7 @@ bool32 sub_0809953C(SmallIceBlockEntity* this) {
uVar3 = sub_0800442E(super);
if (uVar3 != 0) {
return 0;
return FALSE;
}
ProcessMovement2(super);
sub_0800445C(super);
@@ -216,17 +217,17 @@ bool32 sub_0809953C(SmallIceBlockEntity* this) {
}
switch (super->direction >> 3) {
case 0:
if ((super->collisions & 0xe) == 0) {
return 0;
if ((super->collisions & COL_NORTH_ANY) == COL_NONE) {
return FALSE;
}
if ((u32)(super->y.HALF.HI & 0xf) - 7 < 3) {
super->y.HALF.HI = (super->y.HALF.HI & 0xfff0) + 8;
return 1;
return TRUE;
}
sub_0809969C(this);
break;
case 1:
if ((super->collisions & 0xe000) == 0) {
if ((super->collisions & COL_EAST_ANY) == COL_NONE) {
return FALSE;
}
if ((u32)(super->x.HALF.HI & 0xf) - 7 < 3) {
@@ -236,7 +237,7 @@ bool32 sub_0809953C(SmallIceBlockEntity* this) {
sub_0809969C(this);
break;
case 2:
if ((super->collisions & 0xe0) == 0) {
if ((super->collisions & COL_SOUTH_ANY) == COL_NONE) {
return FALSE;
}
if ((u32)(super->y.HALF.HI & 0xf) - 7 < 3) {
@@ -246,7 +247,7 @@ bool32 sub_0809953C(SmallIceBlockEntity* this) {
sub_0809969C(this);
break;
default:
if ((super->collisions & 0xe00) != 0) {
if ((super->collisions & COL_WEST_ANY) != COL_NONE) {
if ((u32)(super->x.HALF.HI & 0xf) - 7 < 3) {
super->x.HALF.HI = (super->x.HALF.HI & 0xfff0) + 8;
return TRUE;