diff options
| author | octorock <79596758+octorock@users.noreply.github.com> | 2023-06-10 15:12:51 +0200 |
|---|---|---|
| committer | octorock <79596758+octorock@users.noreply.github.com> | 2023-06-10 15:12:51 +0200 |
| commit | 551cb7209393d06e302a5bda489c341f38efd1f3 (patch) | |
| tree | 5e35657ef65d6cd14963cd1efc051251d1a433ce /src/object | |
| parent | 99c0d42297567b54510056caff059fc374513458 (diff) | |
Extract some map data definitions
Diffstat (limited to 'src/object')
| -rw-r--r-- | src/object/bench.c | 3 | ||||
| -rw-r--r-- | src/object/bollard.c | 2 | ||||
| -rw-r--r-- | src/object/button.c | 4 | ||||
| -rw-r--r-- | src/object/cutsceneMiscObject.c | 3 | ||||
| -rw-r--r-- | src/object/mask.c | 4 | ||||
| -rw-r--r-- | src/object/octorokBossObject.c | 8 | ||||
| -rw-r--r-- | src/object/pushableFurniture.c | 14 | ||||
| -rw-r--r-- | src/object/pushableRock.c | 2 | ||||
| -rw-r--r-- | src/object/specialFx.c | 3 |
9 files changed, 24 insertions, 19 deletions
diff --git a/src/object/bench.c b/src/object/bench.c index 47514668..5639efee 100644 --- a/src/object/bench.c +++ b/src/object/bench.c @@ -5,6 +5,7 @@ * @brief Bench object */ #define NENT_DEPRECATED +#include "asm.h" #include "entity.h" #include "functions.h" #include "player.h" @@ -38,7 +39,7 @@ void Bench_Init(BenchEntity* this) { super->collisionLayer = 1; } UpdateSpriteForCollisionLayer(super); - sub_08000148(0x47, this->tilePos - 0x40, 1); + SetCollisionData(0x47, this->tilePos - 0x40, 1); } void Bench_Action1(BenchEntity* this) { diff --git a/src/object/bollard.c b/src/object/bollard.c index 2f73e5be..304a9647 100644 --- a/src/object/bollard.c +++ b/src/object/bollard.c @@ -95,7 +95,7 @@ void sub_0808B3AC(BollardEntity* this) { super->spritePriority.b0 = 4; this->tile = COORD_TO_TILE(super); this->tileIndex = GetTileIndex(this->tile, super->collisionLayer); - this->unk74 = sub_080B1B44(this->tile, super->collisionLayer); + this->unk74 = GetCollisionData(this->tile, super->collisionLayer); SetTile(0x400b, this->tile, super->collisionLayer); } diff --git a/src/object/button.c b/src/object/button.c index ee153546..42233657 100644 --- a/src/object/button.c +++ b/src/object/button.c @@ -154,7 +154,7 @@ u32 sub_08081E0C(Entity*); Entity* sub_08081D74(Entity* this) { Entity* ent; - if (sub_080B1B44(this->field_0x74.HWORD, this->collisionLayer) == 0xF) { + if (GetCollisionData(this->field_0x74.HWORD, this->collisionLayer) == 0xF) { return 0; } ent = 0; @@ -233,7 +233,7 @@ void sub_08081E6C(Entity* this) { // Are the two tiles already set to the correct one bool32 sub_08081F00(u32* screenblock, u32* metatileList) { - if (screenblock[0] != metatileList[0]) + if (screenblock[0] != metatileList[0]) return FALSE; if (screenblock[0x40] != metatileList[1]) return FALSE; diff --git a/src/object/cutsceneMiscObject.c b/src/object/cutsceneMiscObject.c index 08b3e868..8105cb11 100644 --- a/src/object/cutsceneMiscObject.c +++ b/src/object/cutsceneMiscObject.c @@ -714,7 +714,8 @@ void sub_0809567C(CutsceneMiscObjectEntity* this) { super->action = 3; super->subAction = 1; super->speed = 0x400; - super->direction = CalculateDirectionFromOffsets(super->x.WORD - ((s16)this->px << 16), super->y.WORD - ((s16)this->py << 16)); + super->direction = + CalculateDirectionFromOffsets(super->x.WORD - ((s16)this->px << 16), super->y.WORD - ((s16)this->py << 16)); } void sub_080956B4(CutsceneMiscObjectEntity* this) { diff --git a/src/object/mask.c b/src/object/mask.c index 886105e9..969d98c2 100644 --- a/src/object/mask.c +++ b/src/object/mask.c @@ -61,7 +61,7 @@ void Mask_Init(Entity* this) { this->field_0x7c.HALF_U.HI = COORD_TO_TILE(this); this->field_0x7c.HALF_U.LO = GetTileIndex(this->field_0x7c.HALF_U.HI, 1); - this->field_0x7a.HWORD = sub_080B1B44((u16)this->field_0x7c.HALF.HI, 1); + this->field_0x7a.HWORD = GetCollisionData((u16)this->field_0x7c.HALF.HI, 1); SetTile(0x4022, this->field_0x7c.HALF_U.HI, 1); } @@ -90,7 +90,7 @@ void Mask_Action1(Entity* this) { // Presumably, make the mask fall SetTile(this->field_0x7c.HALF_U.LO, this->field_0x7c.HALF_U.HI, 1); - sub_08000148(this->field_0x7a.HWORD, (u16)this->field_0x7c.HALF.HI, 1); + SetCollisionData(this->field_0x7a.HWORD, (u16)this->field_0x7c.HALF.HI, 1); this->action = 2; diff --git a/src/object/octorokBossObject.c b/src/object/octorokBossObject.c index ad26e410..a9bd7008 100644 --- a/src/object/octorokBossObject.c +++ b/src/object/octorokBossObject.c @@ -171,8 +171,9 @@ void OctorokBossObject_Action1(Entity* this) { return; } case 1: - this->direction = CalculateDirectionFromOffsets(GET_HELPER(this)->tailObjects[this->timer]->x.WORD - this->x.WORD, - GET_HELPER(this)->tailObjects[this->timer]->y.WORD - this->y.WORD); + this->direction = + CalculateDirectionFromOffsets(GET_HELPER(this)->tailObjects[this->timer]->x.WORD - this->x.WORD, + GET_HELPER(this)->tailObjects[this->timer]->y.WORD - this->y.WORD); LinearMoveAngle(this, this->speed, this->direction); if (EntityInRectRadius(this, GET_HELPER(this)->tailObjects[this->timer], 2, 2) == 0) { return; @@ -197,7 +198,8 @@ void OctorokBossObject_Action1(Entity* this) { case 2: if (this->parent->type2 == 3) { Entity* object = GET_HELPER(this->parent)->mouthObject; - this->direction = CalculateDirectionFromOffsets(object->x.WORD - this->x.WORD, object->y.WORD - this->y.WORD); + this->direction = + CalculateDirectionFromOffsets(object->x.WORD - this->x.WORD, object->y.WORD - this->y.WORD); LinearMoveAngle(this, 0x280, this->direction); if (sub_0806FC80(this, this->parent, 0x48) == 0) { return; diff --git a/src/object/pushableFurniture.c b/src/object/pushableFurniture.c index 3429f656..2d3b77da 100644 --- a/src/object/pushableFurniture.c +++ b/src/object/pushableFurniture.c @@ -312,27 +312,27 @@ void sub_0808FDE8(PushableFurnitureEntity* this) { u32 uVar3; uVar3 = (u32)this->unk_70; - uVar1 = sub_080B1B44(uVar3 - 1, 1); + uVar1 = GetCollisionData(uVar3 - 1, 1); iVar2 = GetTileIndex(uVar3, 1); if (iVar2 == 0x402e) { if ((((uVar1 & 0xf0) != 0) && ((uVar1 & 0xf0) != 0x50)) || ((uVar1 & 5) == 0)) { SetTile(0x402c, uVar3, 1); } } else { - iVar2 = sub_080B1B44(uVar3, 1); + iVar2 = GetCollisionData(uVar3, 1); if ((iVar2 == 5) && ((((uVar1 & 0xf0) == 0 || ((uVar1 & 0xf0) == 0x50)) && ((uVar1 & 5) != 0)))) { SetTile(0x402e, uVar3, 1); } } uVar3 = (u32)this->unk_72; - uVar1 = sub_080B1B44(uVar3 + 1, 1); + uVar1 = GetCollisionData(uVar3 + 1, 1); iVar2 = GetTileIndex(uVar3, 1); if (iVar2 == 0x402f) { if ((((uVar1 & 0xf0) != 0) && ((uVar1 & 0xf0) != 0x50)) || ((uVar1 & 10) == 0)) { SetTile(0x402d, uVar3, 1); } } else { - iVar2 = sub_080B1B44(uVar3, 1); + iVar2 = GetCollisionData(uVar3, 1); if (((iVar2 == 10) && (((uVar1 & 0xf0) == 0 || ((uVar1 & 0xf0) == 0x50)))) && ((uVar1 & 10) != 0)) { SetTile(0x402f, uVar3, 1); } @@ -411,7 +411,7 @@ void sub_08090094(PushableFurnitureEntity* this, u32 param_2, u32 tilePos) { u32 index; u32 tmp2; - tmp1 = sub_080B1B44(tilePos, 1); + tmp1 = GetCollisionData(tilePos, 1); index = GetTileIndex(tilePos, 1); if ((index & 0x4000) == 0) { index = param_2; @@ -599,12 +599,12 @@ void sub_08090498(PushableFurnitureEntity* this) { u32 tmp = this->unk_70 - 0x80; RestorePrevTileEntity(tmp, 1); if (((this->unk_83 & 1) != 0) && (GetTileType(tmp, 2) == 0x306)) { - sub_08000148(0x62, tmp, 1); + SetCollisionData(0x62, tmp, 1); } tmp = this->unk_72 - 0x80; RestorePrevTileEntity(tmp, 1); if (((this->unk_83 & 2) != 0) && (GetTileType(tmp, 2) == 0x308)) { - sub_08000148(99, tmp, 1); + SetCollisionData(99, tmp, 1); } } diff --git a/src/object/pushableRock.c b/src/object/pushableRock.c index 29b3fdd8..f0a90128 100644 --- a/src/object/pushableRock.c +++ b/src/object/pushableRock.c @@ -92,7 +92,7 @@ void sub_0808A644(PushableRockEntity* this) { u32 tmp; this->tilePosition = COORD_TO_TILE(super); this->tileIndex = GetTileIndex(this->tilePosition, super->collisionLayer); - this->unk_72 = sub_080B1B44(this->tilePosition, super->collisionLayer); + this->unk_72 = GetCollisionData(this->tilePosition, super->collisionLayer); tmp = sub_080B1AE0(this->tilePosition, super->collisionLayer); if ((tmp == 0x19) || (tmp == 0xf0)) { SetTile(0x4015, this->tilePosition, super->collisionLayer); diff --git a/src/object/specialFx.c b/src/object/specialFx.c index a9d1f0ea..e387b5a3 100644 --- a/src/object/specialFx.c +++ b/src/object/specialFx.c @@ -201,7 +201,8 @@ void sub_080845DC(SpecialFxObject* this) { void sub_080845F8(SpecialFxObject* this) { if (((8 - (super->x.HALF.HI & 0xF)) | (8 - (super->y.HALF.HI & 0xF))) != 0) { - super->direction = CalculateDirectionFromOffsets((8 - (super->x.HALF.HI & 0xF)), (8 - (super->y.HALF.HI & 0xF))) >> 3; + super->direction = + CalculateDirectionFromOffsets((8 - (super->x.HALF.HI & 0xF)), (8 - (super->y.HALF.HI & 0xF))) >> 3; LinearMoveUpdate(super); } sub_08084630(this); |
