refactor: Migrate DungeonEditor to V2 and update related components

- Replaced the deprecated DungeonEditor with DungeonEditorV2, implementing a card-based architecture for improved UI management.
- Updated CMakeLists.txt to reflect changes in source file organization, including renaming dungeon_editor files to their V2 counterparts.
- Refactored DungeonCanvasViewer to support per-room layer visibility settings and updated related methods for rendering and layer management.
- Enhanced testing framework to accommodate the new DungeonEditorV2 structure, including updates to smoke tests and integration tests.
- Removed legacy dungeon_editor files to streamline the codebase and prevent confusion with the new implementation.
This commit is contained in:
scawful
2025-10-09 18:00:27 -04:00
parent 9675050b78
commit 418695188a
15 changed files with 242 additions and 1627 deletions

View File

@@ -4,7 +4,7 @@
#include <memory>
#include <string>
#include "app/editor/dungeon/dungeon_editor.h"
#include "app/editor/dungeon/dungeon_editor_v2.h"
#include "app/rom.h"
#include "app/zelda3/dungeon/room.h"
#include "gtest/gtest.h"
@@ -14,6 +14,8 @@ namespace test {
/**
* @brief Integration test framework using real ROM data
*
* Updated for DungeonEditorV2 with card-based architecture
*/
class DungeonEditorIntegrationTest : public ::testing::Test {
protected:
@@ -30,8 +32,14 @@ class DungeonEditorIntegrationTest : public ::testing::Test {
ASSERT_TRUE(status.ok()) << "Could not load zelda3.sfc from any location";
ASSERT_TRUE(rom_->InitializeForTesting().ok());
// Pass ROM to constructor so all components are initialized with it
dungeon_editor_ = std::make_unique<editor::DungeonEditor>(rom_.get());
// Initialize DungeonEditorV2 with ROM
dungeon_editor_ = std::make_unique<editor::DungeonEditorV2>();
dungeon_editor_->set_rom(rom_.get());
// Load editor data
auto load_status = dungeon_editor_->Load();
ASSERT_TRUE(load_status.ok()) << "Failed to load dungeon editor: "
<< load_status.message();
}
void TearDown() override {
@@ -40,7 +48,7 @@ class DungeonEditorIntegrationTest : public ::testing::Test {
}
std::unique_ptr<Rom> rom_;
std::unique_ptr<editor::DungeonEditor> dungeon_editor_;
std::unique_ptr<editor::DungeonEditorV2> dungeon_editor_;
static constexpr int kTestRoomId = 0x01;
};