update z3_dungeon_room public data type internals

This commit is contained in:
scawful
2025-01-06 15:48:36 -05:00
parent 2d15833b0d
commit 9c7f78a228
6 changed files with 121 additions and 112 deletions

View File

@@ -27,12 +27,13 @@ void Room::LoadHeader() {
auto header_location = core::SnesToPc(address);
bg2_ = (z3_dungeon_background2)((rom()->data()[header_location] >> 5) & 0x07);
bg2_ = (z3_dungeon_room::background2)((rom()->data()[header_location] >> 5) &
0x07);
collision_ = (CollisionKey)((rom()->data()[header_location] >> 2) & 0x07);
is_light_ = ((rom()->data()[header_location]) & 0x01) == 1;
if (is_light_) {
bg2_ = z3_dungeon_background2::DarkRoom;
bg2_ = z3_dungeon_room::background2::DarkRoom;
}
palette = ((rom()->data()[header_location + 1] & 0x3F));
@@ -373,7 +374,7 @@ void Room::LoadObjects() {
if (nbr_of_staircase < 4) {
tile_objects_.back().set_options(ObjectOption::Stairs |
tile_objects_.back().options());
z3_staircases_.push_back(z3_staircase(
z3_staircases_.push_back(z3_dungeon_room::staircase(
posX, posY,
absl::StrCat("To ", staircase_rooms_[nbr_of_staircase])
.data()));
@@ -381,7 +382,8 @@ void Room::LoadObjects() {
} else {
tile_objects_.back().set_options(ObjectOption::Stairs |
tile_objects_.back().options());
z3_staircases_.push_back(z3_staircase(posX, posY, "To ???"));
z3_staircases_.push_back(
z3_dungeon_room::staircase(posX, posY, "To ???"));
}
}
}
@@ -391,7 +393,7 @@ void Room::LoadObjects() {
tile_objects_.back().set_options(ObjectOption::Chest |
tile_objects_.back().options());
// chest_list_.push_back(
// Chest(posX, posY, chests_in_room_.front().itemIn, false));
// z3_chest(posX, posY, chests_in_room_.front().itemIn, false));
chests_in_room_.erase(chests_in_room_.begin());
}
} else if (oid == 0xFB1) {
@@ -399,14 +401,14 @@ void Room::LoadObjects() {
tile_objects_.back().set_options(ObjectOption::Chest |
tile_objects_.back().options());
// chest_list_.push_back(
// Chest(posX + 1, posY, chests_in_room_.front().item_in, true));
// z3_chest(posX + 1, posY, chests_in_room_.front().item_in, true));
chests_in_room_.erase(chests_in_room_.begin());
}
}
} else {
// tile_objects_.push_back(object_door(static_cast<short>((b2 << 8) + b1),
// 0,
// 0, 0, static_cast<uint8_t>(layer)));
// tile_objects_.push_back(z3_object_door(static_cast<short>((b2 << 8) + b1),
// 0, 0, 0,
// static_cast<uint8_t>(layer)));
}
}
}
@@ -477,7 +479,7 @@ void Room::LoadChests() {
}
chests_in_room_.emplace_back(
z3_chest_data(rom_data[cpos + (i * 3) + 2], big));
z3_dungeon_room::chest_data(rom_data[cpos + (i * 3) + 2], big));
}
}
}

View File

@@ -177,13 +177,13 @@ class Room : public SharedRom {
int64_t room_size_pointer_;
std::array<uint8_t, 16> blocks_;
std::array<uchar, 16> chest_list_;
std::array<z3_chest, 16> chest_list_;
std::array<gfx::Bitmap, 3> background_bmps_;
std::vector<RoomObject> tile_objects_;
std::vector<zelda3::Sprite> sprites_;
std::vector<z3_staircase> z3_staircases_;
std::vector<z3_chest_data> chests_in_room_;
std::vector<z3_dungeon_room::staircase> z3_staircases_;
std::vector<z3_dungeon_room::chest_data> chests_in_room_;
LayerMergeType layer_merging_;
CollisionKey collision_;
@@ -191,12 +191,12 @@ class Room : public SharedRom {
TagKey tag1_;
TagKey tag2_;
z3_dungeon_background2 bg2_;
z3_dungeon_destination pits_;
z3_dungeon_destination stair1_;
z3_dungeon_destination stair2_;
z3_dungeon_destination stair3_;
z3_dungeon_destination stair4_;
z3_dungeon_room::background2 bg2_;
z3_dungeon_room::destination pits_;
z3_dungeon_room::destination stair1_;
z3_dungeon_room::destination stair2_;
z3_dungeon_room::destination stair3_;
z3_dungeon_room::destination stair4_;
};
constexpr std::string_view kRoomNames[] = {

View File

@@ -12,7 +12,6 @@
namespace yaze {
namespace zelda3 {
struct SubtypeInfo {
uint32_t subtype_ptr;
uint32_t routine_ptr;