summaryrefslogtreecommitdiff
path: root/src/object
diff options
context:
space:
mode:
authoroctorock <79596758+octorock@users.noreply.github.com>2022-12-11 12:07:48 +0100
committeroctorock <79596758+octorock@users.noreply.github.com>2022-12-11 12:07:48 +0100
commit1d741c182dec03c6c7a6ea337f351eedf7d6eb65 (patch)
tree7a1fc484cc98a123a562ed5bb2e03e85b6f28e95 /src/object
parent017eb5a65efe06ab338f7d6a3bdd1188fcca6c3e (diff)
Extract dungeon maps
Diffstat (limited to 'src/object')
-rw-r--r--src/object/bird.c1
-rw-r--r--src/object/bush.c2
-rw-r--r--src/object/button.c35
-rw-r--r--src/object/octorokBossObject.c2
-rw-r--r--src/object/pushableFurniture.c4
-rw-r--r--src/object/pushableGrave.c18
6 files changed, 32 insertions, 30 deletions
diff --git a/src/object/bird.c b/src/object/bird.c
index e6243f22..6520cea8 100644
--- a/src/object/bird.c
+++ b/src/object/bird.c
@@ -374,6 +374,7 @@ void Bird_Type10(Entity* this) {
void CreateBird(Entity* this) {
Entity* birdEnt;
+ // EU only allows warp from the overworld. This prevents warping from the rooftop of the Wind Tribe's tower.
#ifndef EU
if (AreaAllowsWarp()) {
#else
diff --git a/src/object/bush.c b/src/object/bush.c
index acdac424..449b332e 100644
--- a/src/object/bush.c
+++ b/src/object/bush.c
@@ -108,7 +108,7 @@ void Bush_Action2SubAction2(BushEntity* this) {
if (this->unk_72 == 0) {
this->unk_72 = 1;
super->spriteOffsetX = 0;
- sub_0807B9B8(this->unk_70, COORD_TO_TILE(super), super->collisionLayer);
+ SetMetaTileByIndex(this->unk_70, COORD_TO_TILE(super), super->collisionLayer);
}
if (((gPlayerState.field_0x1c & 0xf) != 1) || ((super->contactFlags & 0x7f) != 0x13)) {
Bush_Action2SubAction5(this);
diff --git a/src/object/button.c b/src/object/button.c
index 33dfcefe..ee153546 100644
--- a/src/object/button.c
+++ b/src/object/button.c
@@ -208,35 +208,36 @@ extern u16 gMapDataTopSpecial[0x2000];
extern u16 gMapDataBottomSpecial[];
void sub_08081E6C(Entity* this) {
- u32 r4;
+ u32 tileType;
LayerStruct* r1;
u16* tmp2;
u16* tmp;
u16* tmp3;
- u32 r6 = this->field_0x74.HWORD;
- u32 r5 = this->collisionLayer;
- u32 tile = GetTileType(r6, r5);
+ u32 tilePosition = this->field_0x74.HWORD;
+ u32 layer = this->collisionLayer;
+ u32 tile = GetTileType(tilePosition, layer);
if (tile < 0x4000)
return;
- r1 = GetLayerByIndex(r5);
- r4 = (this->type == 0 ? 0x7a : 0x78);
+ r1 = GetLayerByIndex(layer);
+ tileType = (this->type == 0 ? 0x7a : 0x78);
tmp = r1->metatiles;
- tmp = tmp + (r1->unkData2[r4] << 2);
- tmp2 = (r5 == 2 ? gMapDataTopSpecial : gMapDataBottomSpecial);
- tmp2 += (((0x3f & r6) << 1) + ((0xfc0 & r6) << 2));
+ tmp = tmp + (r1->unkData2[tileType] << 2);
+ tmp2 = (layer == 2 ? gMapDataTopSpecial : gMapDataBottomSpecial);
+ tmp2 += (((0x3f & tilePosition) << 1) + ((0xfc0 & tilePosition) << 2));
if (sub_08081F00((u32*)tmp2, (u32*)tmp))
return;
- SetTileType(r4, r6, r5);
- SetTile(tile, r6, r5);
+ SetTileType(tileType, tilePosition, layer);
+ SetTile(tile, tilePosition, layer);
}
-u32 sub_08081F00(u32* unk1, u32* unk2) {
- if (*unk1 != *unk2)
- return 0;
- if (unk1[0x40] != unk2[1])
- return 0;
- return 1;
+// Are the two tiles already set to the correct one
+bool32 sub_08081F00(u32* screenblock, u32* metatileList) {
+ if (screenblock[0] != metatileList[0])
+ return FALSE;
+ if (screenblock[0x40] != metatileList[1])
+ return FALSE;
+ return TRUE;
}
void sub_08081F24(Entity* this) {
diff --git a/src/object/octorokBossObject.c b/src/object/octorokBossObject.c
index 22e3561e..05fd362d 100644
--- a/src/object/octorokBossObject.c
+++ b/src/object/octorokBossObject.c
@@ -340,7 +340,7 @@ bool32 sub_0809A6F8(u32 param_1, u32 param_2, u32 param_3, u32 param_4) {
if (sub_0809A758(param_1, param_2) != 0) {
if (gUnk_081238A0[param_3] != 0) {
if ((param_4 & 1) != 0) {
- sub_0807B9B8(gUnk_081238A0[param_3], (param_1 >> 4 & 0x3f) | (param_2 >> 4 & 0x3f) << 6, 1);
+ SetMetaTileByIndex(gUnk_081238A0[param_3], (param_1 >> 4 & 0x3f) | (param_2 >> 4 & 0x3f) << 6, 1);
} else {
RestorePrevTileEntity((param_1 >> 4 & 0x3f) | (param_2 >> 4 & 0x3f) << 6, 1);
}
diff --git a/src/object/pushableFurniture.c b/src/object/pushableFurniture.c
index 4f185253..3429f656 100644
--- a/src/object/pushableFurniture.c
+++ b/src/object/pushableFurniture.c
@@ -494,9 +494,9 @@ void sub_08090094(PushableFurnitureEntity* this, u32 param_2, u32 tilePos) {
}
void sub_08090254(PushableFurnitureEntity* this) {
- sub_0807B9B8(this->unk_74, this->unk_70, super->collisionLayer);
+ SetMetaTileByIndex(this->unk_74, this->unk_70, super->collisionLayer);
if (this->unk_80 == 1) {
- sub_0807B9B8(this->unk_76, this->unk_72, super->collisionLayer);
+ SetMetaTileByIndex(this->unk_76, this->unk_72, super->collisionLayer);
}
}
diff --git a/src/object/pushableGrave.c b/src/object/pushableGrave.c
index 1cb2ecdf..6452d3db 100644
--- a/src/object/pushableGrave.c
+++ b/src/object/pushableGrave.c
@@ -157,16 +157,16 @@ bool32 sub_0809785C(PushableGraveEntity* this) {
super->direction = 0;
super->speed = 0x40;
tilePosition = this->unk_68;
- sub_0807B9B8(this->unk_72, tilePosition, super->collisionLayer);
+ SetMetaTileByIndex(this->unk_72, tilePosition, super->collisionLayer);
if (super->type2 == 2) {
- sub_0807B9B8(this->unk_6a, tilePosition - 0x41, super->collisionLayer);
- sub_0807B9B8(this->unk_6c, tilePosition - 0x40, super->collisionLayer);
- sub_0807B9B8(this->unk_6e, tilePosition - 0x3f, super->collisionLayer);
- sub_0807B9B8(this->unk_70, tilePosition - 1, super->collisionLayer);
- sub_0807B9B8(this->unk_74, tilePosition + 1, super->collisionLayer);
- sub_0807B9B8(this->unk_76, tilePosition + 0x3f, super->collisionLayer);
- sub_0807B9B8(this->unk_78, tilePosition + 0x40, super->collisionLayer);
- sub_0807B9B8(this->unk_7a, tilePosition + 0x41, super->collisionLayer);
+ SetMetaTileByIndex(this->unk_6a, tilePosition - 0x41, super->collisionLayer);
+ SetMetaTileByIndex(this->unk_6c, tilePosition - 0x40, super->collisionLayer);
+ SetMetaTileByIndex(this->unk_6e, tilePosition - 0x3f, super->collisionLayer);
+ SetMetaTileByIndex(this->unk_70, tilePosition - 1, super->collisionLayer);
+ SetMetaTileByIndex(this->unk_74, tilePosition + 1, super->collisionLayer);
+ SetMetaTileByIndex(this->unk_76, tilePosition + 0x3f, super->collisionLayer);
+ SetMetaTileByIndex(this->unk_78, tilePosition + 0x40, super->collisionLayer);
+ SetMetaTileByIndex(this->unk_7a, tilePosition + 0x41, super->collisionLayer);
}
SoundReq(SFX_10F);
return TRUE;