remove dungeon namespace

This commit is contained in:
scawful
2024-12-29 16:14:20 -05:00
parent 8cf16906e6
commit 7e470f2b33
14 changed files with 43 additions and 34 deletions

View File

@@ -74,7 +74,7 @@ absl::Status DungeonEditor::Initialize() {
auto dungeon_man_pal_group = rom()->palette_group().dungeon_main;
for (int i = 0; i < 0x100 + 40; i++) {
rooms_.emplace_back(zelda3::dungeon::Room(/*room_id=*/i));
rooms_.emplace_back(zelda3::Room(/*room_id=*/i));
rooms_[i].LoadHeader();
rooms_[i].LoadRoomFromROM();
if (flags()->kDrawDungeonRoomGraphics) {
@@ -97,11 +97,11 @@ absl::Status DungeonEditor::Initialize() {
LoadDungeonRoomSize();
// LoadRoomEntrances
for (int i = 0; i < 0x07; ++i) {
entrances_.emplace_back(zelda3::dungeon::RoomEntrance(*rom(), i, true));
entrances_.emplace_back(zelda3::RoomEntrance(*rom(), i, true));
}
for (int i = 0; i < 0x85; ++i) {
entrances_.emplace_back(zelda3::dungeon::RoomEntrance(*rom(), i, false));
entrances_.emplace_back(zelda3::RoomEntrance(*rom(), i, false));
}
// Load the palette group and palette for the dungeon
@@ -325,7 +325,7 @@ void DungeonEditor::DrawRoomSelector() {
BeginChild(child_id, ImGui::GetContentRegionAvail(), true,
ImGuiWindowFlags_AlwaysVerticalScrollbar)) {
int i = 0;
for (const auto each_room_name : zelda3::dungeon::kRoomNames) {
for (const auto each_room_name : zelda3::kRoomNames) {
rom()->resource_label()->SelectableLabelWithNameEdit(
current_room_id_ == i, "Dungeon Room Names",
core::UppercaseHexByte(i), each_room_name.data());
@@ -403,7 +403,7 @@ void DungeonEditor::DrawEntranceSelector() {
rom()->resource_label()->SelectableLabelWithNameEdit(
current_entrance_id_ == i, "Dungeon Entrance Names",
core::UppercaseHexByte(i),
zelda3::dungeon::kEntranceNames[i].data());
zelda3::kEntranceNames[i].data());
if (ImGui::IsItemClicked()) {
current_entrance_id_ = i;
@@ -434,12 +434,12 @@ void DungeonEditor::DrawDungeonTabView() {
for (int n = 0; n < active_rooms_.Size;) {
bool open = true;
if (active_rooms_[n] > sizeof(zelda3::dungeon::kRoomNames) / 4) {
if (active_rooms_[n] > sizeof(zelda3::kRoomNames) / 4) {
active_rooms_.erase(active_rooms_.Data + n);
continue;
}
if (BeginTabItem(zelda3::dungeon::kRoomNames[active_rooms_[n]].data(),
if (BeginTabItem(zelda3::kRoomNames[active_rooms_[n]].data(),
&open, ImGuiTabItemFlags_None)) {
DrawDungeonCanvas(active_rooms_[n]);
EndTabItem();
@@ -549,7 +549,7 @@ void DungeonEditor::DrawObjectRenderer() {
int selected_object = 0;
int i = 0;
for (const auto object_name : zelda3::dungeon::Type1RoomObjectNames) {
for (const auto object_name : zelda3::Type1RoomObjectNames) {
if (ImGui::Selectable(object_name.data(), selected_object == i)) {
selected_object = i;
current_object_ = i;

View File

@@ -119,9 +119,9 @@ class DungeonEditor : public Editor,
std::array<gfx::Bitmap, kNumGfxSheets> graphics_bin_;
std::vector<gfx::Bitmap*> room_gfx_sheets_;
std::vector<zelda3::dungeon::Room> rooms_;
std::vector<zelda3::dungeon::RoomEntrance> entrances_;
zelda3::dungeon::DungeonObjectRenderer object_renderer_;
std::vector<zelda3::Room> rooms_;
std::vector<zelda3::RoomEntrance> entrances_;
zelda3::DungeonObjectRenderer object_renderer_;
absl::flat_hash_map<uint16_t, int> spriteset_usage_;
absl::flat_hash_map<uint16_t, int> blockset_usage_;

View File

@@ -5,7 +5,7 @@
namespace yaze {
namespace zelda3 {
namespace dungeon {
constexpr static inline absl::string_view Type1RoomObjectNames[] = {
"Ceiling ↔",
@@ -456,7 +456,8 @@ constexpr static inline absl::string_view Type3RoomObjectNames[] = {
"Nothing",
};
} // namespace dungeon
} // namespace zelda3
} // namespace yaze

View File

@@ -2,7 +2,7 @@
namespace yaze {
namespace zelda3 {
namespace dungeon {
void DungeonObjectRenderer::LoadObject(uint32_t routine_ptr,
std::array<uint8_t, 16>& sheet_ids) {
@@ -111,7 +111,8 @@ void DungeonObjectRenderer::UpdateObjectBitmap() {
bitmap_.Create(256, 256, 8, tilemap_);
}
} // namespace dungeon
} // namespace zelda3
} // namespace yaze

View File

@@ -15,7 +15,7 @@
namespace yaze {
namespace zelda3 {
namespace dungeon {
struct PseudoVram {
std::array<uint8_t, 16> sheets;
@@ -50,7 +50,8 @@ class DungeonObjectRenderer : public SharedRom {
gfx::Bitmap bitmap_;
};
} // namespace dungeon
} // namespace zelda3
} // namespace yaze

View File

@@ -17,7 +17,7 @@
namespace yaze {
namespace zelda3 {
namespace dungeon {
void Room::LoadHeader() {
// Address of the room header
@@ -485,7 +485,8 @@ void Room::LoadChests() {
}
}
} // namespace dungeon
} // namespace zelda3
} // namespace yaze

View File

@@ -15,7 +15,7 @@
namespace yaze {
namespace zelda3 {
namespace dungeon {
// room_object_layout_pointer 0x882D
// room_object_pointer 0x874C
@@ -600,7 +600,8 @@ constexpr std::string_view kEntranceNames[] = {
"Heart Piece Cave 3 (Drop In)",
"Ice Rod Cave"};
} // namespace dungeon
} // namespace zelda3
} // namespace yaze

View File

@@ -7,7 +7,7 @@
namespace yaze {
namespace zelda3 {
namespace dungeon {
// ============================================================================
// Dungeon Entrances Related Variables
@@ -349,7 +349,8 @@ class RoomEntrance {
uint8_t camera_boundary_fe_;
};
} // namespace dungeon
} // namespace zelda3
} // namespace yaze

View File

@@ -2,7 +2,7 @@
namespace yaze {
namespace zelda3 {
namespace dungeon {
ObjectOption operator|(ObjectOption lhs, ObjectOption rhs) {
return static_cast<ObjectOption>(static_cast<int>(lhs) |
@@ -130,7 +130,8 @@ void RoomObject::DrawTile(gfx::Tile16 t, int xx, int yy,
}
}
} // namespace dungeon
} // namespace zelda3
} // namespace yaze

View File

@@ -11,7 +11,7 @@
namespace yaze {
namespace zelda3 {
namespace dungeon {
struct SubtypeInfo {
uint32_t subtype_ptr;
@@ -201,7 +201,8 @@ class Subtype3 : public RoomObject {
}
};
} // namespace dungeon
} // namespace zelda3
} // namespace yaze

View File

@@ -5,7 +5,7 @@
namespace yaze {
namespace zelda3 {
namespace dungeon {
static const std::string RoomEffect[] = {"Nothing",
"Nothing",
@@ -85,7 +85,8 @@ static const std::string RoomTag[] = {"Nothing",
"Light Torches for Chest",
"Kill Boss Again"};
} // namespace dungeon
} // namespace zelda3
} // namespace yaze