Merge pull request #430 from octorock/layer-struct

Improve LayerStruct
This commit is contained in:
notyourav
2022-03-06 13:53:40 -08:00
committed by GitHub
67 changed files with 720 additions and 1213 deletions
+6 -6
View File
@@ -10,7 +10,7 @@
extern u8 gEntCount;
extern u8 gMapDataTopSpecial[];
extern u16 gUnk_02019EE0[];
extern u16 gMapDataBottomSpecial[];
extern void sub_080197D4(const void*);
@@ -86,7 +86,7 @@ void GyorgFemale_Setup(GyorgFemaleEntity* this) {
this->eyesVulnerable = 0;
this->unk_79 = 0;
this->childrenSpawnTimer = 0x3C;
MemClear(&gUnk_02019EE0, 0x8000);
MemClear(&gMapDataBottomSpecial, 0x8000);
MemClear(&gMapDataTopSpecial, 0x8000);
sub_0804660C(this, 0);
sub_080464C0(this);
@@ -215,7 +215,7 @@ void GyorgFemale_Action3(GyorgFemaleEntity* this) {
#ifndef EU
void sub_08046498(GyorgFemaleEntity* this) {
MemClear(&gUnk_02019EE0, 0x8000);
MemClear(&gMapDataBottomSpecial, 0x8000);
MemClear(&gMapDataTopSpecial, 0x8000);
sub_080464C0(this);
}
@@ -233,12 +233,12 @@ void sub_080464C0(GyorgFemaleEntity* this) {
u8* dst;
sub_080197D4(gUnk_080D1A74[super->animationState >> 6]);
sub_08046518();
for (i = 0x20, src = ((u8*)&gUnk_02019EE0), dst = ((u8*)&gUnk_02019EE0) + 0x3260; i != 0; i--) {
for (i = 0x20, src = ((u8*)&gMapDataBottomSpecial), dst = ((u8*)&gMapDataBottomSpecial) + 0x3260; i != 0; i--) {
MemCopy(src, dst, 0x40);
dst += 0x100;
src += 0x40;
}
MemClear(&gUnk_02019EE0, 0x800);
MemClear(&gMapDataBottomSpecial, 0x800);
gUpdateVisibleTiles = 1;
}
@@ -271,7 +271,7 @@ void sub_080465C8(void) {
s32 x, y;
x = (gPlayerEntity.x.HALF.HI - gRoomControls.origin_x) >> 3;
y = (gPlayerEntity.y.HALF.HI - gRoomControls.origin_y) >> 3;
if (gUnk_02019EE0[(y << 7) + x]) {
if (gMapDataBottomSpecial[(y << 7) + x]) {
gPlayerState.field_0x14 = 1;
}
}
+1 -1
View File
@@ -1133,7 +1133,7 @@ void sub_08048004(GyorgMaleEntity* this) {
if (b == 3) {
s32 posX = ((gPlayerEntity.x.HALF.HI - gRoomControls.origin_x) >> 3);
s32 posY = ((gPlayerEntity.y.HALF.HI - gRoomControls.origin_y) >> 3);
u16* tmp = (u16*)&gUnk_02019EE0;
u16* tmp = (u16*)&gMapDataBottomSpecial;
if (tmp[(posY << 7) + posX]) {
if (!(this->unk_7c & 2)) {
this->unk_7c |= 0x80;
+1 -1
View File
@@ -112,7 +112,7 @@ void sub_08037E14(Entity* this) {
s32 x, y;
this->actionDelay = 0x8;
dir = (GetFacingDirection(this, &gPlayerEntity) + 4) & 0x18;
layer = (u8*)GetLayerByIndex(this->collisionLayer)->_2004;
layer = (u8*)GetLayerByIndex(this->collisionLayer)->collisionData;
ptr = gUnk_080CF498 + (dir >> 2);
x = this->x.HALF.HI + *ptr;
y = this->y.HALF.HI + *(ptr + 1);
-1
View File
@@ -27,7 +27,6 @@ extern void sub_08033D78(SpinyBeetleEntity*);
extern u32 sub_08033DF0(SpinyBeetleEntity*);
extern void SpinyBeetle_SetHitType(SpinyBeetleEntity*);
extern void EnemyFunctionHandlerAfterCollision(Entity*, EntityActionArray);
extern void sub_0807B9B8(s32, s32, s32);
extern u32 sub_0804A024(Entity*, u32, u32);
void SpinyBeetle(Entity* this) {