diff options
| author | octorock <79596758+octorock@users.noreply.github.com> | 2023-06-24 00:19:33 +0200 |
|---|---|---|
| committer | octorock <79596758+octorock@users.noreply.github.com> | 2023-06-24 00:19:33 +0200 |
| commit | f89bb66911372a067041b66d50ac8462b7e0bd97 (patch) | |
| tree | 5c7516fcf3e30a3aaf4e63c4a28a42e7c66f4471 /src/manager | |
| parent | f9da6344273ac86d6fd9219fac2710c968eeab37 (diff) | |
Create enums for Vvvs and MetaTiles
Diffstat (limited to 'src/manager')
| -rw-r--r-- | src/manager/bombableWallManager.c | 280 | ||||
| -rw-r--r-- | src/manager/destructibleTileObserveManager.c | 2 | ||||
| -rw-r--r-- | src/manager/diggingCaveEntranceManager.c | 6 | ||||
| -rw-r--r-- | src/manager/flameManager.c | 10 | ||||
| -rw-r--r-- | src/manager/holeManager.c | 1 | ||||
| -rw-r--r-- | src/manager/lightLevelSetManager.c | 19 | ||||
| -rw-r--r-- | src/manager/manager29.c | 10 | ||||
| -rw-r--r-- | src/manager/minishPortalManager.c | 3 | ||||
| -rw-r--r-- | src/manager/miscManager.c | 10 | ||||
| -rw-r--r-- | src/manager/railIntersectionManager.c | 2 | ||||
| -rw-r--r-- | src/manager/tilePuzzleManager.c | 2 | ||||
| -rw-r--r-- | src/manager/waterfallBottomManager.c | 2 |
12 files changed, 174 insertions, 173 deletions
diff --git a/src/manager/bombableWallManager.c b/src/manager/bombableWallManager.c index efb1af9f..b207e91c 100644 --- a/src/manager/bombableWallManager.c +++ b/src/manager/bombableWallManager.c @@ -11,19 +11,20 @@ #include "game.h" #include "object.h" #include "sound.h" +#include "tiles.h" -u32 sub_0805BFC4(u32, u32); -void sub_0805C02C(BombableWallManager*); +u32 BombableWallManager_GetBombableType(u32 metaTilePos, u32 layer); +void BombableWallManager_DestroyWall(BombableWallManager*); u32 getArchwayType(void); void BombableWallManager_Init(BombableWallManager*); void BombableWallManager_Action1(BombableWallManager*); void BombableWallManager_Action2(BombableWallManager*); -void sub_0805C050(u32, u32); -void sub_0805C178(u32, u32); -void sub_0805C294(u32, u32); -void sub_0805C3B4(u32, u32); -void sub_0805C4E0(u32, u32); +void BombableWallManager_DestroyWall0(u32, u32); +void BombableWallManager_DestroyWall1(u32, u32); +void BombableWallManager_DestroyWall2(u32, u32); +void BombableWallManager_DestroyWall3(u32, u32); +void BombableWallManager_DestroyWall4(u32, u32); void BombableWallManager_Main(BombableWallManager* this) { static void (*const BombableWallManager_Actions[])(BombableWallManager*) = { @@ -36,20 +37,20 @@ void BombableWallManager_Main(BombableWallManager* this) { void BombableWallManager_Init(BombableWallManager* this) { super->action = 1; - this->tile = (this->x >> 4 & 0x3fU) | (((this->y << 0x10) >> 0x14 & 0x3fU) << 6); - super->type = sub_0805BFC4(this->tile, this->field_0x35); - if (CheckLocalFlag(this->field_0x3e) != 0) { - sub_0805C02C(this); + this->metaTilePos = (this->x >> 4 & 0x3fU) | (((this->y << 0x10) >> 0x14 & 0x3fU) << 6); + super->type = BombableWallManager_GetBombableType(this->metaTilePos, this->layer); + if (CheckLocalFlag(this->flag) != 0) { + BombableWallManager_DestroyWall(this); DeleteManager(super); } } void BombableWallManager_Action1(BombableWallManager* this) { - if (GetVvvAtMetaTilePos(this->tile, this->field_0x35) != 0x2e) { + if (GetVvvAtMetaTilePos(this->metaTilePos, this->layer) != VVV_46) { super->action = 2; super->timer = 90; - sub_0805C02C(this); - SetLocalFlag(this->field_0x3e); + BombableWallManager_DestroyWall(this); + SetLocalFlag(this->flag); } } @@ -60,155 +61,154 @@ void BombableWallManager_Action2(BombableWallManager* this) { } } -u32 sub_0805BFC4(u32 pos, u32 layer) { - u32 tileType = GetTileType(pos, layer); +u32 BombableWallManager_GetBombableType(u32 metaTilePos, u32 layer) { + u32 metaTileType = GetMetaTileType(metaTilePos, layer); - switch (tileType) { - case 0xec: + switch (metaTileType) { + case META_TILE_TYPE_236: return 1; - case 0xbf: + case META_TILE_TYPE_191: return 4; - case 0xaf: + case META_TILE_TYPE_175: return 0; - case 0xcc: + case META_TILE_TYPE_204: return 2; - case 0xdf: + case META_TILE_TYPE_223: return 3; - case 0xff: + case META_TILE_TYPE_255: return 0; - case 0x115: + case META_TILE_TYPE_277: return 1; - case 0x108: + case META_TILE_TYPE_264: return 2; - case 0x110: + case META_TILE_TYPE_272: return 3; - case 0x105: + case META_TILE_TYPE_261: return 4; } return 0xff; } -void sub_0805C02C(BombableWallManager* this) { +void BombableWallManager_DestroyWall(BombableWallManager* this) { static void (*const gUnk_08108CE8[])(u32, u32) = { - sub_0805C050, sub_0805C178, sub_0805C294, sub_0805C3B4, sub_0805C4E0, + BombableWallManager_DestroyWall0, BombableWallManager_DestroyWall1, BombableWallManager_DestroyWall2, BombableWallManager_DestroyWall3, BombableWallManager_DestroyWall4, }; if (super->type != 0xff) { - gUnk_08108CE8[super->type](this->tile, this->field_0x35); + gUnk_08108CE8[super->type](this->metaTilePos, this->layer); } } -void sub_0805C050(u32 pos, u32 layer) { - SetTileType(0xb1, pos - 0x41, layer); - SetTileType(0xb2, pos - 0x40, layer); - SetTileType(0xb3, pos - 0x3f, layer); - SetTileType(0xb4, pos - 1, layer); - SetTileType(0xb7, pos + 1, layer); - if (layer == 1) { - if (AreaHasEnemies() != 0) { +void BombableWallManager_DestroyWall0(u32 metaTilePos, u32 layer) { + SetMetaTileType(META_TILE_TYPE_177, metaTilePos - 0x41, layer); + SetMetaTileType(META_TILE_TYPE_178, metaTilePos - 0x40, layer); + SetMetaTileType(META_TILE_TYPE_179, metaTilePos - 0x3f, layer); + SetMetaTileType(META_TILE_TYPE_180, metaTilePos - 1, layer); + SetMetaTileType(META_TILE_TYPE_183, metaTilePos + 1, layer); + if (layer == LAYER_BOTTOM) { + if (AreaHasEnemies()) { Entity* object = CreateObject(ARCHWAY, 0xe, 0); if (object != NULL) { - object->x.HALF.HI = ((pos & 0x3f) << 4) + 8 + gRoomControls.origin_x; - object->y.HALF.HI = ((pos & 0xfc0) >> 2) - 8 + gRoomControls.origin_y; + object->x.HALF.HI = ((metaTilePos & 0x3f) << 4) + 8 + gRoomControls.origin_x; + object->y.HALF.HI = ((metaTilePos & 0xfc0) >> 2) - 8 + gRoomControls.origin_y; } - SetTileType(0xb5, pos, 1); + SetMetaTileType(META_TILE_TYPE_181, metaTilePos, LAYER_BOTTOM); } else { - if (AreaIsDungeon() != 0) { - SetTileType(0xb5, pos, 1); + if (AreaIsDungeon()) { + SetMetaTileType(META_TILE_TYPE_181, metaTilePos, LAYER_BOTTOM); } else { - SetTileType(0xb6, pos, 1); + SetMetaTileType(META_TILE_TYPE_182, metaTilePos, LAYER_BOTTOM); } } - SetTileType(0xb8, pos - 0x41, 2); - SetTileType(0xb9, pos - 0x40, 2); - SetTileType(0xba, pos - 0x3f, 2); + SetMetaTileType(META_TILE_TYPE_184, metaTilePos - 0x41, LAYER_TOP); + SetMetaTileType(META_TILE_TYPE_185, metaTilePos - 0x40, LAYER_TOP); + SetMetaTileType(META_TILE_TYPE_186, metaTilePos - 0x3f, LAYER_TOP); } else { Entity* object; - SetTileType(0xb5, pos, 2); - if (AreaIsDungeon() == 0) { + SetMetaTileType(META_TILE_TYPE_181, metaTilePos, LAYER_TOP); + if (!AreaIsDungeon()) { return; } object = CreateObject(ARCHWAY, getArchwayType(), 6); if (object == NULL) { return; } - object->x.HALF.HI = ((pos & 0x3f) << 4) + 8 + gRoomControls.origin_x; - object->y.HALF.HI = ((pos & 0xfc0) >> 2) - 0x10 + gRoomControls.origin_y; - object->collisionLayer = 2; + object->x.HALF.HI = ((metaTilePos & 0x3f) << 4) + 8 + gRoomControls.origin_x; + object->y.HALF.HI = ((metaTilePos & 0xfc0) >> 2) - 0x10 + gRoomControls.origin_y; + object->collisionLayer = LAYER_TOP; } } -void sub_0805C178(u32 pos, u32 layer) { +void BombableWallManager_DestroyWall1(u32 metaTilePos, u32 layer) { Entity* object; - SetTileType(0xf1, pos - 0x40, layer); - SetTileType(0xf5, pos - 0x3f, layer); - SetTileType(0xf6, pos + 1, layer); - SetTileType(0xf4, pos + 0x40, layer); - SetTileType(0xf7, pos + 0x41, layer); - if (layer == 1) { - - if (AreaHasEnemies() != 0) { + SetMetaTileType(META_TILE_TYPE_241, metaTilePos - 0x40, layer); + SetMetaTileType(META_TILE_TYPE_245, metaTilePos - 0x3f, layer); + SetMetaTileType(META_TILE_TYPE_246, metaTilePos + 1, layer); + SetMetaTileType(META_TILE_TYPE_244, metaTilePos + 0x40, layer); + SetMetaTileType(META_TILE_TYPE_247, metaTilePos + 0x41, layer); + if (layer == LAYER_BOTTOM) { + if (AreaHasEnemies()) { object = CreateObject(ARCHWAY, 0xe, 1); if (object != NULL) { - object->x.HALF.HI = ((pos & 0x3f) << 4) + 0x18 + gRoomControls.origin_x; - object->y.HALF.HI = ((pos & 0xfc0) >> 2) + 8 + gRoomControls.origin_y; + object->x.HALF.HI = ((metaTilePos & 0x3f) << 4) + 0x18 + gRoomControls.origin_x; + object->y.HALF.HI = ((metaTilePos & 0xfc0) >> 2) + 8 + gRoomControls.origin_y; } - SetTileType(0xf2, pos, 1); + SetMetaTileType(META_TILE_TYPE_242, metaTilePos, LAYER_BOTTOM); } else { - if (AreaIsDungeon() != 0) { - SetTileType(0xf2, pos, 1); + if (AreaIsDungeon()) { + SetMetaTileType(META_TILE_TYPE_242, metaTilePos, LAYER_BOTTOM); } else { - SetTileType(0xf3, pos, 1); + SetMetaTileType(META_TILE_TYPE_243, metaTilePos, LAYER_BOTTOM); } } - SetTileType(0xf8, pos - 0x3f, 2); - SetTileType(0xf9, pos + 1, 2); - SetTileType(0xfa, pos + 0x41, 2); + SetMetaTileType(META_TILE_TYPE_248, metaTilePos - 0x3f, LAYER_TOP); + SetMetaTileType(META_TILE_TYPE_249, metaTilePos + 1, LAYER_TOP); + SetMetaTileType(META_TILE_TYPE_250, metaTilePos + 0x41, LAYER_TOP); } else { - SetTileType(0xf2, pos, 2); - if (AreaIsDungeon() == 0) { + SetMetaTileType(META_TILE_TYPE_242, metaTilePos, LAYER_TOP); + if (!AreaIsDungeon()) { return; } object = CreateObject(ARCHWAY, getArchwayType(), 7); if (object == NULL) { return; } - object->x.HALF.HI = ((pos & 0x3f) << 4) + 0x20 + gRoomControls.origin_x; - object->y.HALF.HI = ((pos & 0xfc0) >> 2) + 8 + gRoomControls.origin_y; - object->collisionLayer = 2; + object->x.HALF.HI = ((metaTilePos & 0x3f) << 4) + 0x20 + gRoomControls.origin_x; + object->y.HALF.HI = ((metaTilePos & 0xfc0) >> 2) + 8 + gRoomControls.origin_y; + object->collisionLayer = LAYER_TOP; } } -void sub_0805C294(u32 pos, u32 layer) { +void BombableWallManager_DestroyWall2(u32 metaTilePos, u32 layer) { Entity* object; - SetTileType(0xd1, pos - 1, layer); - SetTileType(0xd4, pos + 1, layer); - SetTileType(0xd5, pos + 0x3f, layer); - SetTileType(0xd6, pos + 0x40, layer); - SetTileType(0xd7, pos + 0x41, layer); - if (layer == 1) { - if (AreaHasEnemies() != 0) { + SetMetaTileType(META_TILE_TYPE_209, metaTilePos - 1, layer); + SetMetaTileType(META_TILE_TYPE_212, metaTilePos + 1, layer); + SetMetaTileType(META_TILE_TYPE_213, metaTilePos + 0x3f, layer); + SetMetaTileType(META_TILE_TYPE_214, metaTilePos + 0x40, layer); + SetMetaTileType(META_TILE_TYPE_215, metaTilePos + 0x41, layer); + if (layer == LAYER_BOTTOM) { + if (AreaHasEnemies()) { object = CreateObject(ARCHWAY, 0xe, 2); if (object != NULL) { - object->x.HALF.HI = ((pos & 0x3f) << 4) + 8 + gRoomControls.origin_x; - object->y.HALF.HI = ((pos & 0xfc0) >> 2) + 0x20 + gRoomControls.origin_y; + object->x.HALF.HI = ((metaTilePos & 0x3f) << 4) + 8 + gRoomControls.origin_x; + object->y.HALF.HI = ((metaTilePos & 0xfc0) >> 2) + 0x20 + gRoomControls.origin_y; } - SetTileType(0xd2, pos, 1); + SetMetaTileType(META_TILE_TYPE_210, metaTilePos, LAYER_BOTTOM); } else { - if (AreaIsDungeon() != 0) { - SetTileType(0xd2, pos, 1); + if (AreaIsDungeon()) { + SetMetaTileType(META_TILE_TYPE_210, metaTilePos, LAYER_BOTTOM); } else { - SetTileType(0xd3, pos, 1); + SetMetaTileType(META_TILE_TYPE_211, metaTilePos, LAYER_BOTTOM); } } - SetTileType(0xd8, pos + 0x3f, 2); - SetTileType(0xd9, pos + 0x40, 2); - SetTileType(0xda, pos + 0x41, 2); + SetMetaTileType(META_TILE_TYPE_216, metaTilePos + 0x3f, LAYER_TOP); + SetMetaTileType(META_TILE_TYPE_217, metaTilePos + 0x40, LAYER_TOP); + SetMetaTileType(META_TILE_TYPE_218, metaTilePos + 0x41, LAYER_TOP); } else { - SetTileType(0xd2, pos, 2); + SetMetaTileType(META_TILE_TYPE_210, metaTilePos, LAYER_TOP); if (AreaIsDungeon() == 0) { return; } @@ -216,41 +216,41 @@ void sub_0805C294(u32 pos, u32 layer) { if (object == NULL) { return; } - object->x.HALF.HI = ((pos & 0x3f) << 4) + 8 + gRoomControls.origin_x; - object->y.HALF.HI = ((pos & 0xfc0) >> 2) + 0x20 + gRoomControls.origin_y; - object->collisionLayer = 2; + object->x.HALF.HI = ((metaTilePos & 0x3f) << 4) + 8 + gRoomControls.origin_x; + object->y.HALF.HI = ((metaTilePos & 0xfc0) >> 2) + 0x20 + gRoomControls.origin_y; + object->collisionLayer = LAYER_TOP; } } -void sub_0805C3B4(u32 pos, u32 layer) { +void BombableWallManager_DestroyWall3(u32 metaTilePos, u32 layer) { Entity* object; - SetTileType(0xe1, pos - 0x41, layer); - SetTileType(0xe4, pos - 0x40, layer); - SetTileType(0xe2, pos - 1, layer); - SetTileType(0xe3, pos + 0x3f, layer); - SetTileType(0xe7, pos + 0x40, layer); - if (layer == 1) { - if (AreaHasEnemies() != 0) { + SetMetaTileType(META_TILE_TYPE_225, metaTilePos - 0x41, layer); + SetMetaTileType(META_TILE_TYPE_228, metaTilePos - 0x40, layer); + SetMetaTileType(META_TILE_TYPE_226, metaTilePos - 1, layer); + SetMetaTileType(META_TILE_TYPE_227, metaTilePos + 0x3f, layer); + SetMetaTileType(META_TILE_TYPE_231, metaTilePos + 0x40, layer); + if (layer == LAYER_BOTTOM) { + if (AreaHasEnemies()) { object = CreateObject(ARCHWAY, 0xe, 3); if (object != NULL) { - object->x.HALF.HI = ((pos & 0x3f) << 4) + -0x10 + gRoomControls.origin_x; - object->y.HALF.HI = ((pos & 0xfc0) >> 2) + 8 + gRoomControls.origin_y; + object->x.HALF.HI = ((metaTilePos & 0x3f) << 4) + -0x10 + gRoomControls.origin_x; + object->y.HALF.HI = ((metaTilePos & 0xfc0) >> 2) + 8 + gRoomControls.origin_y; } - SetTileType(0xe5, pos, 1); + SetMetaTileType(META_TILE_TYPE_229, metaTilePos, LAYER_BOTTOM); } else { - if (AreaIsDungeon() != 0) { - SetTileType(0xe5, pos, 1); + if (AreaIsDungeon()) { + SetMetaTileType(META_TILE_TYPE_229, metaTilePos, LAYER_BOTTOM); } else { - SetTileType(0xe6, pos, 1); + SetMetaTileType(META_TILE_TYPE_230, metaTilePos, LAYER_BOTTOM); } } - SetTileType(0xe8, pos - 0x41, 2); - SetTileType(0xe9, pos - 1, 2); - SetTileType(0xea, pos + 0x3f, 2); + SetMetaTileType(META_TILE_TYPE_232, metaTilePos - 0x41, LAYER_TOP); + SetMetaTileType(META_TILE_TYPE_233, metaTilePos - 1, LAYER_TOP); + SetMetaTileType(META_TILE_TYPE_234, metaTilePos + 0x3f, LAYER_TOP); } else { - SetTileType(0xe5, pos, 2); - if (AreaIsDungeon() == 0) { + SetMetaTileType(META_TILE_TYPE_229, metaTilePos, LAYER_TOP); + if (!AreaIsDungeon()) { return; } @@ -258,41 +258,41 @@ void sub_0805C3B4(u32 pos, u32 layer) { if (object == NULL) { return; } - object->x.HALF.HI = ((pos & 0x3f) << 4) + -0x10 + gRoomControls.origin_x; - object->y.HALF.HI = ((pos & 0xfc0) >> 2) + 8 + gRoomControls.origin_y; - object->collisionLayer = 2; + object->x.HALF.HI = ((metaTilePos & 0x3f) << 4) + -0x10 + gRoomControls.origin_x; + object->y.HALF.HI = ((metaTilePos & 0xfc0) >> 2) + 8 + gRoomControls.origin_y; + object->collisionLayer = LAYER_TOP; } } -void sub_0805C4E0(u32 pos, u32 layer) { +void BombableWallManager_DestroyWall4(u32 metaTilePos, u32 layer) { Entity* object; - SetTileType(0xc1, pos - 0x41, layer); - SetTileType(0xc2, pos - 0x40, layer); - SetTileType(0xc3, pos - 0x3f, layer); - SetTileType(0xc4, pos - 1, layer); - SetTileType(0xc7, pos + 1, layer); - if (layer == 1) { - if (AreaHasEnemies() != 0) { + SetMetaTileType(META_TILE_TYPE_193, metaTilePos - 0x41, layer); + SetMetaTileType(META_TILE_TYPE_194, metaTilePos - 0x40, layer); + SetMetaTileType(META_TILE_TYPE_195, metaTilePos - 0x3f, layer); + SetMetaTileType(META_TILE_TYPE_196, metaTilePos - 1, layer); + SetMetaTileType(META_TILE_TYPE_199, metaTilePos + 1, layer); + if (layer == LAYER_BOTTOM) { + if (AreaHasEnemies()) { object = CreateObject(ARCHWAY, 0xe, 0); if (object != NULL) { - object->x.HALF.HI = ((pos & 0x3f) << 4) + 8 + gRoomControls.origin_x; - object->y.HALF.HI = ((pos & 0xfc0) >> 2) + -0x10 + gRoomControls.origin_y; + object->x.HALF.HI = ((metaTilePos & 0x3f) << 4) + 8 + gRoomControls.origin_x; + object->y.HALF.HI = ((metaTilePos & 0xfc0) >> 2) + -0x10 + gRoomControls.origin_y; } - SetTileType(0xc5, pos, 1); + SetMetaTileType(META_TILE_TYPE_197, metaTilePos, LAYER_BOTTOM); } else { - if (AreaIsDungeon() != 0) { - SetTileType(0xc5, pos, 1); + if (AreaIsDungeon()) { + SetMetaTileType(META_TILE_TYPE_197, metaTilePos, LAYER_BOTTOM); } else { - SetTileType(0xc6, pos, 1); + SetMetaTileType(META_TILE_TYPE_198, metaTilePos, LAYER_BOTTOM); } } - SetTileType(0xc8, pos - 0x41, 2); - SetTileType(0xc9, pos - 0x40, 2); - SetTileType(0xca, pos - 0x3f, 2); + SetMetaTileType(META_TILE_TYPE_200, metaTilePos - 0x41, LAYER_TOP); + SetMetaTileType(META_TILE_TYPE_201, metaTilePos - 0x40, LAYER_TOP); + SetMetaTileType(META_TILE_TYPE_202, metaTilePos - 0x3f, LAYER_TOP); } else { - SetTileType(0xc5, pos, 2); - if (AreaIsDungeon() == 0) { + SetMetaTileType(META_TILE_TYPE_197, metaTilePos, LAYER_TOP); + if (!AreaIsDungeon()) { return; } @@ -300,9 +300,9 @@ void sub_0805C4E0(u32 pos, u32 layer) { if (object == NULL) { return; } - object->x.HALF.HI = ((pos & 0x3f) << 4) + 8 + gRoomControls.origin_x; - object->y.HALF.HI = ((pos & 0xfc0) >> 2) + -0x10 + gRoomControls.origin_y; - object->collisionLayer = 2; + object->x.HALF.HI = ((metaTilePos & 0x3f) << 4) + 8 + gRoomControls.origin_x; + object->y.HALF.HI = ((metaTilePos & 0xfc0) >> 2) + -0x10 + gRoomControls.origin_y; + object->collisionLayer = LAYER_TOP; } } diff --git a/src/manager/destructibleTileObserveManager.c b/src/manager/destructibleTileObserveManager.c index 81a8ef05..076d7b04 100644 --- a/src/manager/destructibleTileObserveManager.c +++ b/src/manager/destructibleTileObserveManager.c @@ -29,7 +29,7 @@ void DestructibleTileObserveManager_Main(DestructibleTileObserveManager* this) { void sub_0805CFF0(DestructibleTileObserveManager_unk* param_1) { if (!CheckLocalFlag(param_1->flag)) { - u32 tileType = GetTileType(param_1->tilePos, param_1->tileLayer); + u32 tileType = GetMetaTileType(param_1->tilePos, param_1->tileLayer); if (param_1->tileType == tileType) { SetLocalFlag(param_1->flag); } diff --git a/src/manager/diggingCaveEntranceManager.c b/src/manager/diggingCaveEntranceManager.c index 8df2d747..ac00ea52 100644 --- a/src/manager/diggingCaveEntranceManager.c +++ b/src/manager/diggingCaveEntranceManager.c @@ -53,9 +53,9 @@ void DiggingCaveEntranceManager_Init(DiggingCaveEntranceManager* this) { tile = 0x81 << 7; // 0x4080 for (entrance = GetDiggingCaveEntranceForRoom(entrance, room); entrance != 0; entrance = GetDiggingCaveEntranceForRoom(entrance, room)) { - SetTile(tile, entrance->sourceTilePosition + TILE_POS(-1, 1), 1); - SetTile(tile, entrance->sourceTilePosition + TILE_POS(0, 1), 1); - SetTile(tile, entrance->sourceTilePosition + TILE_POS(1, 1), 1); + SetMetaTile(tile, entrance->sourceTilePosition + TILE_POS(-1, 1), 1); + SetMetaTile(tile, entrance->sourceTilePosition + TILE_POS(0, 1), 1); + SetMetaTile(tile, entrance->sourceTilePosition + TILE_POS(1, 1), 1); entrance++; } } diff --git a/src/manager/flameManager.c b/src/manager/flameManager.c index 880324fd..35d20216 100644 --- a/src/manager/flameManager.c +++ b/src/manager/flameManager.c @@ -14,19 +14,19 @@ void FlameManager_Main(FlameManager* this) { if (super->action == 0) { this->field_0x38 = TILE(this->field_0x38, this->field_0x3a); - if (GetTileType(this->field_0x38, 2) == 0x75) { + if (GetMetaTileType(this->field_0x38, 2) == 0x75) { super->action = 1; - SetTile(0x406a, this->field_0x38, 1); + SetMetaTile(0x406a, this->field_0x38, 1); } else { DeleteThisEntity(); } } - if (GetTileType(this->field_0x38, 1) == 0x406b) { + if (GetMetaTileType(this->field_0x38, 1) == 0x406b) { sub_0807B7D8(0x76, this->field_0x38, 2); DeleteThisEntity(); } - if (GetTileType(this->field_0x38, 2) == 0x76) { - SetTile(0x406b, this->field_0x38, 1); + if (GetMetaTileType(this->field_0x38, 2) == 0x76) { + SetMetaTile(0x406b, this->field_0x38, 1); DeleteThisEntity(); } } diff --git a/src/manager/holeManager.c b/src/manager/holeManager.c index 563eee3b..c94155f5 100644 --- a/src/manager/holeManager.c +++ b/src/manager/holeManager.c @@ -14,7 +14,6 @@ extern void (*const HoleManager_Actions[])(HoleManager*); -extern u8 gGlobalGfxAndPalettes[]; void HoleManager_Main(HoleManager* this) { HoleManager_Actions[super->action](this); diff --git a/src/manager/lightLevelSetManager.c b/src/manager/lightLevelSetManager.c index c111e3f7..cbc8fd3c 100644 --- a/src/manager/lightLevelSetManager.c +++ b/src/manager/lightLevelSetManager.c @@ -10,6 +10,7 @@ #include "game.h" #include "object.h" #include "room.h" +#include "tiles.h" void sub_0805BE94(LightLevelSetManager*); void sub_0805BEC4(LightLevelSetManager*); @@ -17,7 +18,7 @@ void LightLevelSetManager_Type0(LightLevelSetManager*); void LightLevelSetManager_Type1(LightLevelSetManager*); void LightLevelSetManager_Type2(LightLevelSetManager*); void LightLevelSetManager_Type3(LightLevelSetManager*); -void sub_0805BE70(LightLevelSetManager*, u32); +void sub_0805BE70(LightLevelSetManager* this, u32 metaTileType); void LightLevelSetManager_Main(Manager* this) { static void (*const LightLevelSetManager_Types[])(LightLevelSetManager*) = { @@ -49,7 +50,7 @@ void LightLevelSetManager_Type1(LightLevelSetManager* this) { super->action = 1; super->subtimer = 30; if (CheckFlags(this->field_0x3e) != 0) { - sub_0805BE70(this, 0x75); + sub_0805BE70(this, META_TILE_TYPE_117); super->action = 2; } break; @@ -57,13 +58,13 @@ void LightLevelSetManager_Type1(LightLevelSetManager* this) { if (CheckFlags(this->field_0x3e) != 0 && --super->subtimer == 0) { super->subtimer = 30; sub_0805BEC4(this); - sub_0805BE70(this, 0x76); + sub_0805BE70(this, META_TILE_TYPE_118); } break; case 2: if (CheckFlags(this->field_0x3e) == 0 && --super->subtimer == 0) { super->subtimer = 30; - sub_0805BE70(this, 0x75); + sub_0805BE70(this, META_TILE_TYPE_117); } break; } @@ -78,7 +79,7 @@ void LightLevelSetManager_Type2(LightLevelSetManager* this) { ((s16)this->field_0x38 >> 4 & 0x3fU) | ((s32)((this->field_0x3a << 0x10) >> 0x14 & 0x3fU) << 6); super->action = 1; } else { - if (GetTileType(this->field_0x20, super->type2) == 0x76) { + if (GetMetaTileType(this->field_0x20, super->type2) == 0x76) { SetFlag(this->field_0x3e); ChangeLightLevel(super->timer); DeleteThisEntity(); @@ -102,7 +103,7 @@ void LightLevelSetManager_Type3(LightLevelSetManager* this) { break; case 1: - if (GetTileType(this->field_0x20, super->type2) != 0x76) { + if (GetMetaTileType(this->field_0x20, super->type2) != 0x76) { return; } SetFlag(this->field_0x3e); @@ -130,14 +131,14 @@ void LightLevelSetManager_Type3(LightLevelSetManager* this) { } } -void sub_0805BE70(LightLevelSetManager* this, u32 param_2) { - SetTileType(param_2, +void sub_0805BE70(LightLevelSetManager* this, u32 metaTileType) { + SetMetaTileType(metaTileType, ((this->field_0x38 << 0x10) >> 0x14 & 0x3fU) | ((this->field_0x3a << 0x10) >> 0x14 & 0x3fU) << 6, super->type2); } void sub_0805BE94(LightLevelSetManager* this) { - SetTileType(0x76, ((this->field_0x38 << 0x10) >> 0x14 & 0x3fU) | ((this->field_0x3a << 0x10) >> 0x14 & 0x3fU) << 6, + SetMetaTileType(META_TILE_TYPE_118, ((this->field_0x38 << 0x10) >> 0x14 & 0x3fU) | ((this->field_0x3a << 0x10) >> 0x14 & 0x3fU) << 6, super->type2); ChangeLightLevel(super->timer); DeleteThisEntity(); diff --git a/src/manager/manager29.c b/src/manager/manager29.c index 0b12fe46..f1dcce72 100644 --- a/src/manager/manager29.c +++ b/src/manager/manager29.c @@ -27,15 +27,15 @@ void Manager29_Main(Manager29* this) { } void sub_0805CBD0(Manager29* this) { - LayerStruct* layer; + MapLayer* mapLayer; super->action = 1; this->unk_38 = (this->unk_38 >> 4 & 0x3fU) | (((this->unk_3a << 0x10) >> 0x14 & 0x3fU) << 6); this->unk_3a = (this->unk_3c >> 4 & 0x3f) | (((this->unk_36 + this->unk_37 * 0x100) >> 4 & 0x3fU) << 6); - this->unk_3c = GetTileType(this->unk_38, this->layer); - layer = GetLayerByIndex(this->layer); - this->unk_28 = (u16*)layer->metatileTypes; - this->unk_2c = &layer->mapData[(s16)this->unk_3a]; + this->unk_3c = GetMetaTileType(this->unk_38, this->layer); + mapLayer = GetLayerByIndex(this->layer); + this->unk_28 = (u16*)mapLayer->metatileTypes; + this->unk_2c = &mapLayer->mapData[(s16)this->unk_3a]; } void sub_0805CC3C(Manager29* this) { diff --git a/src/manager/minishPortalManager.c b/src/manager/minishPortalManager.c index 2107d6ef..ea3ae958 100644 --- a/src/manager/minishPortalManager.c +++ b/src/manager/minishPortalManager.c @@ -13,6 +13,7 @@ #include "player.h" #include "room.h" #include "sound.h" +#include "tiles.h" bool32 PortalReadyForMinish(void); @@ -41,7 +42,7 @@ void MinishPortalManager_Main(MinishPortalManager* this) { gArea.portal_mode = 3; } } - if (GetVvvAtRoomCoords(this->unk_38, this->unk_3a, super->timer) == 0x3d) { + if (GetVvvAtRoomCoords(this->unk_38, this->unk_3a, super->timer) == VVV_61) { CreateMagicSparkles(this->unk_38 + gRoomControls.origin_x, this->unk_3a + gRoomControls.origin_y, super->timer); if (super->subtimer == 0) { diff --git a/src/manager/miscManager.c b/src/manager/miscManager.c index 86662f3b..68a034a0 100644 --- a/src/manager/miscManager.c +++ b/src/manager/miscManager.c @@ -123,7 +123,7 @@ void sub_08058F44(u32 x, u32 y, u32 flag) { return; if (sub_080B1A48(x, y, 1) != 0x61) return; - SetTileType(0x26, ((x >> 4) & 0x3F) | (((y >> 4) & 0x3F) << 6), 1); + SetMetaTileType(0x26, ((x >> 4) & 0x3F) | (((y >> 4) & 0x3F) << 6), 1); sub_08058F84(x, y); } @@ -240,7 +240,7 @@ void MiscManager_Type5(MiscManager* this) { DeleteThisEntity(); } super->action = 1; - SetTileType(0x365, TILE_LOCAL(this->x, this->y), super->type2); + SetMetaTileType(0x365, TILE_LOCAL(this->x, this->y), super->type2); break; case 1: if (CheckFlags(this->flags)) { @@ -339,9 +339,9 @@ void sub_0805930C(MiscManager* this) { } void SetDirtTile(u32 tile) { - SetTileType(CUT_GRASS, tile, 1); - SetTileType(0, tile, 2); - SetTileType(0, tile - 0x40, 2); + SetMetaTileType(CUT_GRASS, tile, 1); + SetMetaTileType(0, tile, 2); + SetMetaTileType(0, tile - 0x40, 2); } void MiscManager_TypeA(MiscManager* this) { diff --git a/src/manager/railIntersectionManager.c b/src/manager/railIntersectionManager.c index 68a16d2e..12b1ab56 100644 --- a/src/manager/railIntersectionManager.c +++ b/src/manager/railIntersectionManager.c @@ -45,5 +45,5 @@ void RailIntersectionManager_Action1(RailIntersectionManager* this) { void sub_0805B778(RailIntersectionManager* this) { static const u16 gUnk_08108C9C[] = { 0x358, 0x359, 0x356, 0x35a, 0x35a, 0x357 }; - SetTileType(gUnk_08108C9C[super->type * 2 + super->type2], this->field_0x38, this->field_0x36); + SetMetaTileType(gUnk_08108C9C[super->type * 2 + super->type2], this->field_0x38, this->field_0x36); } diff --git a/src/manager/tilePuzzleManager.c b/src/manager/tilePuzzleManager.c index a229878f..19a91373 100644 --- a/src/manager/tilePuzzleManager.c +++ b/src/manager/tilePuzzleManager.c @@ -30,7 +30,7 @@ void TilePuzzleManager_Main(TilePuzzleManager* this) { this->player_current_tile = COORD_TO_TILE((&gPlayerEntity)); if (this->player_current_tile != this->player_previous_tile) { this->player_previous_tile = this->player_current_tile; - switch (GetTileType(this->player_current_tile, super->type2)) { + switch (GetMetaTileType(this->player_current_tile, super->type2)) { case 0x317: // stepped on a red tile again super->action = FAILED; diff --git a/src/manager/waterfallBottomManager.c b/src/manager/waterfallBottomManager.c index d449a3ae..18ab0efa 100644 --- a/src/manager/waterfallBottomManager.c +++ b/src/manager/waterfallBottomManager.c @@ -10,7 +10,7 @@ #include "functions.h" void WaterfallBottomManager_Main(WaterfallBottomManager* this) { - SetTile(0x4014, 0x5c3, 1); + SetMetaTile(0x4014, 0x5c3, 1); if ((gRoomControls.origin_y + 200 < gPlayerEntity.y.HALF.HI) && ((u32)(gPlayerEntity.x.HALF.HI - gRoomControls.origin_x) - 0x30 < 0x11)) { gPlayerEntity.collisionLayer = 3; |
