Add Comprehensive Dungeon Editor Design Plan

- Introduced a detailed design plan document for the Yaze Dungeon Editor, outlining the current architecture, main components, and core systems.
- Documented identified issues and applied fixes, including crash prevention and UI simplification, along with a roadmap for future development phases.
- Enhanced clarity on the implementation guidelines, testing strategies, and performance considerations to support ongoing development efforts.
- Established a structured approach for new developers to understand the codebase and contribute effectively to the project.
This commit is contained in:
scawful
2025-09-24 23:53:29 -04:00
parent a71f1e02c9
commit 7014d73e7b
9 changed files with 522 additions and 29 deletions

View File

@@ -45,7 +45,8 @@ constexpr ImGuiTableFlags kDungeonTableFlags =
class DungeonEditor : public Editor {
public:
explicit DungeonEditor(Rom* rom = nullptr)
: rom_(rom), object_renderer_(rom), preview_object_(0, 0, 0, 0, 0) {
: rom_(rom), object_renderer_(rom), preview_object_(0, 0, 0, 0, 0),
room_selector_(rom), canvas_viewer_(rom), object_selector_(rom) {
type_ = EditorType::kDungeon;
// Initialize the new dungeon editor system
if (rom) {
@@ -67,7 +68,13 @@ class DungeonEditor : public Editor {
void add_room(int i) { active_rooms_.push_back(i); }
void set_rom(Rom* rom) { rom_ = rom; }
void set_rom(Rom* rom) {
rom_ = rom;
// Update the new UI components with the new ROM
room_selector_.set_rom(rom_);
canvas_viewer_.SetRom(rom_);
object_selector_.SetRom(rom_);
}
Rom* rom() const { return rom_; }
private:
@@ -212,6 +219,11 @@ class DungeonEditor : public Editor {
std::array<zelda3::RoomEntrance, 0x8C> entrances_ = {};
zelda3::ObjectRenderer object_renderer_;
// New UI components
DungeonRoomSelector room_selector_;
DungeonCanvasViewer canvas_viewer_;
DungeonObjectSelector object_selector_;
absl::flat_hash_map<uint16_t, int> spriteset_usage_;
absl::flat_hash_map<uint16_t, int> blockset_usage_;
absl::flat_hash_map<uint16_t, int> palette_usage_;