Rename vvv to actTile

This commit is contained in:
octorock
2024-01-06 16:14:12 +01:00
parent aced0bef69
commit 06dc158598
98 changed files with 3920 additions and 3910 deletions
+3 -3
View File
@@ -333,18 +333,18 @@ void Beanstalk_Action1Type9(BeanstalkEntity* this) {
if (super->subAction == 0) {
super->subAction = 1;
super->y.HALF.HI += 0x28;
this->unk_72 = sub_080B1A0C(super, 0, -24);
this->unk_72 = GetTileTypeRelativeToEntity(super, 0, -24);
}
super->spriteOrientation.flipY = gPlayerEntity.base.spriteOrientation.flipY;
super->spriteRendering.b3 = gPlayerEntity.base.spriteRendering.b3;
if (gPlayerState.floor_type == SURFACE_LADDER) {
super->spritePriority.b0 = 0;
if (sub_080B1A0C(super, 0, -24) != SPECIAL_TILE_20) {
if (GetTileTypeRelativeToEntity(super, 0, -24) != SPECIAL_TILE_20) {
SetTile(SPECIAL_TILE_20, COORD_TO_TILE_OFFSET(super, 0, 24), LAYER_BOTTOM);
}
} else {
super->spritePriority.b0 = 5;
if (this->unk_72 != sub_080B1A0C(super, 0, -24)) {
if (this->unk_72 != GetTileTypeRelativeToEntity(super, 0, -24)) {
SetTile(this->unk_72, COORD_TO_TILE_OFFSET(super, 0, 24), LAYER_BOTTOM);
}
}
+33 -33
View File
@@ -127,7 +127,7 @@ void sub_08099880(BigIceBlockEntity* this) {
void sub_08099910(BigIceBlockEntity* this) {
u32 uVar2;
s32 vvv;
s32 actTile;
u32 tileIndex;
u32 tilePos;
@@ -144,109 +144,109 @@ void sub_08099910(BigIceBlockEntity* this) {
SetTile(SPECIAL_TILE_34, tilePos, super->collisionLayer);
break;
case 1:
vvv = GetVvvAtTilePos(tilePos - 0x41, super->collisionLayer);
actTile = GetActTileAtTilePos(tilePos - 0x41, super->collisionLayer);
tileIndex = SPECIAL_TILE_36;
if (vvv == VVV_18) {
if (actTile == ACT_TILE_18) {
tileIndex = SPECIAL_TILE_121;
}
SetTile(tileIndex, tilePos - 0x41, super->collisionLayer);
SetTile(SPECIAL_TILE_34, tilePos - 0x40, super->collisionLayer);
vvv = GetVvvAtTilePos(tilePos - 0x3f, super->collisionLayer);
actTile = GetActTileAtTilePos(tilePos - 0x3f, super->collisionLayer);
tileIndex = SPECIAL_TILE_37;
if (vvv == VVV_18) {
if (actTile == ACT_TILE_18) {
tileIndex = SPECIAL_TILE_123;
}
SetTile(tileIndex, tilePos - 0x3f, super->collisionLayer);
vvv = GetVvvAtTilePos(tilePos - 1, super->collisionLayer);
actTile = GetActTileAtTilePos(tilePos - 1, super->collisionLayer);
tileIndex = SPECIAL_TILE_36;
if (vvv == VVV_18) {
if (actTile == ACT_TILE_18) {
tileIndex = SPECIAL_TILE_121;
}
SetTile(tileIndex, tilePos - 1, super->collisionLayer);
SetTile(SPECIAL_TILE_34, tilePos, super->collisionLayer);
vvv = GetVvvAtTilePos(tilePos + 1, super->collisionLayer);
actTile = GetActTileAtTilePos(tilePos + 1, super->collisionLayer);
tileIndex = SPECIAL_TILE_37;
if (vvv == VVV_18) {
if (actTile == ACT_TILE_18) {
tileIndex = SPECIAL_TILE_123;
}
SetTile(tileIndex, tilePos + 1, super->collisionLayer);
return;
break;
case 2:
vvv = GetVvvAtTilePos(tilePos - 0x41, super->collisionLayer);
actTile = GetActTileAtTilePos(tilePos - 0x41, super->collisionLayer);
tileIndex = SPECIAL_TILE_35;
if (vvv == VVV_18) {
if (actTile == ACT_TILE_18) {
tileIndex = SPECIAL_TILE_119;
}
SetTile(tileIndex, tilePos - 0x41, super->collisionLayer);
vvv = GetVvvAtTilePos(tilePos - 0x40, super->collisionLayer);
actTile = GetActTileAtTilePos(tilePos - 0x40, super->collisionLayer);
tileIndex = SPECIAL_TILE_35;
if (vvv == VVV_18) {
if (actTile == ACT_TILE_18) {
tileIndex = SPECIAL_TILE_119;
}
SetTile(tileIndex, tilePos - 0x40, super->collisionLayer);
SetTile(SPECIAL_TILE_34, tilePos - 1, super->collisionLayer);
SetTile(SPECIAL_TILE_34, tilePos, super->collisionLayer);
vvv = GetVvvAtTilePos(tilePos + 0x3f, super->collisionLayer);
actTile = GetActTileAtTilePos(tilePos + 0x3f, super->collisionLayer);
tileIndex = SPECIAL_TILE_38;
if (vvv == VVV_18) {
if (actTile == ACT_TILE_18) {
tileIndex = SPECIAL_TILE_124;
}
SetTile(tileIndex, tilePos + 0x3f, super->collisionLayer);
vvv = GetVvvAtTilePos(tilePos + 0x40, super->collisionLayer);
actTile = GetActTileAtTilePos(tilePos + 0x40, super->collisionLayer);
tileIndex = SPECIAL_TILE_38;
if (vvv == VVV_18) {
if (actTile == ACT_TILE_18) {
tileIndex = SPECIAL_TILE_124;
}
SetTile(tileIndex, tilePos + 0x40, super->collisionLayer);
break;
case 3:
vvv = GetVvvAtTilePos(tilePos - 0x41, super->collisionLayer);
actTile = GetActTileAtTilePos(tilePos - 0x41, super->collisionLayer);
tileIndex = SPECIAL_TILE_39;
if (vvv == VVV_18) {
if (actTile == ACT_TILE_18) {
tileIndex = SPECIAL_TILE_117;
}
SetTile(tileIndex, tilePos - 0x41, super->collisionLayer);
vvv = GetVvvAtTilePos(tilePos - 0x40, super->collisionLayer);
actTile = GetActTileAtTilePos(tilePos - 0x40, super->collisionLayer);
tileIndex = SPECIAL_TILE_35;
if (vvv == VVV_18) {
if (actTile == ACT_TILE_18) {
tileIndex = SPECIAL_TILE_119;
}
SetTile(tileIndex, tilePos - 0x40, super->collisionLayer);
vvv = GetVvvAtTilePos(tilePos - 0x3f, super->collisionLayer);
actTile = GetActTileAtTilePos(tilePos - 0x3f, super->collisionLayer);
tileIndex = SPECIAL_TILE_40;
if (vvv == VVV_18) {
if (actTile == ACT_TILE_18) {
tileIndex = SPECIAL_TILE_118;
}
SetTile(tileIndex, tilePos - 0x3f, super->collisionLayer);
vvv = GetVvvAtTilePos(tilePos - 1, super->collisionLayer);
actTile = GetActTileAtTilePos(tilePos - 1, super->collisionLayer);
tileIndex = SPECIAL_TILE_36;
if (vvv == VVV_18) {
if (actTile == ACT_TILE_18) {
tileIndex = SPECIAL_TILE_121;
}
SetTile(tileIndex, tilePos - 1, super->collisionLayer);
SetTile(SPECIAL_TILE_34, tilePos, super->collisionLayer);
vvv = GetVvvAtTilePos(tilePos + 1, super->collisionLayer);
actTile = GetActTileAtTilePos(tilePos + 1, super->collisionLayer);
tileIndex = SPECIAL_TILE_37;
if (vvv == VVV_18) {
if (actTile == ACT_TILE_18) {
tileIndex = SPECIAL_TILE_123;
}
SetTile(tileIndex, tilePos + 1, super->collisionLayer);
vvv = GetVvvAtTilePos(tilePos + 0x3f, super->collisionLayer);
actTile = GetActTileAtTilePos(tilePos + 0x3f, super->collisionLayer);
tileIndex = SPECIAL_TILE_41;
if (vvv == VVV_18) {
if (actTile == ACT_TILE_18) {
tileIndex = SPECIAL_TILE_120;
}
SetTile(tileIndex, tilePos + 0x3f, super->collisionLayer);
vvv = GetVvvAtTilePos(tilePos + 0x40, super->collisionLayer);
actTile = GetActTileAtTilePos(tilePos + 0x40, super->collisionLayer);
tileIndex = SPECIAL_TILE_38;
if (vvv == VVV_18) {
if (actTile == ACT_TILE_18) {
tileIndex = SPECIAL_TILE_124;
}
SetTile(tileIndex, tilePos + 0x40, super->collisionLayer);
vvv = GetVvvAtTilePos(tilePos + 0x41, super->collisionLayer);
actTile = GetActTileAtTilePos(tilePos + 0x41, super->collisionLayer);
tileIndex = SPECIAL_TILE_42;
if (vvv == VVV_18) {
if (actTile == ACT_TILE_18) {
tileIndex = SPECIAL_TILE_122;
}
SetTile(tileIndex, tilePos + 0x41, super->collisionLayer);
+18 -18
View File
@@ -11,8 +11,8 @@
typedef struct {
/*0x00*/ Entity base;
/*0x68*/ u8 unk_68[8];
/*0x70*/ u16 tilePositionUpper;
/*0x72*/ u16 tilePositionLower;
/*0x70*/ u16 tilePosUpper;
/*0x72*/ u16 tilePosLower;
/*0x74*/ u16 tileIndexUpper;
/*0x76*/ u16 tileIndexLower;
/*0x78*/ u8 unk_78[12];
@@ -48,8 +48,8 @@ void BigPushableLever_Init(BigPushableLeverEntity* this) {
void BigPushableLever_Idle(BigPushableLeverEntity* this) {
if (BigPushableLever_ShouldStartPushing(this)) {
super->action = PUSHING;
SetTile(this->tileIndexUpper, this->tilePositionUpper, super->collisionLayer);
SetTile(this->tileIndexLower, this->tilePositionLower, super->collisionLayer);
SetTile(this->tileIndexUpper, this->tilePosUpper, super->collisionLayer);
SetTile(this->tileIndexLower, this->tilePosLower, super->collisionLayer);
EnqueueSFX(SFX_132);
RequestPriorityDuration(super, 30);
if (PlayerCanBeMoved()) {
@@ -84,32 +84,32 @@ void BigPushableLever_SetIdle(BigPushableLeverEntity* this) {
void BigPushableLever_SetTiles(BigPushableLeverEntity* this) {
if (!CheckFlags(this->pushedFlag)) {
super->type2 = 0;
this->tilePositionUpper = COORD_TO_TILE_OFFSET(super, 0, 0x10);
this->tilePositionLower = this->tilePositionUpper - 0x40;
this->tileIndexUpper = GetTileIndex(this->tilePositionUpper, super->collisionLayer);
this->tileIndexLower = GetTileIndex(this->tilePositionLower, super->collisionLayer);
SetTile(SPECIAL_TILE_87, this->tilePositionUpper, super->collisionLayer);
SetTile(SPECIAL_TILE_88, this->tilePositionLower, super->collisionLayer);
this->tilePosUpper = COORD_TO_TILE_OFFSET(super, 0, 0x10);
this->tilePosLower = this->tilePosUpper - 0x40;
this->tileIndexUpper = GetTileIndex(this->tilePosUpper, super->collisionLayer);
this->tileIndexLower = GetTileIndex(this->tilePosLower, super->collisionLayer);
SetTile(SPECIAL_TILE_87, this->tilePosUpper, super->collisionLayer);
SetTile(SPECIAL_TILE_88, this->tilePosLower, super->collisionLayer);
InitializeAnimation(super, 1);
} else {
super->type2 = 1;
this->tilePositionUpper = COORD_TO_TILE_OFFSET(super, 0x10, 0);
this->tilePositionLower = this->tilePositionUpper - 1;
this->tileIndexUpper = GetTileIndex(this->tilePositionUpper, super->collisionLayer);
this->tileIndexLower = GetTileIndex(this->tilePositionLower, super->collisionLayer);
SetTile(SPECIAL_TILE_85, this->tilePositionUpper, super->collisionLayer);
SetTile(SPECIAL_TILE_86, this->tilePositionLower, super->collisionLayer);
this->tilePosUpper = COORD_TO_TILE_OFFSET(super, 0x10, 0);
this->tilePosLower = this->tilePosUpper - 1;
this->tileIndexUpper = GetTileIndex(this->tilePosUpper, super->collisionLayer);
this->tileIndexLower = GetTileIndex(this->tilePosLower, super->collisionLayer);
SetTile(SPECIAL_TILE_85, this->tilePosUpper, super->collisionLayer);
SetTile(SPECIAL_TILE_86, this->tilePosLower, super->collisionLayer);
InitializeAnimation(super, 0);
}
}
bool32 BigPushableLever_ShouldStartPushing(BigPushableLeverEntity* this) {
if (GetTileIndex(this->tilePositionLower, super->collisionLayer) == SPECIAL_TILE_89) {
if (GetTileIndex(this->tilePosLower, super->collisionLayer) == SPECIAL_TILE_89) {
if (--this->timer == 0) {
return TRUE;
}
BigPushableLever_CalculateSpriteOffsets(this);
SetTile(gUnk_081236E8[super->type2], this->tilePositionLower, super->collisionLayer);
SetTile(gUnk_081236E8[super->type2], this->tilePosLower, super->collisionLayer);
} else {
this->timer = 60;
super->spriteOffsetX = 0;
+1 -1
View File
@@ -45,7 +45,7 @@ void BlockPushed_Init(BlockPushedEntity* this) {
super->x.HALF.HI += tmp;
super->y.HALF.HI += tmp;
super->hitbox = (Hitbox*)gUnk_0811F64C[super->type];
this->unk_68 = GetTileType(tilePos, super->collisionLayer);
this->unk_68 = GetTileTypeAtTilePos(tilePos, super->collisionLayer);
switch (super->type) {
case 0:
sub_080832D8(tilePos, this);
+10 -10
View File
@@ -44,7 +44,7 @@ void Button_Init(ButtonEntity* this) {
}
this->tilePos = (((super->x.HALF.HI - gRoomControls.origin_x) >> 4) & 0x3F) |
((((super->y.HALF.HI - gRoomControls.origin_y) >> 4) & 0x3F) << 6);
this->unk_72 = GetTileType(this->tilePos, super->collisionLayer);
this->unk_72 = GetTileTypeAtTilePos(this->tilePos, super->collisionLayer);
if (super->type == 0 && CheckFlags(this->unk_86)) {
super->action = 5;
SetTileType(TILE_TYPE_122, this->tilePos, super->collisionLayer);
@@ -60,7 +60,7 @@ void Button_Init(ButtonEntity* this) {
void Button_Action1(ButtonEntity* this) {
if (sub_08081E3C(this)) {
super->action = 2;
this->unk_72 = GetTileType(this->tilePos, super->collisionLayer);
this->unk_72 = GetTileTypeAtTilePos(this->tilePos, super->collisionLayer);
}
}
@@ -132,12 +132,12 @@ bool32 sub_08081CB0(ButtonEntity* this) {
u16 tileType;
if (sub_08081D74(this)) {
this->unk_70 = -1;
if (GetTileType(this->tilePos, super->collisionLayer) == SPECIAL_TILE_53) {
if (GetTileTypeAtTilePos(this->tilePos, super->collisionLayer) == SPECIAL_TILE_53) {
sub_0807B7D8(0x78, this->tilePos, super->collisionLayer);
}
return TRUE;
} else {
tileType = GetTileType(this->tilePos, super->collisionLayer);
tileType = GetTileTypeAtTilePos(this->tilePos, super->collisionLayer);
if (tileType != 0x77 && tileType != 0x79 && tileType != SPECIAL_TILE_53) {
this->unk_70 = GetTileIndex(this->tilePos, super->collisionLayer);
return TRUE;
@@ -204,7 +204,7 @@ u32 sub_08081E3C(ButtonEntity* this) {
};
const u16* tmp1;
s32 tmp2;
tmp2 = GetTileType(this->tilePos, super->collisionLayer);
tmp2 = GetTileTypeAtTilePos(this->tilePos, super->collisionLayer);
tmp1 = gUnk_0811EE50;
do {
if (*tmp1 == tmp2)
@@ -223,21 +223,21 @@ void sub_08081E6C(ButtonEntity* this) {
u32 tileType;
MapLayer* mapLayer;
u16* tmp2;
u16* tmp;
u16* subTiles;
u16* tmp3;
u32 tilePos = this->tilePos;
u32 layer = super->collisionLayer;
u32 specialTile = GetTileType(tilePos, layer);
u32 specialTile = GetTileTypeAtTilePos(tilePos, layer);
if (specialTile < 0x4000)
return;
mapLayer = GetLayerByIndex(layer);
tileType = (super->type == 0 ? TILE_TYPE_122 : TILE_TYPE_120);
tmp = mapLayer->tiles;
tmp = tmp + (mapLayer->unkData2[tileType] << 2);
subTiles = mapLayer->subTiles;
subTiles = subTiles + (mapLayer->tileIndices[tileType] << 2);
tmp2 = (layer == 2 ? gMapDataTopSpecial : gMapDataBottomSpecial);
tmp2 += (((0x3f & tilePos) << 1) + ((0xfc0 & tilePos) << 2));
if (sub_08081F00((u32*)tmp2, (u32*)tmp))
if (sub_08081F00((u32*)tmp2, (u32*)subTiles))
return;
SetTileType(tileType, tilePos, layer);
SetTile(specialTile, tilePos, layer);
+2 -2
View File
@@ -232,7 +232,7 @@ void ChestSpawner_Type0Init(ChestSpawnerEntity* this) {
super->action++;
this->tilePos = COORD_TO_TILE(super);
super->hitbox = (Hitbox*)&gUnk_0811F8A8;
if (GetTileTypeByEntity(super) == TILE_TYPE_116) {
if (GetTileTypeAtEntity(super) == TILE_TYPE_116) {
DeleteThisEntity();
}
if (CheckFlags(this->unk_86)) {
@@ -271,7 +271,7 @@ void ChestSpawner_Type0Action2(ChestSpawnerEntity* this) {
void ChestSpawner_Type0Action3(ChestSpawnerEntity* this) {
if ((super->type == 1) || (super->type == 7)) {
if (GetTileTypeByEntity(super) == TILE_TYPE_116) {
if (GetTileTypeAtEntity(super) == TILE_TYPE_116) {
DeleteEntity(super);
} else {
if (!CheckFlags(this->unk_86)) {
+3 -3
View File
@@ -168,13 +168,13 @@ void CrenelBeanSprout_Action1(CrenelBeanSproutEntity* this) {
tmp = gPlayerEntity.base.animationState & 6;
this->unk_70 = ((super->x.HALF.HI + (s8)gUnk_08123184[tmp]) & -0x10) | 8;
this->unk_72 = ((super->y.HALF.HI + (s8)gUnk_08123184[(tmp) + 1]) & -0x10) | 8;
if (GetVvvAtWorldCoords(this->unk_70, this->unk_72, super->collisionLayer) == VVV_25) {
if (GetActTileAtWorldCoords(this->unk_70, this->unk_72, super->collisionLayer) == ACT_TILE_25) {
gHUD.rActionPlayerState = R_ACTION_THROW;
} else {
gHUD.rActionPlayerState = R_ACTION_NONE;
}
PositionRelative(&gPlayerEntity.base, super, 0, 0x10000);
if (GetVvvAtEntity(super) == VVV_25) {
if (GetActTileAtEntity(super) == ACT_TILE_25) {
RestorePrevTileEntity(0xdc, super->collisionLayer);
sub_08096A78(this);
}
@@ -233,7 +233,7 @@ void CrenelBeanSprout_Action3(CrenelBeanSproutEntity* this) {
void CrenelBeanSprout_Action4(CrenelBeanSproutEntity* this) {
static const u16 gUnk_0812319C[] = { SPECIAL_TILE_60, SPECIAL_TILE_51 };
if (gUnk_0812319C[super->type >> 1] == GetTileTypeByEntity(super)) {
if (gUnk_0812319C[super->type >> 1] == GetTileTypeAtEntity(super)) {
GetNextFrame(super);
gPlayerState.keepFacing |= 0x80;
gPlayerState.field_0xa |= 0x80;
+1 -1
View File
@@ -332,7 +332,7 @@ void CutsceneMiscObject_Type5(CutsceneMiscObjectEntity* this) {
super->zVelocity = 0;
SetEntityPriority(super, PRIO_PLAYER_EVENT);
InitializeAnimation(super, 0);
if (GetVvvAtEntity(super) == VVV_13) {
if (GetActTileAtEntity(super) == ACT_TILE_13) {
super->action = 3;
}
break;
+1 -1
View File
@@ -73,7 +73,7 @@ void DoubleBookshelf_Init(DoubleBookshelfEntity* this) {
}
void DoubleBookshelf_Action1(DoubleBookshelfEntity* this) {
GetTileType(this->unk_82, super->collisionLayer);
GetTileTypeAtTilePos(this->unk_82, super->collisionLayer);
sub_0809B234(this);
}
+1 -1
View File
@@ -50,7 +50,7 @@ void Fireplace_Action1(FireplaceEntity* this) {
}
void sub_0809B7C0(FireplaceEntity* this) {
u32 tileType = GetTileTypeByEntity(super);
u32 tileType = GetTileTypeAtEntity(super);
if (tileType != SPECIAL_TILE_97 && tileType != SPECIAL_TILE_98) {
sub_0809B7DC(this);
}
+4 -4
View File
@@ -261,7 +261,7 @@ static void FurnitureInit(FurnitureEntity* this) {
for (i = 0; i < cnt; ++i, ++tilePos) {
SetTile(SPECIAL_TILE_38, tilePos, LAYER_TOP);
SetTile(SPECIAL_TILE_38, tilePos, LAYER_BOTTOM);
SetVvvAtTilePos(VVV_0, tilePos + TILE_POS(0, 1), 1);
SetActTileAtTilePos(ACT_TILE_0, tilePos + TILE_POS(0, 1), 1);
}
break;
}
@@ -287,7 +287,7 @@ static void FurnitureInit(FurnitureEntity* this) {
super->collisionLayer = 1;
super->spriteOrientation.flipY = 2;
SetTile(SPECIAL_TILE_116, this->tilePos - 64, super->collisionLayer);
SetVvvAtTilePos(VVV_63, this->tilePos - 64, super->collisionLayer);
SetActTileAtTilePos(ACT_TILE_63, this->tilePos - 64, super->collisionLayer);
SetTile(SPECIAL_TILE_23, this->tilePos, super->collisionLayer);
SetTile(SPECIAL_TILE_23, this->tilePos + 64, super->collisionLayer);
break;
@@ -339,7 +339,7 @@ static void FurnitureUpdate(FurnitureEntity* this) {
case 0x80:
if (gPlayerEntity.base.y.HALF.HI < super->y.HALF.HI + 8) {
if (gPlayerState.floor_type != SURFACE_LADDER &&
GetTileTypeByEntity(super) == SPECIAL_TILE_23) {
GetTileTypeAtEntity(super) == SPECIAL_TILE_23) {
SetTile(SPECIAL_TILE_38, this->tilePos, super->collisionLayer);
SetTile(SPECIAL_TILE_61, this->tilePos + TILE_POS(0, -1), super->collisionLayer);
SetTile(SPECIAL_TILE_61, this->tilePos + TILE_POS(0, -2), super->collisionLayer);
@@ -349,7 +349,7 @@ static void FurnitureUpdate(FurnitureEntity* this) {
gPlayerEntity.base.collisionLayer = 1;
UpdateSpriteForCollisionLayer(&gPlayerEntity.base);
}
if (GetTileTypeByEntity(super) != SPECIAL_TILE_23) {
if (GetTileTypeAtEntity(super) != SPECIAL_TILE_23) {
SetTile(SPECIAL_TILE_23, this->tilePos, super->collisionLayer);
SetTile(SPECIAL_TILE_23, this->tilePos + TILE_POS(0, -1), super->collisionLayer);
SetTile(SPECIAL_TILE_20, this->tilePos + TILE_POS(0, -2), super->collisionLayer);
+1 -1
View File
@@ -83,5 +83,5 @@ void sub_0808E55C(GiantBookLadderEntity* this) {
}
u32 sub_0808E670(GiantBookLadderEntity* this) {
return GetTileType(this->unk74 - 0x101, LAYER_BOTTOM);
return GetTileTypeAtTilePos(this->unk74 - 0x101, LAYER_BOTTOM);
}
+1 -1
View File
@@ -55,7 +55,7 @@ void HiddenLadderDown_Init(HiddenLadderDownEntity* this) {
}
void HiddenLadderDown_Action1(HiddenLadderDownEntity* this) {
if (GetTileType(this->unk_70, super->collisionLayer) == 0x1a6) {
if (GetTileTypeAtTilePos(this->unk_70, super->collisionLayer) == 0x1a6) {
super->action = 2;
super->spriteSettings.draw = TRUE;
SetFlag(this->unk_86);
+2 -2
View File
@@ -218,7 +218,7 @@ void sub_08081188(ItemOnGroundEntity* this) {
void sub_080811AC(ItemOnGroundEntity* this) {
super->action = 2;
super->spriteSettings.draw = 0;
this->unk_6e = GetTileTypeByEntity(super);
this->unk_6e = GetTileTypeAtEntity(super);
}
void sub_080811C8(ItemOnGroundEntity* this) {
@@ -285,7 +285,7 @@ void sub_080812A0(ItemOnGroundEntity* this) {
void sub_080812A8(ItemOnGroundEntity* this) {
if (GetCollisionDataAtEntity(super) != COLLISION_DATA_15 &&
this->unk_6e != GetTileTypeByEntity(super)) {
this->unk_6e != GetTileTypeAtEntity(super)) {
super->direction = 0;
super->speed = 0;
super->spriteSettings.draw = 1;
+2 -2
View File
@@ -67,12 +67,12 @@ void LadderUp(Entity* this) {
if (this->type2 == 0) {
if (gPlayerEntity.base.y.HALF.HI < this->y.HALF.HI) {
if (gPlayerState.floor_type != SURFACE_LADDER &&
(GetTileTypeByEntity(this) == SPECIAL_TILE_23)) {
(GetTileTypeAtEntity(this) == SPECIAL_TILE_23)) {
SetTile(SPECIAL_TILE_35, COORD_TO_TILE(this), this->collisionLayer);
RestorePrevTileEntity(COORD_TO_TILE_OFFSET(this, 0, 16), this->collisionLayer);
}
} else {
if (GetTileTypeByEntity(this) != SPECIAL_TILE_23) {
if (GetTileTypeAtEntity(this) != SPECIAL_TILE_23) {
SetTile(SPECIAL_TILE_23, COORD_TO_TILE(this), this->collisionLayer);
if (this->type == 0) {
SetTile(SPECIAL_TILE_23, COORD_TO_TILE_OFFSET(this, 0, 16), this->collisionLayer);
+6 -6
View File
@@ -331,10 +331,10 @@ void LilypadLarge_Action2(LilypadLargeEntity* this) {
void sub_08085A44(LilypadLargeEntity* this) {
super->speed = 0x200;
if (GetVvvRelativeToEntity(super, 0x10, 0x18) != VVV_17) {
if (GetActTileRelativeToEntity(super, 0x10, 0x18) != ACT_TILE_17) {
super->direction = 0x18;
} else {
if (GetVvvRelativeToEntity(super, -0x10, 0x18) != VVV_17) {
if (GetActTileRelativeToEntity(super, -0x10, 0x18) != ACT_TILE_17) {
super->direction = 8;
} else {
super->direction = 0x10;
@@ -355,7 +355,7 @@ void sub_08085A98(LilypadLargeEntity* this) {
this->unk_78.WORD -= 0x20000;
SetAffineInfo(super, this->unk_78.HALF_U.HI, this->unk_78.HALF_U.HI, this->unk_7c.HALF_U.HI);
}
if (GetVvvRelativeToEntity(super, 0, 0x18) != VVV_17) {
if (GetActTileRelativeToEntity(super, 0, 0x18) != ACT_TILE_17) {
super->subAction = 2;
if (gArea.locationIndex == 27) { // AREA_TEMPLE_OF_DROPLETS
super->y.HALF.HI += 0xd0;
@@ -388,7 +388,7 @@ void sub_08085B40(LilypadLargeEntity* this) {
}
} else {
ResetCollisionLayer(super);
if (GetVvvAtEntity(super) == VVV_13) {
if (GetActTileAtEntity(super) == ACT_TILE_13) {
ResetCollisionLayer(&gPlayerEntity.base);
LilypadLarge_Action4(this);
super->direction = GetFacingDirection(&gPlayerEntity.base, super);
@@ -410,7 +410,7 @@ void sub_08085B40(LilypadLargeEntity* this) {
super->timer |= 0x80;
this->unk_70 = 0;
this->unk_6c = 0;
if (GetVvvAtEntity(super) == VVV_13) {
if (GetActTileAtEntity(super) == ACT_TILE_13) {
super->action = 4;
}
}
@@ -458,7 +458,7 @@ void LilypadLarge_Action5(LilypadLargeEntity* this) {
void sub_08085D28(LilypadLargeEntity* this) {
if (((gPlayerState.framestate != PL_STATE_TALKEZLO) && ((gPlayerState.flags & PL_FLAGS2) != 0)) &&
(GetVvvRelativeToEntity(super, 0, 0x18) == VVV_17)) {
(GetActTileRelativeToEntity(super, 0, 0x18) == ACT_TILE_17)) {
super->action = 2;
super->subAction = 0;
PausePlayer();
+2 -2
View File
@@ -15,7 +15,7 @@ typedef struct {
/*0x68*/ u8 unk_68;
} LinkEmptyingBottleEntity;
extern u32 sub_080B1A0C(Entity*, s32, s32);
extern u32 GetTileTypeRelativeToEntity(Entity*, s32, s32);
void LinkEmptyingBottle_Init(LinkEmptyingBottleEntity*);
void LinkEmptyingBottle_Action1(LinkEmptyingBottleEntity*);
@@ -118,7 +118,7 @@ void sub_08094980(LinkEmptyingBottleEntity* this, u32 searchTileIndex, u32 repla
while (index < 10) {
xOffset = gUnk_08122A28[index];
yOffset = gUnk_08122A28[index + 1];
if (searchTileIndex == sub_080B1A0C(super, xOffset, yOffset)) {
if (searchTileIndex == GetTileTypeRelativeToEntity(super, xOffset, yOffset)) {
SetTile(replaceTileIndex, TILE(super->x.HALF.HI + xOffset, super->y.HALF.HI + yOffset),
super->collisionLayer);
}
+23 -23
View File
@@ -131,7 +131,7 @@ void Minecart_Action2(MinecartEntity* this) {
void Minecart_Action3(MinecartEntity* this) {
static const s8 offsetCoords[] = { 0, -7, 7, 0, 0, 7, -7, 0 };
u32 vvv;
u32 actTile;
gRoomControls.scrollSpeed = 7;
if ((gPlayerState.flags & PL_IN_MINECART) == 0) {
@@ -163,14 +163,14 @@ void Minecart_Action3(MinecartEntity* this) {
super->subtimer = 60;
}
vvv = GetVvvRelativeToEntity(super, offsetCoords[super->animationState * 2],
actTile = GetActTileRelativeToEntity(super, offsetCoords[super->animationState * 2],
offsetCoords[super->animationState * 2 + 1]);
if (FindValueForKey(vvv, gUnk_081223D8[super->animationState]) == 0) {
if (FindValueForKey(actTile, gUnk_081223D8[super->animationState]) == 0) {
super->direction = DirectionTurnAround(super->direction);
super->animationState = AnimationStateFlip90(super->animationState);
} else {
switch (vvv) {
case VVV_100:
switch (actTile) {
case ACT_TILE_100:
super->flags &= ~ENT_PERSIST;
super->hitType = 1;
super->collisionFlags = 0x47;
@@ -190,15 +190,15 @@ void Minecart_Action3(MinecartEntity* this) {
SoundReq(SFX_PLY_VO4);
SoundReq(SFX_139);
return;
case VVV_103:
case VVV_104:
case VVV_105:
case VVV_106:
case VVV_108:
case VVV_109:
case VVV_110:
case VVV_111:
if (vvv == GetVvvAtEntity(super)) {
case ACT_TILE_103:
case ACT_TILE_104:
case ACT_TILE_105:
case ACT_TILE_106:
case ACT_TILE_108:
case ACT_TILE_109:
case ACT_TILE_110:
case ACT_TILE_111:
if (actTile == GetActTileAtEntity(super)) {
Minecart_Action4(this);
gPlayerEntity.base.animationState = super->animationState << 1;
return;
@@ -220,8 +220,8 @@ void Minecart_Action3(MinecartEntity* this) {
void Minecart_Action4(MinecartEntity* this) {
SnapToTile(super);
CopyPosition(super, &gPlayerEntity.base);
switch (GetVvvAtEntity(super)) {
case VVV_103:
switch (GetActTileAtEntity(super)) {
case ACT_TILE_103:
if (super->direction == DirectionWest) {
super->direction = DirectionNorth;
super->animationState = 0;
@@ -230,7 +230,7 @@ void Minecart_Action4(MinecartEntity* this) {
super->animationState = 1;
}
break;
case VVV_104:
case ACT_TILE_104:
if (super->direction == DirectionEast) {
super->direction = DirectionSouth;
super->animationState = 2;
@@ -239,7 +239,7 @@ void Minecart_Action4(MinecartEntity* this) {
super->animationState = 3;
}
break;
case VVV_105:
case ACT_TILE_105:
if (super->direction == DirectionEast) {
super->direction = DirectionNorth;
super->animationState = 0;
@@ -248,7 +248,7 @@ void Minecart_Action4(MinecartEntity* this) {
super->animationState = 3;
}
break;
case VVV_106:
case ACT_TILE_106:
if (super->direction == DirectionWest) {
super->direction = DirectionSouth;
super->animationState = 2;
@@ -343,18 +343,18 @@ const KeyValuePair* const gUnk_081223D8[] = {
gUnk_08122436,
};
const KeyValuePair gUnk_081223E8[] = {
{ VVV_242, 1 }, { VVV_101, 1 }, { VVV_104, 1 }, { VVV_106, 1 }, { VVV_100, 1 }, { VVV_41, 1 },
{ ACT_TILE_242, 1 }, { ACT_TILE_101, 1 }, { ACT_TILE_104, 1 }, { ACT_TILE_106, 1 }, { ACT_TILE_100, 1 }, { ACT_TILE_41, 1 },
};
const u16 gUnk_081223E8End = 0;
const KeyValuePair gUnk_08122402[] = {
{ VVV_243, 1 }, { VVV_102, 1 }, { VVV_104, 1 }, { VVV_105, 1 }, { VVV_100, 1 }, { VVV_41, 1 },
{ ACT_TILE_243, 1 }, { ACT_TILE_102, 1 }, { ACT_TILE_104, 1 }, { ACT_TILE_105, 1 }, { ACT_TILE_100, 1 }, { ACT_TILE_41, 1 },
};
const u16 gUnk_08122402End = 0;
const KeyValuePair gUnk_0812241C[] = {
{ VVV_242, 1 }, { VVV_101, 1 }, { VVV_103, 1 }, { VVV_105, 1 }, { VVV_100, 1 }, { VVV_41, 1 },
{ ACT_TILE_242, 1 }, { ACT_TILE_101, 1 }, { ACT_TILE_103, 1 }, { ACT_TILE_105, 1 }, { ACT_TILE_100, 1 }, { ACT_TILE_41, 1 },
};
const u16 gUnk_0812241CEnd = 0;
const KeyValuePair gUnk_08122436[] = {
{ VVV_243, 1 }, { VVV_102, 1 }, { VVV_106, 1 }, { VVV_103, 1 }, { VVV_100, 1 }, { VVV_41, 1 },
{ ACT_TILE_243, 1 }, { ACT_TILE_102, 1 }, { ACT_TILE_106, 1 }, { ACT_TILE_103, 1 }, { ACT_TILE_100, 1 }, { ACT_TILE_41, 1 },
};
const u16 gUnk_08122436End = 0;
+2 -2
View File
@@ -108,9 +108,9 @@ void ObjectBlockingStairs_Action1(ObjectBlockingStairsEntity* this) {
}
if (this->unk7b & 0x40) {
tileType = (u32)GetTileType(this->tilePos - 1, super->collisionLayer);
tileType = (u32)GetTileTypeAtTilePos(this->tilePos - 1, super->collisionLayer);
} else {
tileType = (u32)GetTileType(this->tilePos + 1, super->collisionLayer);
tileType = (u32)GetTileTypeAtTilePos(this->tilePos + 1, super->collisionLayer);
}
switch (tileType) {
+4 -4
View File
@@ -148,7 +148,7 @@ void ObjectOnPillar_Action4(ObjectOnPillarEntity* this) {
bool32 sub_08097008(ObjectOnPillarEntity* this) {
Entity* effect;
u32 tileType = GetTileType(this->tilePos, super->collisionLayer);
u32 tileType = GetTileTypeAtTilePos(this->tilePos, super->collisionLayer);
if (tileType != SPECIAL_TILE_54) {
switch (sub_08097074(tileType)) {
case 1:
@@ -191,7 +191,7 @@ void sub_08097098(ObjectOnPillarEntity* this) {
this->unk_76 = 0x20;
EnqueueSFX(SFX_10F);
SetTile(this->tileIndex, this->tilePos, super->collisionLayer);
tileType = GetTileType(gUnk_080B4488[super->direction >> 3] + this->tilePos, super->collisionLayer);
tileType = GetTileTypeAtTilePos(gUnk_080B4488[super->direction >> 3] + this->tilePos, super->collisionLayer);
if ((tileType == 0x79) || tileType == 0x77) {
super->spriteOffsetY = 2;
}
@@ -206,7 +206,7 @@ void sub_080970F4(ObjectOnPillarEntity* this) {
bool32 sub_08097144(ObjectOnPillarEntity* this) {
LinearMoveUpdate(super);
sub_0800445C(super);
if (GetVvvAtEntity(super) == VVV_25) {
if (GetActTileAtEntity(super) == ACT_TILE_25) {
super->spriteOffsetY = 2;
}
if ((--this->unk_76 == 0) && sub_08097194(this) == FALSE) {
@@ -222,7 +222,7 @@ bool32 sub_08097194(ObjectOnPillarEntity* this) {
if (sub_0800442E(super)) {
return TRUE;
} else {
u32 tileType = GetTileTypeByEntity(super);
u32 tileType = GetTileTypeAtEntity(super);
if (tileType == TILE_TYPE_113 || tileType == TILE_TYPE_114 || tileType == SPECIAL_TILE_32) {
SetFlag(this->flag);
EnqueueSFX(SFX_10B);
+3 -3
View File
@@ -110,7 +110,7 @@ void PlayerClone_Action2(PlayerCloneEntity* this) {
if (gPlayerEntity.base.iframes >= 1) {
gPlayerState.chargeState.action = 1;
} else {
GetVvvAtEntity(super); // TODO why is the return value not used? // leftover from debugging?
GetActTileAtEntity(super); // TODO why is the return value not used? // leftover from debugging?
sub_08084B1C(this);
super->x.HALF.HI = gPlayerEntity.base.x.HALF.HI + this->unk78;
super->y.HALF.HI = gPlayerEntity.base.y.HALF.HI + this->unk7a;
@@ -191,8 +191,8 @@ void sub_08084CAC(PlayerCloneEntity* this) {
if (((PlayerCloneEntity*)gPlayerClones[super->type])->unk70 == 0) {
ptr = &gUnk_080B4468[super->animationState & 6];
if (GetVvvForTileType(
GetTileType(COORD_TO_TILE_OFFSET(super, -ptr[0], -ptr[1]), super->collisionLayer)) == VVV_114) {
if (GetActTileForTileType(
GetTileTypeAtTilePos(COORD_TO_TILE_OFFSET(super, -ptr[0], -ptr[1]), super->collisionLayer)) == ACT_TILE_114) {
((PlayerCloneEntity*)gPlayerClones[0])->unk6c |= (1 << super->type);
} else {
((PlayerCloneEntity*)gPlayerClones[0])->unk6c &= ~(1 << super->type);
+3 -3
View File
@@ -107,7 +107,7 @@ void Pot_Action1(PotEntity* this) {
Pot_Action5(this);
break;
default:
tileType = GetTileTypeByEntity(super);
tileType = GetTileTypeAtEntity(super);
if (tileType != 0x4000) {
switch (tileType) {
case SPECIAL_TILE_4:
@@ -129,7 +129,7 @@ void Pot_Action1(PotEntity* this) {
DeleteThisEntity();
break;
default:
if (GetVvvAtEntity(super) == VVV_13) {
if (GetActTileAtEntity(super) == ACT_TILE_13) {
CreateFx(super, FX_FALL_DOWN, 0);
} else if (tileType == SPECIAL_TILE_5) {
gPlayerState.lastSwordMove = SWORD_MOVE_BREAK_POT;
@@ -224,7 +224,7 @@ void Pot_Action4(PotEntity* this) {
}
this->unk_70 = GetTileIndex(COORD_TO_TILE(super), super->collisionLayer);
tileType = GetTileTypeByEntity(super);
tileType = GetTileTypeAtEntity(super);
switch (tileType) {
case 0x71:
case 0x72:
+8 -8
View File
@@ -492,7 +492,7 @@ void sub_0809028C(PushableFurnitureEntity* this, u32 param_2) {
if ((this->unk_83 & 0x20) != 0) {
sub_08090480(0, uVar2 + 1);
} else {
switch (GetTileType(uVar2, 2)) {
switch (GetTileTypeAtTilePos(uVar2, 2)) {
case 0x301:
this->unk_83 |= 8;
break;
@@ -506,7 +506,7 @@ void sub_0809028C(PushableFurnitureEntity* this, u32 param_2) {
sub_08090480(0, uVar2);
}
if ((this->unk_83 & 0x10) != 0) {
switch (GetTileType(pos - 1, 1)) {
switch (GetTileTypeAtTilePos(pos - 1, 1)) {
case 0x300:
break;
default:
@@ -516,7 +516,7 @@ void sub_0809028C(PushableFurnitureEntity* this, u32 param_2) {
}
return;
}
switch (GetTileType(pos - 1, 2)) {
switch (GetTileTypeAtTilePos(pos - 1, 2)) {
case 0x300:
this->unk_83 |= 4;
break;
@@ -533,7 +533,7 @@ void sub_0809028C(PushableFurnitureEntity* this, u32 param_2) {
if ((this->unk_83 & 0x10) != 0) {
sub_08090480(0, pos - 1);
} else {
switch (GetTileType(pos, 2)) {
switch (GetTileTypeAtTilePos(pos, 2)) {
case 0x302:
this->unk_83 |= 4;
break;
@@ -547,7 +547,7 @@ void sub_0809028C(PushableFurnitureEntity* this, u32 param_2) {
sub_08090480(0, uVar2);
}
if ((this->unk_83 & 0x20) != 0) {
switch (GetTileType(uVar2 + 1, 1)) {
switch (GetTileTypeAtTilePos(uVar2 + 1, 1)) {
case 0x300:
break;
default:
@@ -557,7 +557,7 @@ void sub_0809028C(PushableFurnitureEntity* this, u32 param_2) {
}
return;
}
switch (GetTileType(uVar2 + 1, 2)) {
switch (GetTileTypeAtTilePos(uVar2 + 1, 2)) {
case 0x300:
this->unk_83 |= 8;
break;
@@ -579,12 +579,12 @@ void sub_08090480(u32 param_1, u32 tilePos) {
void sub_08090498(PushableFurnitureEntity* this) {
u32 tmp = this->unk_70 - 0x80;
RestorePrevTileEntity(tmp, 1);
if (((this->unk_83 & 1) != 0) && (GetTileType(tmp, 2) == 0x306)) {
if (((this->unk_83 & 1) != 0) && (GetTileTypeAtTilePos(tmp, 2) == 0x306)) {
SetCollisionData(0x62, tmp, 1);
}
tmp = this->unk_72 - 0x80;
RestorePrevTileEntity(tmp, 1);
if (((this->unk_83 & 2) != 0) && (GetTileType(tmp, 2) == 0x308)) {
if (((this->unk_83 & 2) != 0) && (GetTileTypeAtTilePos(tmp, 2) == 0x308)) {
SetCollisionData(99, tmp, 1);
}
}
+1 -1
View File
@@ -149,7 +149,7 @@ bool32 sub_0809785C(PushableGraveEntity* this) {
if (super->type != 0) {
if (super->type2 != 0) {
if ((CheckFlags(this->pushedFlag) != 0) ||
GetTileType(this->unk_68, super->collisionLayer) == SPECIAL_TILE_63) {
GetTileTypeAtTilePos(this->unk_68, super->collisionLayer) == SPECIAL_TILE_63) {
super->action = 3;
super->timer = 64;
super->subtimer = 0;
+4 -4
View File
@@ -41,7 +41,7 @@ void PushableRock_Action1(PushableRockEntity* this) {
u32 tileType;
u32 tmp;
tileType = GetTileType(this->tilePos, super->collisionLayer);
tileType = GetTileTypeAtTilePos(this->tilePos, super->collisionLayer);
switch (tileType) {
case SPECIAL_TILE_28:
case SPECIAL_TILE_29:
@@ -87,12 +87,12 @@ void PushableRock_Action3(PushableRockEntity* this) {
}
void sub_0808A644(PushableRockEntity* this) {
u32 vvv;
u32 actTile;
this->tilePos = COORD_TO_TILE(super);
this->tileIndex = GetTileIndex(this->tilePos, super->collisionLayer);
this->collisionData = GetCollisionDataAtTilePos(this->tilePos, super->collisionLayer);
vvv = GetVvvAtTilePos(this->tilePos, super->collisionLayer);
if ((vvv == VVV_25) || (vvv == VVV_240)) {
actTile = GetActTileAtTilePos(this->tilePos, super->collisionLayer);
if ((actTile == ACT_TILE_25) || (actTile == ACT_TILE_240)) {
SetTile(SPECIAL_TILE_21, this->tilePos, super->collisionLayer);
super->action = 3;
if (!CheckFlags(this->pushedFlag)) {
+8 -8
View File
@@ -62,7 +62,7 @@ void PushableStatue_Action1(PushableStatueEntity* this) {
Entity* obj;
if (sub_0800442E(super) == 0) {
tileType = GetTileType(this->unk_84, super->collisionLayer);
tileType = GetTileTypeAtTilePos(this->unk_84, super->collisionLayer);
if (tileType != SPECIAL_TILE_11) {
switch (sub_0808968C(tileType)) {
case 1:
@@ -110,7 +110,7 @@ void PushableStatue_SubAction0(PushableStatueEntity* this) {
ptr = &gUnk_08120CB4[index];
PositionRelative(super, &gPlayerEntity.base, Q_16_16(ptr[0]), Q_16_16(ptr[1]));
}
tileType = GetTileType(this->unk_84, super->collisionLayer);
tileType = GetTileTypeAtTilePos(this->unk_84, super->collisionLayer);
if (tileType != SPECIAL_TILE_11) {
switch (sub_0808968C(tileType)) {
case 1:
@@ -166,7 +166,7 @@ void sub_08089454(PushableStatueEntity* this) {
this->unk_84 = COORD_TO_TILE(super);
this->unk_80 = GetTileIndex(this->unk_84, super->collisionLayer);
SetTile(SPECIAL_TILE_11, this->unk_84, super->collisionLayer);
if (super->collisionLayer == 2 && GetTileType(this->unk_84, 1) == 0x310) {
if (super->collisionLayer == 2 && GetTileTypeAtTilePos(this->unk_84, 1) == 0x310) {
SetTile(SPECIAL_TILE_11, this->unk_84, LAYER_BOTTOM);
}
}
@@ -197,10 +197,10 @@ void sub_08089538(PushableStatueEntity* this) {
this->unk_86 = 0x20;
EnqueueSFX(SFX_10F);
SetTile(this->unk_80, this->unk_84, super->collisionLayer);
if ((super->collisionLayer == 2) && (GetTileType(this->unk_84, LAYER_BOTTOM) == SPECIAL_TILE_11)) {
if ((super->collisionLayer == 2) && (GetTileTypeAtTilePos(this->unk_84, LAYER_BOTTOM) == SPECIAL_TILE_11)) {
CloneTile(TILE_TYPE_784, this->unk_84, 1);
}
tileType = GetTileType(this->unk_84 + gUnk_080B4488[super->direction >> 3], super->collisionLayer);
tileType = GetTileTypeAtTilePos(this->unk_84 + gUnk_080B4488[super->direction >> 3], super->collisionLayer);
if ((tileType == TILE_TYPE_121) || (tileType == TILE_TYPE_119)) {
super->spriteOffsetY = -2;
}
@@ -258,14 +258,14 @@ bool32 sub_080896B0(void) {
const s16* ptr;
u32 tmp1;
u32 tmp2;
u32 vvv;
u32 actTile;
if (((gPlayerState.heldObject & 0x1f) == 0x12) && ((gPlayerEntity.base.frame & 1) != 0)) {
ptr = &gUnk_080B4468[gPlayerEntity.base.animationState & 6];
uVar1 = gUnk_080B4488[gPlayerEntity.base.animationState >> 1];
uVar4 = COORD_TO_TILE_OFFSET(&gPlayerEntity.base, -ptr[0], -ptr[1]) - uVar1;
vvv = GetVvvAtTilePos(uVar4, gPlayerEntity.base.collisionLayer);
if ((vvv - 0x26 > 1) && (vvv != VVV_41)) {
actTile = GetActTileAtTilePos(uVar4, gPlayerEntity.base.collisionLayer);
if ((actTile - 0x26 > 1) && (actTile != ACT_TILE_41)) {
mapLayer = GetLayerByIndex(gPlayerEntity.base.collisionLayer);
iVar2 = (uVar4 * 0x10000) >> 0x10;
tmp1 = mapLayer->collisionData[iVar2];
+1 -1
View File
@@ -31,7 +31,7 @@ void RotatingTrapdoor_Init(Entity* this) {
this->action = 1;
x = 0;
y = 0;
switch (GetTileTypeByEntity(this)) {
switch (GetTileTypeAtEntity(this)) {
case 0x343:
x = 0x10;
case 0x344:
+3 -3
View File
@@ -85,7 +85,7 @@ void SmallIceBlock_Action1(SmallIceBlockEntity* this) {
}
} else {
if (!sub_0800442E(super)) {
tileType = GetTileType(this->tilePos, super->collisionLayer);
tileType = GetTileTypeAtTilePos(this->tilePos, super->collisionLayer);
if (tileType != SPECIAL_TILE_90) {
switch (sub_08099618(tileType)) {
case 1:
@@ -186,10 +186,10 @@ void sub_080994B8(SmallIceBlockEntity* this) {
EnqueueSFX(SFX_ICE_BLOCK_SLIDE);
SetTile(this->unk_6c, this->tilePos, super->collisionLayer);
if ((super->collisionLayer == 2) && (GetTileType(this->tilePos, 1) == SPECIAL_TILE_90)) {
if ((super->collisionLayer == 2) && (GetTileTypeAtTilePos(this->tilePos, 1) == SPECIAL_TILE_90)) {
CloneTile(TILE_TYPE_784, this->tilePos, 1);
}
tileType = GetTileType(this->tilePos + gUnk_080B4488[super->direction >> 3], super->collisionLayer);
tileType = GetTileTypeAtTilePos(this->tilePos + gUnk_080B4488[super->direction >> 3], super->collisionLayer);
if (tileType == 0x79 || tileType == 0x77) {
super->spriteOffsetY = -2;
}
+2 -2
View File
@@ -71,8 +71,8 @@ void sub_080878CC(Entity* this) {
for (itX = -0x10; itX < 0x11; itX += 0x10) {
for (itY = -0x10; itY < 0x11; itY += 0x10) {
tilePos = TILE((u32)x + itX, (u32)y + itY);
if (GetVvvAtTilePos(tilePos, (u8)layer) == VVV_46) {
switch (GetTileType(tilePos, layer)) {
if (GetActTileAtTilePos(tilePos, (u8)layer) == ACT_TILE_46) {
switch (GetTileTypeAtTilePos(tilePos, layer)) {
case 0x368:
case 0x367:
DoTileInteraction(this, 3, x + itX, y + itY);
+5 -5
View File
@@ -60,7 +60,7 @@ void TreeHidingPortal_Action1(TreeHidingPortalEntity* this) {
}
}
}
if (sub_0809E9A0() == VVV_84) {
if (sub_0809E9A0() == ACT_TILE_84) {
super->action = 2;
super->timer = 15;
SetPlayerControl(1);
@@ -110,15 +110,15 @@ static void sub_0809E96C(TreeHidingPortalEntity* this) {
}
static u32 sub_0809E9A0(void) {
u32 vvv;
u32 actTile;
const s16* ptr;
if (gPlayerEntity.base.action != PLAYER_BOUNCE) {
vvv = VVV_0;
actTile = ACT_TILE_0;
} else {
ptr = &gUnk_080B4468[gPlayerEntity.base.animationState & 6];
vvv = GetVvvAtTilePos(COORD_TO_TILE_OFFSET(&gPlayerEntity.base, -ptr[0], -ptr[1]), 1);
actTile = GetActTileAtTilePos(COORD_TO_TILE_OFFSET(&gPlayerEntity.base, -ptr[0], -ptr[1]), 1);
}
return vvv;
return actTile;
}
+1 -1
View File
@@ -38,7 +38,7 @@ void Well_Init(WellEntity* this) {
}
void Well_Action1(WellEntity* this) {
u32 tileIndex = GetTileType(this->unk_80, LAYER_BOTTOM);
u32 tileIndex = GetTileTypeAtTilePos(this->unk_80, LAYER_BOTTOM);
if (tileIndex != SPECIAL_TILE_125) {
PausePlayer();
gPlayerEntity.base.x.WORD = super->x.WORD;