remove redundant unions

This commit is contained in:
theo3
2021-11-12 01:34:34 -08:00
parent f70c95f037
commit ecc8a1439d
257 changed files with 1894 additions and 1923 deletions
+10 -10
View File
@@ -17,10 +17,10 @@ void Manager1_Main(Entity* this) {
u8* pbVar2;
gUnk_08107C5C[this->action](this);
gUnk_08107C48[((u8*)&this->hVelocity)[1]](this);
bVar1 = gUnk_08107C40[((u8*)&this->hVelocity)[1]];
if ((bVar1 != 0) && (*(u8*)&this->hVelocity != bVar1)) {
((u8*)&this->hVelocity)[0] = bVar1;
gUnk_08107C48[((u8*)&this->zVelocity)[1]](this);
bVar1 = gUnk_08107C40[((u8*)&this->zVelocity)[1]];
if ((bVar1 != 0) && (*(u8*)&this->zVelocity != bVar1)) {
((u8*)&this->zVelocity)[0] = bVar1;
LoadGfxGroup(bVar1);
}
}
@@ -28,9 +28,9 @@ void Manager1_Main(Entity* this) {
void sub_080570B8(Entity* this) {
u8* pbVar1;
LoadGfxGroup(((u8*)&this->hVelocity)[0]);
this->height.WORD = 0;
pbVar1 = ((u8*)&this->hVelocity + 1);
LoadGfxGroup(((u8*)&this->zVelocity)[0]);
this->z.WORD = 0;
pbVar1 = ((u8*)&this->zVelocity + 1);
if (*pbVar1 == 3) {
gScreen.bg3.updated = 1;
} else {
@@ -46,9 +46,9 @@ void sub_080570F8(void) {
void sub_08057118(Entity* this) {
this->actionDelay = 0;
*(u8*)&this->hVelocity = 0;
((u8*)&this->hVelocity)[1] = 0;
((u8*)&this->hVelocity)[2] = 0;
*(u8*)&this->zVelocity = 0;
((u8*)&this->zVelocity)[1] = 0;
((u8*)&this->zVelocity)[2] = 0;
this->action = 1;
gScreen.bg3.control = 0x1e04;
gScreen.lcd.displayControl |= 0x800;
+1 -1
View File
@@ -295,7 +295,7 @@ void sub_0805A758(Manager15* this) {
}
void sub_0805A76C(Manager15* this) {
if ((gPlayerEntity.currentHealth != 0) && (gPlayerEntity.height.HALF.HI == 0) && (!gPlayerState.field_0x2c)) {
if ((gPlayerEntity.health != 0) && (gPlayerEntity.z.HALF.HI == 0) && (!gPlayerState.field_0x2c)) {
switch (gPlayerState.field_0xa9) {
case 1:
case 0:
+1 -1
View File
@@ -27,7 +27,7 @@ void sub_0805B55C(Manager* manager) {
if (waterDrop != NULL) {
waterDrop->x.HALF.HI = gRoomControls.roomScrollX + 0x78 + gUnk_08108C6C[Random() & 7];
waterDrop->y.HALF.HI = gRoomControls.roomScrollY + 0x50 + gUnk_08108C7C[Random() & 3];
waterDrop->height.HALF.HI = 0xff38;
waterDrop->z.HALF.HI = 0xff38;
}
}
}
+1 -1
View File
@@ -19,7 +19,7 @@ void Manager2C_Main(Manager2C* manager) {
manager->field_0x3a = 0;
}
if (((CheckPlayerInRegion(manager->field_0x38, manager->field_0x3a, 0x14, 0x40) != 0) &&
(((gPlayerEntity.y.HALF.HI - gRoomControls.roomOriginY) + gPlayerEntity.height.HALF.HI) < 0)) &&
(((gPlayerEntity.y.HALF.HI - gRoomControls.roomOriginY) + gPlayerEntity.z.HALF.HI) < 0)) &&
(gRoomControls.roomScrollY == gRoomControls.roomOriginY)) {
MemClear(&gScreenTransition.areaID, 0x20);
gScreenTransition.transitioningOut = 1;
+2 -2
View File
@@ -11,7 +11,7 @@ void Manager33_Main(Manager* this) {
u32 b = roomControls->roomOriginY + 0x140;
u32 y = (b - gPlayerEntity.y.HALF.HI) + 0x10;
if (this->action == 0) {
if (x < 0x20 && y < 0x20 && gPlayerEntity.height.HALF.HI < -0x18 && gPlayerState.field_0xa8 == 0x14) {
if (x < 0x20 && y < 0x20 && gPlayerEntity.z.HALF.HI < -0x18 && gPlayerState.field_0xa8 == 0x14) {
this->action += 1;
this->unk_0e = 0x5a;
SoundReq(SFX_10A);
@@ -22,7 +22,7 @@ void Manager33_Main(Manager* this) {
if (object != NULL) {
object->x.HALF.HI = roomControls->roomOriginX + 0x1f8;
object->y.HALF.HI = roomControls->roomOriginY + 0x140;
object->height.HALF.HI = 0xffe8;
object->z.HALF.HI = 0xffe8;
}
DeleteThisEntity();
}
+1 -1
View File
@@ -71,7 +71,7 @@ void sub_0805DEB8(Manager* this) {
void sub_0805DF4C(Manager* this) {
gPlayerEntity.animationState = 0;
if (gPlayerEntity.height.HALF.HI != 0) {
if (gPlayerEntity.z.HALF.HI != 0) {
if (gPlayerEntity.y.HALF.HI < (gRoomControls.roomOriginY + 0x48)) {
gPlayerEntity.y.HALF.HI = gRoomControls.roomOriginY + 0x48;
}
+1 -2
View File
@@ -19,8 +19,7 @@ void Manager6_Main(Manager6* this) {
tmp = (i->unk_07.all & 0x3);
if (((tmp & (gPlayerEntity.collisionLayer)) != 0) &&
(((gPlayerState.flags & 0x80) != 0) || ((i->unk_07.b.unk2) != 0)) &&
(CheckPlayerInRegion(i->posX, i->posY, i->width, i->height) != 0) &&
(gPlayerEntity.height.HALF.HI == 0)) {
(CheckPlayerInRegion(i->posX, i->posY, i->width, i->height) != 0) && (gPlayerEntity.z.HALF.HI == 0)) {
DoExitTransition(GetCurrentRoomProperty(i->unk_06));
}
}
+1 -1
View File
@@ -120,7 +120,7 @@ void sub_08058514(ManagerA* this) {
case 1:
if ((gPlayerState.flags & 0x1235) != 0)
return;
if (gPlayerEntity.height.HALF.HI != 0)
if (gPlayerEntity.z.HALF.HI != 0)
return;
gPlayerState.jumpStatus = 0;
sub_08078AA8(this->unk_36, this->unk_35);
+1 -1
View File
@@ -155,7 +155,7 @@ void sub_08058A04(ManagerC* this) {
s32 tmp = gPlayerEntity.x.HALF.HI - gRoomControls.roomOriginX;
s32 tmp2 = gPlayerEntity.y.HALF.HI - gRoomControls.roomOriginY;
if ((this->unk_20 - 0x118 < 0xDu) && CheckGlobalFlag(LV1TARU_OPEN) && (tmp - 0x6d < 0x17u) &&
(tmp2 - 0x45 < 0x17u) && (gPlayerEntity.height.HALF.HI == 0)) {
(tmp2 - 0x45 < 0x17u) && (gPlayerEntity.z.HALF.HI == 0)) {
gPlayerState.playerAction = 3;
gPlayerState.field_0x38 = 0;
gPlayerEntity.x.HALF.HI = gRoomControls.roomOriginX + 0x78;