Add Comprehensive Guide for Yaze Dungeon Editor

- Introduced a new documentation file detailing the Yaze Dungeon Editor, covering its architecture, core components, coordinate system, object rendering system, user interface, and integration with ZScream.
- Included sections on usage examples, testing and validation strategies, and future enhancements to provide a complete overview of the editor's capabilities.
- Removed the outdated dungeon object rendering refactor documentation to streamline resources and focus on the comprehensive guide.
- Enhanced clarity and organization of the documentation to support both novice and expert users in effectively utilizing the dungeon editing tools.
This commit is contained in:
scawful
2025-09-24 23:00:44 -04:00
parent ccd4e8cf4b
commit 04909dc3d0
4 changed files with 585 additions and 326 deletions

View File

@@ -42,7 +42,7 @@ constexpr ImGuiTableFlags kDungeonTableFlags =
class DungeonEditor : public Editor {
public:
explicit DungeonEditor(Rom* rom = nullptr)
: rom_(rom), object_renderer_(rom) {
: rom_(rom), object_renderer_(rom), preview_object_(0, 0, 0, 0, 0) {
type_ = EditorType::kDungeon;
// Initialize the new dungeon editor system
if (rom) {
@@ -111,6 +111,11 @@ class DungeonEditor : public Editor {
int canvas_y);
void RenderLayoutObjects(const zelda3::RoomLayout& layout,
const gfx::SnesPalette& palette);
// Coordinate conversion helpers
std::pair<int, int> RoomToCanvasCoordinates(int room_x, int room_y) const;
std::pair<int, int> CanvasToRoomCoordinates(int canvas_x, int canvas_y) const;
bool IsWithinCanvasBounds(int canvas_x, int canvas_y, int margin = 32) const;
// Object rendering cache to avoid re-rendering the same objects
struct ObjectRenderCache {
@@ -123,6 +128,10 @@ class DungeonEditor : public Editor {
std::vector<ObjectRenderCache> object_render_cache_;
uint64_t last_palette_hash_ = 0;
// Object preview system
zelda3::RoomObject preview_object_;
gfx::SnesPalette preview_palette_;
void CalculateUsageStats();
void DrawUsageStats();