Refactor DungeonCanvasViewer for enhanced rendering and object management
- Introduced new rendering methods for various object types including stairs, chests, doors, walls, pots, and sprites, improving visual representation in the dungeon canvas. - Updated the DrawDungeonCanvas method to streamline object rendering and enhance graphics handling. - Added detailed layer information overlay to provide context on room objects and sprites. - Implemented object dimension calculations for walls to ensure accurate rendering based on size properties. - Improved fallback rendering for objects without valid graphics, enhancing user experience during object placement and editing.
This commit is contained in:
@@ -630,12 +630,17 @@ void DungeonEditor::DrawDungeonCanvas(int room_id) {
|
||||
// Render background layers with proper positioning
|
||||
renderer_.RenderRoomBackgroundLayers(room_id);
|
||||
|
||||
// Render room objects on top of background using the room's palette
|
||||
// Render room objects and sprites with improved graphics
|
||||
if (current_palette_id_ < current_palette_group_.size()) {
|
||||
auto room_palette = current_palette_group_[current_palette_id_];
|
||||
|
||||
// Render regular objects with improved fallback
|
||||
for (const auto& object : rooms_[room_id].GetTileObjects()) {
|
||||
renderer_.RenderObjectInCanvas(object, room_palette);
|
||||
}
|
||||
|
||||
// Render sprites as simple 16x16 squares with labels
|
||||
renderer_.RenderSprites(rooms_[room_id]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user