Rename metaTiles

Now the 16x16 tiles are just called tiles and the 8x8 tiles are called subTiles.
This commit is contained in:
octorock
2024-01-06 14:59:48 +01:00
parent c3b771a209
commit aced0bef69
195 changed files with 9739 additions and 9736 deletions
+9 -9
View File
@@ -403,18 +403,18 @@ void sub_080307D4(ArmosEntity* this) {
}
void sub_080307EC(ArmosEntity* this) {
u32 metaTilePos = COORD_TO_TILE(super);
this->unk_78 = GetMetaTileIndex(metaTilePos, super->collisionLayer);
SetMetaTile(SPECIAL_META_TILE_34, metaTilePos, (u32)super->collisionLayer);
u32 tilePos = COORD_TO_TILE(super);
this->unk_78 = GetTileIndex(tilePos, super->collisionLayer);
SetTile(SPECIAL_TILE_34, tilePos, (u32)super->collisionLayer);
}
void sub_08030834(ArmosEntity* this) {
SetMetaTile(this->unk_78, COORD_TO_TILE(super), super->collisionLayer);
SetTile(this->unk_78, COORD_TO_TILE(super), super->collisionLayer);
}
bool32 sub_0803086C(ArmosEntity* this) {
u32 uVar2;
u32 metaTilePos;
u32 tilePos;
u16 centerY;
u16 centerX;
FORCE_REGISTER(u32 r2, r2);
@@ -424,10 +424,10 @@ bool32 sub_0803086C(ArmosEntity* this) {
centerX = super->x.HALF_U.HI - gRoomControls.origin_x;
centerY = super->y.HALF_U.HI - gRoomControls.origin_y;
// TODO for some reason the 0x3f of COORD_TO_TILE(super) needs to be forced to r2 here.
metaTilePos = ((((((super)->x.HALF.HI) - gRoomControls.origin_x) >> 4) & (r2 = 0x3f)) |
tilePos = ((((((super)->x.HALF.HI) - gRoomControls.origin_x) >> 4) & (r2 = 0x3f)) |
(((((super)->y.HALF.HI) - gRoomControls.origin_y) >> 4) & r2) << 6);
if (GetMetaTileType(metaTilePos, super->collisionLayer) == SPECIAL_META_TILE_73) {
if (GetTileType(tilePos, super->collisionLayer) == SPECIAL_TILE_73) {
if (CheckPlayerInRegion(centerX, centerY, 2, 0xc) != 0) {
if (CheckPlayerInRegion(centerX, centerY - 4, 2, 4) != 0) {
gPlayerEntity.base.spritePriority.b0 = 3;
@@ -436,11 +436,11 @@ bool32 sub_0803086C(ArmosEntity* this) {
return TRUE;
}
} else {
SetMetaTile(SPECIAL_META_TILE_34, metaTilePos, super->collisionLayer);
SetTile(SPECIAL_TILE_34, tilePos, super->collisionLayer);
}
} else {
if (CheckPlayerInRegion(centerX, centerY + 6, 2, 5) != 0) {
SetMetaTile(SPECIAL_META_TILE_73, COORD_TO_TILE(super), super->collisionLayer);
SetTile(SPECIAL_TILE_73, COORD_TO_TILE(super), super->collisionLayer);
}
}
}
+2 -2
View File
@@ -212,7 +212,7 @@ void sub_0802AAC0(BombPeahatEntity* this) {
super->child = NULL;
#ifdef EU
} else if (entity->timer == 0) {
if (GetCollisionDataAtMetaTilePos(COORD_TO_TILE(super), 1) == 0) {
if (GetCollisionDataAtTilePos(COORD_TO_TILE(super), 1) == 0) {
if (EntityInRectRadius(super, &gPlayerEntity.base, 0x10, 0x10) && entity->subtimer <= 0x50) {
this->unk_81 = 0;
}
@@ -685,7 +685,7 @@ void sub_0802B204(BombPeahatEntity* this) {
bool32 sub_0802B234(BombPeahatEntity* this) {
bool32 ret = FALSE;
if (GetMetaTileTypeByEntity(super) - 0x1c4 > 1)
if (GetTileTypeByEntity(super) - 0x1c4 > 1)
ret = TRUE;
return ret;
}
+3 -3
View File
@@ -105,7 +105,7 @@ void BusinessScrub_Action0(BusinessScrubEntity* this) {
} else {
super->timer = 0;
this->unk_76 = COORD_TO_TILE(super);
this->unk_74 = GetMetaTileIndex(this->unk_76, super->collisionLayer);
this->unk_74 = GetTileIndex(this->unk_76, super->collisionLayer);
super->hurtType = 0x41;
sub_08028FFC(this);
}
@@ -444,7 +444,7 @@ void sub_08028FFC(BusinessScrubEntity* this) {
super->x.HALF.HI = this->unk_78;
super->y.HALF.HI = this->unk_7a;
InitializeAnimation(super, 0);
SetMetaTile(SPECIAL_META_TILE_34, this->unk_76, super->collisionLayer);
SetTile(SPECIAL_TILE_34, this->unk_76, super->collisionLayer);
}
void sub_08029078(BusinessScrubEntity* this) {
@@ -458,7 +458,7 @@ void sub_08029078(BusinessScrubEntity* this) {
super->spriteIndex = 0xd0;
sub_08028FDC(this);
sub_080290E0(this, 1);
SetMetaTile(this->unk_74, this->unk_76, super->collisionLayer);
SetTile(this->unk_74, this->unk_76, super->collisionLayer);
}
}
+1 -1
View File
@@ -562,7 +562,7 @@ void sub_080262A8(ChuchuBossEntity* this) {
gPlayerEntity.base.animationState = 0;
gRoomControls.camera_target = super;
gRoomControls.scrollSpeed = 1;
SetMetaTile(SPECIAL_META_TILE_34, TILE_POS(8, 11), LAYER_BOTTOM);
SetTile(SPECIAL_TILE_34, TILE_POS(8, 11), LAYER_BOTTOM);
}
}
+1 -1
View File
@@ -243,7 +243,7 @@ void sub_080387F0(CloudPiranhaEntity* this) {
const s8* ptr;
if ((super->action != 4) && (this->unk_82 == 0)) {
collisionData = GetCollisionDataAtMetaTilePos(COORD_TO_TILE(super), super->collisionLayer);
collisionData = GetCollisionDataAtTilePos(COORD_TO_TILE(super), super->collisionLayer);
if ((collisionData == COLLISION_DATA_15) || (collisionData == COLLISION_DATA_42)) {
this->unk_82 = 0x20;
}
+7 -7
View File
@@ -49,7 +49,7 @@ void DoorMimic_OnCollision(DoorMimicEntity* this) {
}
void DoorMimic_OnDeath(DoorMimicEntity* this) {
SetMetaTile(this->unk_7c, this->unk_7e, super->collisionLayer);
SetTile(this->unk_7c, this->unk_7e, super->collisionLayer);
CreateFx(super, FX_POT_SHATTER, 0);
EnemyDisableRespawn(super);
DeleteThisEntity();
@@ -125,8 +125,8 @@ void sub_08022198(DoorMimicEntity* this) {
void sub_080221C0(DoorMimicEntity* this) {
u32 tilePos = COORD_TO_TILE(super) + gUnk_080B4488[super->type2];
this->unk_7e = tilePos;
this->unk_7c = GetMetaTileIndex(tilePos, super->collisionLayer);
SetMetaTile(gUnk_080CB79C[super->type2], tilePos, super->collisionLayer);
this->unk_7c = GetTileIndex(tilePos, super->collisionLayer);
SetTile(gUnk_080CB79C[super->type2], tilePos, super->collisionLayer);
}
// clang-format off
@@ -191,10 +191,10 @@ const PosOffset gUnk_080CB76C[][6] = {
};
const u16 gUnk_080CB79C[] = {
SPECIAL_META_TILE_35,
SPECIAL_META_TILE_37,
SPECIAL_META_TILE_38,
SPECIAL_META_TILE_36,
SPECIAL_TILE_35,
SPECIAL_TILE_37,
SPECIAL_TILE_38,
SPECIAL_TILE_36,
};
+8 -8
View File
@@ -86,10 +86,10 @@ void Enemy64_Init(Enemy64Entity* this) {
Entity* tail;
if (CheckFlags(0x7c)) {
SetMetaTile(SPECIAL_META_TILE_129, TILE_POS(10, 0), LAYER_TOP);
SetMetaTile(SPECIAL_META_TILE_129, TILE_POS(10, 1), LAYER_TOP);
SetMetaTile(SPECIAL_META_TILE_129, TILE_POS(10, 2), LAYER_TOP);
SetMetaTile(SPECIAL_META_TILE_129, TILE_POS(10, 3), LAYER_TOP);
SetTile(SPECIAL_TILE_129, TILE_POS(10, 0), LAYER_TOP);
SetTile(SPECIAL_TILE_129, TILE_POS(10, 1), LAYER_TOP);
SetTile(SPECIAL_TILE_129, TILE_POS(10, 2), LAYER_TOP);
SetTile(SPECIAL_TILE_129, TILE_POS(10, 3), LAYER_TOP);
DeleteThisEntity();
} else {
sub_0807B7D8(0x323, TILE_POS(10, 0), LAYER_BOTTOM);
@@ -441,19 +441,19 @@ void Enemy64_Action4_SubAction7(Enemy64Entity* this) {
DeleteThisEntity();
} else if (super->timer == 16) {
sub_0807B7D8(0x36, TILE_POS(10, 3), LAYER_BOTTOM);
SetMetaTile(SPECIAL_META_TILE_129, TILE_POS(10, 3), LAYER_TOP);
SetTile(SPECIAL_TILE_129, TILE_POS(10, 3), LAYER_TOP);
SoundReq(SFX_HEART_GET);
} else if (super->timer == 24) {
sub_0807B7D8(0x36, TILE_POS(10, 2), LAYER_BOTTOM);
SetMetaTile(SPECIAL_META_TILE_129, TILE_POS(10, 2), LAYER_TOP);
SetTile(SPECIAL_TILE_129, TILE_POS(10, 2), LAYER_TOP);
SoundReq(SFX_HEART_GET);
} else if (super->timer == 32) {
sub_0807B7D8(0x36, TILE_POS(10, 1), LAYER_BOTTOM);
SetMetaTile(SPECIAL_META_TILE_129, TILE_POS(10, 1), LAYER_TOP);
SetTile(SPECIAL_TILE_129, TILE_POS(10, 1), LAYER_TOP);
SoundReq(SFX_HEART_GET);
} else if (super->timer == 40) {
sub_0807B7D8(0x36, TILE_POS(10, 0), LAYER_BOTTOM);
SetMetaTile(SPECIAL_META_TILE_129, TILE_POS(10, 0), LAYER_TOP);
SetTile(SPECIAL_TILE_129, TILE_POS(10, 0), LAYER_TOP);
SoundReq(SFX_HEART_GET);
}
}
+19 -19
View File
@@ -34,7 +34,7 @@ typedef struct {
extern Entity* sub_08017A90(Entity*, Entity*);
extern Entity* gUnk_020000B0;
extern const u8 gMapMetaTileTypeToCollisionData[];
extern const u8 gMapTileTypeToCollisionData[];
void sub_08031344(EyegoreEntity*);
void sub_08031344(EyegoreEntity*);
@@ -327,27 +327,27 @@ void sub_08030E80(EyegoreEntity* this) {
}
void sub_08030F00(EyegoreEntity* this) {
u32 metaTilePos = COORD_TO_TILE_OFFSET(super, 8, 20);
u16 tileIndex = GetMetaTileIndex(metaTilePos + TILE_POS(0, 0), super->collisionLayer);
u32 tilePos = COORD_TO_TILE_OFFSET(super, 8, 20);
u16 tileIndex = GetTileIndex(tilePos + TILE_POS(0, 0), super->collisionLayer);
this->tileIndex1 = tileIndex;
tileIndex = GetMetaTileIndex(metaTilePos + TILE_POS(1, 0), super->collisionLayer);
tileIndex = GetTileIndex(tilePos + TILE_POS(1, 0), super->collisionLayer);
this->tileIndex2 = tileIndex;
tileIndex = GetMetaTileIndex(metaTilePos + TILE_POS(0, 1), super->collisionLayer);
tileIndex = GetTileIndex(tilePos + TILE_POS(0, 1), super->collisionLayer);
this->tileIndex3 = tileIndex;
tileIndex = GetMetaTileIndex(metaTilePos + TILE_POS(1, 1), super->collisionLayer);
tileIndex = GetTileIndex(tilePos + TILE_POS(1, 1), super->collisionLayer);
this->tileIndex4 = tileIndex;
SetMetaTile(SPECIAL_META_TILE_34, metaTilePos, super->collisionLayer);
SetMetaTile(SPECIAL_META_TILE_34, metaTilePos + 1, super->collisionLayer);
SetMetaTile(SPECIAL_META_TILE_34, metaTilePos + TILE_POS(0, 1), super->collisionLayer);
SetMetaTile(SPECIAL_META_TILE_34, metaTilePos + TILE_POS(1, 1), super->collisionLayer);
SetTile(SPECIAL_TILE_34, tilePos, super->collisionLayer);
SetTile(SPECIAL_TILE_34, tilePos + 1, super->collisionLayer);
SetTile(SPECIAL_TILE_34, tilePos + TILE_POS(0, 1), super->collisionLayer);
SetTile(SPECIAL_TILE_34, tilePos + TILE_POS(1, 1), super->collisionLayer);
}
void sub_08030FB4(EyegoreEntity* this) {
u32 metaTilePos = COORD_TO_TILE_OFFSET(super, 8, 20);
SetMetaTile(this->tileIndex1, metaTilePos + TILE_POS(0, 0), super->collisionLayer);
SetMetaTile(this->tileIndex2, metaTilePos + TILE_POS(1, 0), super->collisionLayer);
SetMetaTile(this->tileIndex3, metaTilePos + TILE_POS(0, 1), super->collisionLayer);
SetMetaTile(this->tileIndex4, metaTilePos + TILE_POS(1, 1), super->collisionLayer);
u32 tilePos = COORD_TO_TILE_OFFSET(super, 8, 20);
SetTile(this->tileIndex1, tilePos + TILE_POS(0, 0), super->collisionLayer);
SetTile(this->tileIndex2, tilePos + TILE_POS(1, 0), super->collisionLayer);
SetTile(this->tileIndex3, tilePos + TILE_POS(0, 1), super->collisionLayer);
SetTile(this->tileIndex4, tilePos + TILE_POS(1, 1), super->collisionLayer);
}
void sub_08031024(EyegoreEntity* this) {
@@ -400,12 +400,12 @@ void sub_08031024(EyegoreEntity* this) {
}
} else {
tmp2 = this->unk_7b >> 1;
uVar5 = GetMetaTileTypeByPos(super->x.HALF.HI + gUnk_080CE2C0[tmp2],
uVar5 = GetTileTypeByPos(super->x.HALF.HI + gUnk_080CE2C0[tmp2],
super->y.HALF.HI + gUnk_080CE2C0[tmp2 + 1], super->collisionLayer);
uVar8 = GetMetaTileTypeByPos(super->x.HALF.HI + gUnk_080CE2C0[tmp2 + 2],
uVar8 = GetTileTypeByPos(super->x.HALF.HI + gUnk_080CE2C0[tmp2 + 2],
super->y.HALF.HI + gUnk_080CE2C0[tmp2 + 3], super->collisionLayer);
if (!(((gMapMetaTileTypeToCollisionData[uVar5] == 0) &&
(gMapMetaTileTypeToCollisionData[uVar8] == 0)) ||
if (!(((gMapTileTypeToCollisionData[uVar5] == 0) &&
(gMapTileTypeToCollisionData[uVar8] == 0)) ||
((this->unk_7b | 1) & 1) == 0)) {
if (super->direction >> 3 == super->animationState) {
this->unk_78 |= 0x20;
+1 -1
View File
@@ -151,7 +151,7 @@ void sub_0802C4B0(FallingBoulderEntity* this) {
u32 index;
u32 rand;
switch (GetMetaTileIndex(this->unk_7e, super->collisionLayer)) {
switch (GetTileIndex(this->unk_7e, super->collisionLayer)) {
case 0x1ab ... 0x1af:
offset = 8;
break;
+11 -11
View File
@@ -100,7 +100,7 @@ void FlyingPot_OnCollision(FlyingPotEntity* this) {
super->zVelocity = Q_16_16(2.625);
super->spritePriority.b1 = 1;
SetMetaTile(this->tileIndex, TILE(super->x.HALF.HI, super->y.HALF.HI), super->collisionLayer);
SetTile(this->tileIndex, TILE(super->x.HALF.HI, super->y.HALF.HI), super->collisionLayer);
} else if (super->z.HALF.HI != 0) {
sub_08037408(this);
}
@@ -146,7 +146,7 @@ void FlyingPot_SubAction2(FlyingPotEntity* this) {
COLLISION_OFF(super);
super->spriteOffsetX = 0;
SetMetaTile(this->tileIndex, TILE(super->x.HALF.HI, super->y.HALF.HI), super->collisionLayer);
SetTile(this->tileIndex, TILE(super->x.HALF.HI, super->y.HALF.HI), super->collisionLayer);
}
if (sub_0806F520(super)) {
@@ -170,23 +170,23 @@ void FlyingPot_SubAction5(FlyingPotEntity* this) {
}
void FlyingPot_Init(FlyingPotEntity* this) {
u32 tile;
u32 tilePos;
super->action = FLYING_POT_ACTION_1;
super->gustJarFlags = 2;
super->y.HALF.HI += 3;
tile = TILE(super->x.HALF.HI, super->y.HALF.HI);
this->tileIndex = GetMetaTileIndex(tile, super->collisionLayer);
SetMetaTile(SPECIAL_META_TILE_0, tile, super->collisionLayer);
tilePos = TILE(super->x.HALF.HI, super->y.HALF.HI);
this->tileIndex = GetTileIndex(tilePos, super->collisionLayer);
SetTile(SPECIAL_TILE_0, tilePos, super->collisionLayer);
InitializeAnimation(super, 5);
}
void FlyingPot_Action1(FlyingPotEntity* this) {
sub_08037418(this);
if (GetMetaTileTypeByEntity(super) != SPECIAL_META_TILE_0) {
SetMetaTile(this->tileIndex, TILE(super->x.HALF.HI, super->y.HALF.HI), super->collisionLayer);
if (GetTileTypeByEntity(super) != SPECIAL_TILE_0) {
SetTile(this->tileIndex, TILE(super->x.HALF.HI, super->y.HALF.HI), super->collisionLayer);
sub_08037408(this);
}
@@ -211,7 +211,7 @@ void FlyingPot_Action2(FlyingPotEntity* this) {
super->collisionMask = 0xF;
super->hitbox = &gUnk_080FD34C;
SetMetaTile(this->tileIndex, TILE(super->x.HALF.HI, super->y.HALF.HI), super->collisionLayer);
SetTile(this->tileIndex, TILE(super->x.HALF.HI, super->y.HALF.HI), super->collisionLayer);
}
}
@@ -257,8 +257,8 @@ void sub_08037408(FlyingPotEntity* this) {
void sub_08037418(FlyingPotEntity* this) {
u32 tilePos = COORD_TO_TILE(super);
if (GetMetaTileIndex(tilePos, super->collisionLayer) == SPECIAL_META_TILE_103) {
SetMetaTile(this->tileIndex, tilePos, super->collisionLayer);
if (GetTileIndex(tilePos, super->collisionLayer) == SPECIAL_TILE_103) {
SetTile(this->tileIndex, tilePos, super->collisionLayer);
DeleteThisEntity();
}
}
+12 -12
View File
@@ -14,7 +14,7 @@
typedef struct {
Entity base;
u8 filler[0xc];
u16 metaTileIndex;
u16 tileIndex;
u8 unk_0x76;
} FlyingSkullEntity;
@@ -51,7 +51,7 @@ void FlyingSkull_OnCollision(FlyingSkullEntity* this) {
COLLISION_OFF(super);
super->zVelocity = Q_16_16(2.625);
super->spritePriority.b1 = 1;
SetMetaTile(this->metaTileIndex, COORD_TO_TILE(super), super->collisionLayer);
SetTile(this->tileIndex, COORD_TO_TILE(super), super->collisionLayer);
} else if (super->z.HALF.HI) {
sub_0803A0E0(this);
}
@@ -90,7 +90,7 @@ void sub_08039CE0(FlyingSkullEntity* this) {
super->timer = 1;
super->z.HALF.HI = -1;
super->spriteOffsetX = 0;
SetMetaTile(this->metaTileIndex, COORD_TO_TILE(super), super->collisionLayer);
SetTile(this->tileIndex, COORD_TO_TILE(super), super->collisionLayer);
}
if (sub_0806F520(super)) {
@@ -121,8 +121,8 @@ void sub_08039D74(FlyingSkullEntity* this) {
super->y.HALF.HI += 3;
tilePos = COORD_TO_TILE(super);
this->metaTileIndex = GetMetaTileIndex(tilePos, super->collisionLayer);
SetMetaTile(SPECIAL_META_TILE_96, tilePos, super->collisionLayer);
this->tileIndex = GetTileIndex(tilePos, super->collisionLayer);
SetTile(SPECIAL_TILE_96, tilePos, super->collisionLayer);
InitializeAnimation(super, 0);
}
@@ -130,8 +130,8 @@ void sub_08039DD8(FlyingSkullEntity* this) {
sub_0803A100(this);
if (super->type == 0) {
if (GetMetaTileTypeByEntity(super) == SPECIAL_META_TILE_115) {
SetMetaTile(this->metaTileIndex, COORD_TO_TILE(super), super->collisionLayer);
if (GetTileTypeByEntity(super) == SPECIAL_TILE_115) {
SetTile(this->tileIndex, COORD_TO_TILE(super), super->collisionLayer);
sub_0803A0E0(this);
}
@@ -148,7 +148,7 @@ void sub_08039DD8(FlyingSkullEntity* this) {
if (player != NULL) {
player->type2 = 1;
CopyPosition(super, player);
SetMetaTile(this->metaTileIndex, COORD_TO_TILE(super), super->collisionLayer);
SetTile(this->tileIndex, COORD_TO_TILE(super), super->collisionLayer);
DeleteEntity(super);
}
}
@@ -168,7 +168,7 @@ void sub_08039EE4(FlyingSkullEntity* this) {
super->hitbox = (Hitbox*)&gUnk_080FD340;
gPlayerEntity.base.animationState;
this->unk_0x76 = gPlayerEntity.base.animationState;
SetMetaTile(this->metaTileIndex, COORD_TO_TILE(super), super->collisionLayer);
SetTile(this->tileIndex, COORD_TO_TILE(super), super->collisionLayer);
}
void sub_08039F4C(FlyingSkullEntity* this) {
@@ -201,7 +201,7 @@ void sub_08039FAC(FlyingSkullEntity* this) {
super->hitType = 0xa0;
super->collisionMask = 0xf;
super->hitbox = (Hitbox*)&gUnk_080FD34C;
SetMetaTile(this->metaTileIndex, COORD_TO_TILE(super), super->collisionLayer);
SetTile(this->tileIndex, COORD_TO_TILE(super), super->collisionLayer);
}
}
@@ -249,8 +249,8 @@ void sub_0803A0E0(FlyingSkullEntity* this) {
void sub_0803A100(FlyingSkullEntity* this) {
u32 tilePos = COORD_TO_TILE(super);
if (GetMetaTileIndex(tilePos, super->collisionLayer) == SPECIAL_META_TILE_103) {
SetMetaTile(this->metaTileIndex, tilePos, super->collisionLayer);
if (GetTileIndex(tilePos, super->collisionLayer) == SPECIAL_TILE_103) {
SetTile(this->tileIndex, tilePos, super->collisionLayer);
DeleteThisEntity();
}
}
+4 -4
View File
@@ -33,7 +33,7 @@ void sub_08046518(void);
void sub_080467DC(GyorgFemaleEntity*);
extern u8 gUpdateVisibleTiles;
extern u8 gMapMetaTileTypeToCollisionData[];
extern u8 gMapTileTypeToCollisionData[];
extern const MapDataDefinition gGyorgMapping0[];
extern const MapDataDefinition gGyorgMapping1[];
@@ -248,7 +248,7 @@ void sub_080464C0(GyorgFemaleEntity* this) {
#define sub_08046518_offset 0x658
void sub_08046518(void) {
u16* ptr = gMapTop.metatileTypes;
u16* ptr = gMapTop.tileTypes;
u16* sl = &gMapTop.mapData[sub_08046518_offset];
u16* stack1 = &gMapTop.mapDataOriginal[sub_08046518_offset];
u8* stack2 = &gMapTop.vvv[sub_08046518_offset];
@@ -260,8 +260,8 @@ void sub_08046518(void) {
u16 new_var;
stack1[j] = sl[j];
new_var = ptr[sl[j]];
stack2[j] = gMapMetaTileTypeToVvv[new_var];
r6[j] = gMapMetaTileTypeToCollisionData[new_var];
stack2[j] = gMapTileTypeToVvv[new_var];
r6[j] = gMapTileTypeToCollisionData[new_var];
}
sl += 0x40;
stack1 += 0x40;
+3 -3
View File
@@ -345,7 +345,7 @@ void sub_08029DE4(MadderpillarEntity* this) {
}
void sub_08029E0C(MadderpillarEntity* this) {
u32 tile;
u32 tilePos;
s32 uVar4;
s32 iVar3;
u32 i;
@@ -358,10 +358,10 @@ void sub_08029E0C(MadderpillarEntity* this) {
ptr = &gUnk_080CCDC8[uVar2];
uVar4 = (Random() & 1) * 2 - 1;
iVar3 = ((s32)Random() & 0xf) % 3;
tile = COORD_TO_TILE(super);
tilePos = COORD_TO_TILE(super);
for (i = 0; i < 3; i++) {
dir = ptr[iVar3];
if (GetCollisionDataAtMetaTilePos(gUnk_080B4488[dir >> 3] + tile, super->collisionLayer) == 0) {
if (GetCollisionDataAtTilePos(gUnk_080B4488[dir >> 3] + tilePos, super->collisionLayer) == 0) {
local_24 = dir;
if (super->direction - this->unk_74 != dir - super->direction)
break;
+4 -4
View File
@@ -97,7 +97,7 @@ void sub_08034CC4(MazaalMacroEntity* this) {
this->unk_78 = 0x4b0;
sub_08034F70(this);
InitializeAnimation(super, super->type);
SetMetaTile(SPECIAL_META_TILE_34, COORD_TO_TILE(super), super->collisionLayer);
SetTile(SPECIAL_TILE_34, COORD_TO_TILE(super), super->collisionLayer);
entity = CreateEnemy(MAZAAL_MACRO, 2);
if (entity != NULL) {
super->child = entity;
@@ -285,11 +285,11 @@ u32 sub_08035084(MazaalMacroEntity* this) {
}
void sub_08035120(MazaalMacroEntity* this) {
s32 tile;
s32 tilePos;
u32 i;
tile = COORD_TO_TILE(super);
tilePos = COORD_TO_TILE(super);
for (i = 0; i < 0x18; i++) {
sub_0807B600(tile + gUnk_080CEED8[i]);
sub_0807B600(tilePos + gUnk_080CEED8[i]);
}
}
+7 -7
View File
@@ -37,7 +37,7 @@ typedef struct {
} MoldwormEntity;
extern void SoundReqClipped(Entity*, u32);
extern bool32 sub_08023A38(u32 metaTileType);
extern bool32 sub_08023A38(u32 tileType);
void sub_08023990(MoldwormEntity*, u32, u32);
void sub_08023A88(MoldwormEntity*, u32);
@@ -186,7 +186,7 @@ void sub_08023288(MoldwormEntity* this) {
for (i = 0; i < 0x10; i++) {
u32 x = gPlayerEntity.base.x.HALF.HI + gUnk_080CBC70[idx + 0];
u32 y = gPlayerEntity.base.y.HALF.HI + gUnk_080CBC70[idx + 1];
if (sub_08023A38(GetMetaTileTypeByPos(x, y, gPlayerEntity.base.collisionLayer))) {
if (sub_08023A38(GetTileTypeByPos(x, y, gPlayerEntity.base.collisionLayer))) {
sub_08023990(this, x, y);
return;
}
@@ -221,7 +221,7 @@ void sub_08023398(MoldwormEntity* this) {
}
if (--this->unk_78.HWORD == 0) {
if (sub_08023A38(GetMetaTileTypeByEntity(super))) {
if (sub_08023A38(GetTileTypeByEntity(super))) {
super->action = 5;
this->unk_7f = 0;
COLLISION_OFF(super);
@@ -513,12 +513,12 @@ void sub_080239F0(MoldwormEntity* this) {
this->unk_87 = 0x88;
}
bool32 sub_08023A38(u32 metaTileType) {
if (metaTileType == META_TILE_TYPE_26 || metaTileType == META_TILE_TYPE_41) {
bool32 sub_08023A38(u32 tileType) {
if (tileType == TILE_TYPE_26 || tileType == TILE_TYPE_41) {
return TRUE;
} else {
metaTileType = gMapMetaTileTypeToVvv[metaTileType];
if (metaTileType == VVV_9 || metaTileType == VVV_11 || metaTileType == VVV_10 || metaTileType == VVV_12) {
tileType = gMapTileTypeToVvv[tileType];
if (tileType == VVV_9 || tileType == VVV_11 || tileType == VVV_10 || tileType == VVV_12) {
return TRUE;
} else {
return FALSE;
+2 -2
View File
@@ -352,7 +352,7 @@ void sub_080244E8(PestoEntity* this) {
switch (this->unk_80) {
case 0:
if (--super->timer == 0) {
if (GetCollisionDataAtMetaTilePos(COORD_TO_TILE(super), 1) == 0) {
if (GetCollisionDataAtTilePos(COORD_TO_TILE(super), 1) == 0) {
this->unk_80++;
this->unk_82++;
super->subtimer = 0;
@@ -446,7 +446,7 @@ void sub_080244E8(PestoEntity* this) {
super->timer = 12;
this->unk_83 &= ~0x80;
entity = super->child;
SetMetaTile(((PestoEntity*)entity)->unk_70, COORD_TO_TILE(entity), entity->collisionLayer);
SetTile(((PestoEntity*)entity)->unk_70, COORD_TO_TILE(entity), entity->collisionLayer);
DeleteEntity(entity);
super->z.HALF.HI -= 0xe;
this->unk_78 -= 0xe;
+23 -23
View File
@@ -22,10 +22,10 @@ typedef struct {
/*0x82*/ u8 unk_82;
/*0x83*/ u8 unused2[1];
/*0x84*/ u16 unk_84;
/*0x86*/ u16 unk_86;
/*0x86*/ u16 tilePos;
} PuffstoolEntity;
extern u8 gMapMetaTileTypeToCollisionData[];
extern u8 gMapTileTypeToCollisionData[];
bool32 sub_080258C4(PuffstoolEntity*);
void sub_08025B18(PuffstoolEntity*);
@@ -183,7 +183,7 @@ void sub_08025230(PuffstoolEntity* this) {
if (sub_0802571C(this)) {
super->action = 2;
super->timer = 240;
this->unk_86 = COORD_TO_TILE(super);
this->tilePos = COORD_TO_TILE(super);
}
} else {
this->unk_78--;
@@ -191,20 +191,20 @@ void sub_08025230(PuffstoolEntity* this) {
}
void sub_080252E0(PuffstoolEntity* this) {
u32 tile;
u32 tilePos;
super->direction = CalculateDirectionTo(super->x.HALF.HI, super->y.HALF.HI, this->unk_7c, this->unk_7e);
sub_08025C44(this);
GetNextFrame(super);
tile = COORD_TO_TILE(super);
if (tile == this->unk_86) {
tilePos = COORD_TO_TILE(super);
if (tilePos == this->tilePos) {
if (--super->timer == 0) {
sub_080256B4(this);
}
} else {
this->unk_86 = tile;
this->tilePos = tilePos;
super->timer = 240;
}
@@ -428,27 +428,27 @@ bool32 sub_0802571C(PuffstoolEntity* this) {
}
bool32 sub_080257EC(PuffstoolEntity* this, u32 x, u32 y) {
u16 metaTileType = sub_080B1A48(x - 0x00, y - 0x00, super->collisionLayer);
if (metaTileType != 0x312 && gMapMetaTileTypeToVvv[metaTileType] != VVV_22 &&
gMapMetaTileTypeToCollisionData[metaTileType] == 0) {
u16 tileType = sub_080B1A48(x - 0x00, y - 0x00, super->collisionLayer);
if (tileType != 0x312 && gMapTileTypeToVvv[tileType] != VVV_22 &&
gMapTileTypeToCollisionData[tileType] == 0) {
return TRUE;
}
metaTileType = sub_080B1A48(x - 0x10, y - 0x00, super->collisionLayer);
if (metaTileType != 0x312 && gMapMetaTileTypeToVvv[metaTileType] != VVV_22 &&
gMapMetaTileTypeToCollisionData[metaTileType] == 0) {
tileType = sub_080B1A48(x - 0x10, y - 0x00, super->collisionLayer);
if (tileType != 0x312 && gMapTileTypeToVvv[tileType] != VVV_22 &&
gMapTileTypeToCollisionData[tileType] == 0) {
return TRUE;
}
metaTileType = sub_080B1A48(x - 0x00, y - 0x10, super->collisionLayer);
if (metaTileType != 0x312 && gMapMetaTileTypeToVvv[metaTileType] != VVV_22 &&
gMapMetaTileTypeToCollisionData[metaTileType] == 0) {
tileType = sub_080B1A48(x - 0x00, y - 0x10, super->collisionLayer);
if (tileType != 0x312 && gMapTileTypeToVvv[tileType] != VVV_22 &&
gMapTileTypeToCollisionData[tileType] == 0) {
return TRUE;
}
metaTileType = sub_080B1A48(x - 0x10, y - 0x10, super->collisionLayer);
if (metaTileType != 0x312 && gMapMetaTileTypeToVvv[metaTileType] != VVV_22 &&
gMapMetaTileTypeToCollisionData[metaTileType] == 0) {
tileType = sub_080B1A48(x - 0x10, y - 0x10, super->collisionLayer);
if (tileType != 0x312 && gMapTileTypeToVvv[tileType] != VVV_22 &&
gMapTileTypeToCollisionData[tileType] == 0) {
return TRUE;
}
@@ -528,12 +528,12 @@ void sub_08025A54(PuffstoolEntity* this) {
}
}
bool32 sub_08025AB8(u32 metaTilePos, u32 layer) {
if (GetCollisionDataAtMetaTilePos(metaTilePos, layer))
bool32 sub_08025AB8(u32 tilePos, u32 layer) {
if (GetCollisionDataAtTilePos(tilePos, layer))
return FALSE;
if (GetVvvAtMetaTilePos(metaTilePos, layer) == VVV_10) {
sub_0807B7D8(0x61, metaTilePos, layer);
if (GetVvvAtTilePos(tilePos, layer) == VVV_10) {
sub_0807B7D8(0x61, tilePos, layer);
return TRUE;
}
+2 -2
View File
@@ -267,7 +267,7 @@ void sub_08020A7C(RollobiteEntity* this) {
bool32 Rollobite_TryToHoleUp(RollobiteEntity* this) {
if (Rollobite_IsRolledUp(this) && super->z.HALF.HI == 0) {
u32 tilePos = COORD_TO_TILE(super);
u32 tileType = GetMetaTileType(tilePos, super->collisionLayer);
u32 tileType = GetTileType(tilePos, super->collisionLayer);
if ((tileType * 0x10000 - 0x710000U) >> 0x10 < 2) {
super->action = 6;
COLLISION_OFF(super);
@@ -277,7 +277,7 @@ bool32 Rollobite_TryToHoleUp(RollobiteEntity* this) {
super->y.HALF.HI += 13;
super->zVelocity = Q_16_16(2.0);
InitializeAnimation(super, super->animationState + 0x14);
SetMetaTile(SPECIAL_META_TILE_52, tilePos, super->collisionLayer);
SetTile(SPECIAL_TILE_52, tilePos, super->collisionLayer);
return TRUE;
}
}
+14 -14
View File
@@ -13,7 +13,7 @@
typedef struct {
Entity base;
u8 filler[0xc];
u16 tile;
u16 tilePos;
u16 tileIndex;
u8 unk_78;
u8 unk_79;
@@ -93,9 +93,9 @@ void SpinyBeetle_Init(SpinyBeetleEntity* this) {
this->unk_7a = 0;
this->unk_78 = 0;
this->unk_7b = 0;
this->tile = COORD_TO_TILE(super);
this->tileIndex = GetMetaTileIndex(this->tile, super->collisionLayer);
SetMetaTile(SPECIAL_META_TILE_34, this->tile, super->collisionLayer);
this->tilePos = COORD_TO_TILE(super);
this->tileIndex = GetTileIndex(this->tilePos, super->collisionLayer);
SetTile(SPECIAL_TILE_34, this->tilePos, super->collisionLayer);
obj = CreateObject(OBJECT_ON_BEETLE, super->type, 0);
if (obj == NULL) {
@@ -117,7 +117,7 @@ void sub_08033958(SpinyBeetleEntity* this) {
u32 direction;
if (sub_08033DF0(this)) {
sub_08033E1C(this);
SetMetaTileByIndex(this->tileIndex, this->tile, super->collisionLayer);
SetTileByIndex(this->tileIndex, this->tilePos, super->collisionLayer);
return;
}
@@ -166,7 +166,7 @@ void sub_08033958(SpinyBeetleEntity* this) {
COLLISION_ON(super);
super->y.WORD = (super->y.WORD & 0xfff00000) | 0xC0000;
SetMetaTileByIndex(this->tileIndex, this->tile, super->collisionLayer);
SetTileByIndex(this->tileIndex, this->tilePos, super->collisionLayer);
InitializeAnimation(super, 2);
}
@@ -237,10 +237,10 @@ void sub_08033B44(SpinyBeetleEntity* this) {
this->unk_80 = super->y.WORD;
super->spritePriority.b1 = 0;
this->unk_7b = 0x78;
this->tile = COORD_TO_TILE(super);
this->tileIndex = GetMetaTileIndex(this->tile, super->collisionLayer);
this->tilePos = COORD_TO_TILE(super);
this->tileIndex = GetTileIndex(this->tilePos, super->collisionLayer);
if (this->tileIndex != SPECIAL_META_TILE_34) {
if (this->tileIndex != SPECIAL_TILE_34) {
stop++;
} else {
switch (DirectionRound(super->direction) >> 2) {
@@ -260,7 +260,7 @@ void sub_08033B44(SpinyBeetleEntity* this) {
}
}
SetMetaTile(SPECIAL_META_TILE_34, this->tile, super->collisionLayer);
SetTile(SPECIAL_TILE_34, this->tilePos, super->collisionLayer);
InitializeAnimation(super, 0);
}
@@ -319,17 +319,17 @@ void sub_08033C94(SpinyBeetleEntity* this) {
void sub_08033D78(SpinyBeetleEntity* this) {
u32 dir = DirectionRound(super->direction) >> 2;
const s8* ptr = gUnk_080CEC1C + dir;
s32 tile;
s32 tilePos;
u32 type;
tile = COORD_TO_TILE_OFFSET(super, -ptr[0], -ptr[1]);
type = GetMetaTileType(tile, super->collisionLayer);
tilePos = COORD_TO_TILE_OFFSET(super, -ptr[0], -ptr[1]);
type = GetTileType(tilePos, super->collisionLayer);
switch (type) {
case 0x1c4:
case 0x1c5:
break;
default:
if (GetCollisionDataAtMetaTilePos(tile, super->collisionLayer) - 1 > 0x3e)
if (GetCollisionDataAtTilePos(tilePos, super->collisionLayer) - 1 > 0x3e)
ProcessMovement0(super);
break;
}
+2 -2
View File
@@ -438,7 +438,7 @@ void sub_08039AD4(StalfosEntity* this) {
super->action = 0xb;
super->child = projectile;
InitAnimationForceUpdate(super, super->animationState + 0x18);
SetMetaTile(SPECIAL_META_TILE_103, position, super->collisionLayer);
SetTile(SPECIAL_TILE_103, position, super->collisionLayer);
return;
}
}
@@ -456,7 +456,7 @@ u32 sub_08039B28(StalfosEntity* this) {
}
ptr2 = &gUnk_080CF930[super->animationState * 2];
pos = COORD_TO_TILE_OFFSET(super, -ptr2[0], -ptr2[1]);
tileType = GetMetaTileType(pos, (u32)super->collisionLayer);
tileType = GetTileType(pos, (u32)super->collisionLayer);
ptr = gUnk_080CF938;
do {
+4 -4
View File
@@ -14,7 +14,7 @@
typedef struct {
Entity base;
u8 filler[0xc];
u16 metaTilePos;
u16 tilePos;
u16 filler2;
u16 unk_78;
u16 projectileTimer;
@@ -46,7 +46,7 @@ void TorchTrap_Init(TorchTrapEntity* this) {
this->unk_84 &= 0xfff;
sub_0804A720(super);
super->action = 1;
this->metaTilePos = this->unk_82 & 0xfff;
this->tilePos = this->unk_82 & 0xfff;
super->x.HALF.HI = ((this->unk_82 & 0x3f) << 4) + 8 + gRoomControls.origin_x;
super->y.HALF.HI = ((this->unk_82 & 0xfc0) >> 2) + (gRoomControls.origin_y + 8);
super->direction = ((s16)this->unk_82 & 0xf000) >> 10;
@@ -76,7 +76,7 @@ void sub_0803CF38(TorchTrapEntity* this) {
}
void sub_0803CF94(TorchTrapEntity* this) {
if (GetMetaTileType(this->metaTilePos, super->collisionLayer) == META_TILE_TYPE_118) {
if (GetTileType(this->tilePos, super->collisionLayer) == TILE_TYPE_118) {
this->unk_80 = 0;
TorchTrap_Reset(this);
} else if (this->unk_7c && sub_0803CFD8(this)) {
@@ -141,7 +141,7 @@ void TorchTrap_CreateProjectile(TorchTrapEntity* this) {
void sub_0803D0B0(TorchTrapEntity* this) {
super->action = 3;
sub_0807B7D8(META_TILE_TYPE_117, this->metaTilePos, super->collisionLayer);
sub_0807B7D8(TILE_TYPE_117, this->tilePos, super->collisionLayer);
}
void (*const gTorchTrapActions[])(TorchTrapEntity*) = {
+1 -1
View File
@@ -241,7 +241,7 @@ void sub_0802EFB8(VaatiEyesMacroEntity* this) {
uVar1 = (uVar3 + 4) & 0x18;
}
collisionData =
GetCollisionDataAtMetaTilePos(TILE(super->x.HALF.HI, super->y.HALF.HI) + gUnk_080B4488[((uVar1) >> 3)], 1);
GetCollisionDataAtTilePos(TILE(super->x.HALF.HI, super->y.HALF.HI) + gUnk_080B4488[((uVar1) >> 3)], 1);
if (collisionData != 0) {
super->direction = DIR_NONE;
} else {
+3 -3
View File
@@ -282,8 +282,8 @@ bool32 sub_0803E4A0(VaatiProjectileEntity* this) {
}
void sub_0803E4D8(VaatiProjectileEntity* this) {
u32 metaTilePos = TILE(super->x.HALF.HI, super->y.HALF.HI + 8);
if (GetCollisionDataAtMetaTilePos(metaTilePos, gPlayerEntity.base.collisionLayer) != COLLISION_DATA_255) {
SetMetaTile(SPECIAL_META_TILE_116, metaTilePos, gPlayerEntity.base.collisionLayer);
u32 tilePos = TILE(super->x.HALF.HI, super->y.HALF.HI + 8);
if (GetCollisionDataAtTilePos(tilePos, gPlayerEntity.base.collisionLayer) != COLLISION_DATA_255) {
SetTile(SPECIAL_TILE_116, tilePos, gPlayerEntity.base.collisionLayer);
}
}
+2 -2
View File
@@ -26,7 +26,7 @@ void WizzrobeFire_OnCollision(WizzrobeEntity* this) {
}
EnemyFunctionHandlerAfterCollision(super, WizzrobeFire_Functions);
if (super->health == 0) {
SetMetaTile(this->tileIndex, this->tilePosition, super->collisionLayer);
SetTile(this->tileIndex, this->tilePos, super->collisionLayer);
}
}
@@ -111,7 +111,7 @@ void WizzrobeFire_Action2(WizzrobeEntity* this) {
super->timer = 40;
super->subtimer = 0;
super->flags &= ~0x80;
SetMetaTile(this->tileIndex, this->tilePosition, super->collisionLayer);
SetTile(this->tileIndex, this->tilePos, super->collisionLayer);
EnqueueSFX(SFX_156);
InitializeAnimation(super, super->direction >> 3);
}
+2 -2
View File
@@ -35,7 +35,7 @@ void WizzrobeIce_OnCollision(WizzrobeEntity* this) {
}
}
if (super->health == 0) {
SetMetaTile(this->tileIndex, this->tilePosition, super->collisionLayer);
SetTile(this->tileIndex, this->tilePos, super->collisionLayer);
}
}
@@ -118,7 +118,7 @@ void WizzrobeIce_Action2(WizzrobeEntity* this) {
super->timer = 40;
super->subtimer = 0;
super->flags &= ~0x80;
SetMetaTile(this->tileIndex, this->tilePosition, super->collisionLayer);
SetTile(this->tileIndex, this->tilePos, super->collisionLayer);
EnqueueSFX(SFX_156);
InitializeAnimation(super, super->direction >> 3);
}
+9 -9
View File
@@ -44,7 +44,7 @@ void WizzrobeWind_OnCollision(WizzrobeEntity* this) {
}
}
if (super->health == 0) {
SetMetaTile(this->tileIndex, this->tilePosition, super->collisionLayer);
SetTile(this->tileIndex, this->tilePos, super->collisionLayer);
}
}
@@ -137,7 +137,7 @@ void WizzrobeWind_Action2(WizzrobeEntity* this) {
super->subtimer = 0;
super->flags &= ~0x80;
EnqueueSFX(SFX_156);
SetMetaTile(this->tileIndex, this->tilePosition, super->collisionLayer);
SetTile(this->tileIndex, this->tilePos, super->collisionLayer);
InitializeAnimation(super, super->direction >> 3);
}
break;
@@ -208,15 +208,15 @@ void WizzrobeWind_Action3(WizzrobeEntity* this) {
void sub_0802F888(WizzrobeEntity* this) {
super->direction = (sub_08049F84(super, 3) + 4) & 0x18;
this->tilePosition = COORD_TO_TILE(super);
this->tileIndex = GetMetaTileIndex(this->tilePosition, super->collisionLayer);
SetMetaTile(SPECIAL_META_TILE_113, this->tilePosition, super->collisionLayer);
this->tilePos = COORD_TO_TILE(super);
this->tileIndex = GetTileIndex(this->tilePos, super->collisionLayer);
SetTile(SPECIAL_TILE_113, this->tilePos, super->collisionLayer);
}
void sub_0802F8E4(WizzrobeEntity* this) {
u16 uVar1;
s32 iVar4;
u32 metaTilePos;
u32 tilePos;
u32 uVar7;
u32 uVar8;
@@ -234,9 +234,9 @@ void sub_0802F8E4(WizzrobeEntity* this) {
uVar1 = this->unk_72;
iVar4 = ((s32)(rand)&0x7ff0) % (this->unk_6f << 3);
uVar7 = (uVar1 + iVar4) | 8;
metaTilePos = TILE(uVar8, uVar7);
if ((GetCollisionDataAtMetaTilePos(metaTilePos, super->collisionLayer) == 0) &&
(GetMetaTileIndex(metaTilePos, super->collisionLayer) != SPECIAL_META_TILE_113)) {
tilePos = TILE(uVar8, uVar7);
if ((GetCollisionDataAtTilePos(tilePos, super->collisionLayer) == 0) &&
(GetTileIndex(tilePos, super->collisionLayer) != SPECIAL_TILE_113)) {
super->x.HALF.HI = (s16)uVar8;
super->y.HALF.HI = (s16)uVar7;
if (sub_08049FA0(super) != 0) {