mirror of
https://github.com/zeldaret/tmc
synced 2026-07-01 20:20:22 -04:00
Extract some map data definitions
This commit is contained in:
+2
-1
@@ -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) {
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -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;
|
||||
|
||||
@@ -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) {
|
||||
|
||||
+2
-2
@@ -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;
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user