feat: Improve dungeon canvas rendering and object interaction

- Updated DungeonCanvasViewer and DungeonEditor to render room objects as primitives temporarily for debugging purposes.
- Enhanced object interaction with new context menu options for deleting, copying, and pasting selected objects.
- Implemented drag-and-drop functionality for moving selected objects within the dungeon.
- Added texture processing for background layers and deferred texture commands to optimize rendering performance.
- Refactored code for clarity and maintainability, ensuring better handling of object interactions and rendering logic.
This commit is contained in:
scawful
2025-10-09 08:37:03 -04:00
parent 557b89dac4
commit 48faee6711
5 changed files with 246 additions and 21 deletions

View File

@@ -52,6 +52,12 @@ class DungeonObjectInteraction {
bool IsObjectSelectActive() const { return object_select_active_; }
void ClearSelection();
// Context menu
void ShowContextMenu();
void HandleDeleteSelected();
void HandleCopySelected();
void HandlePasteObjects();
// Callbacks
void SetObjectPlacedCallback(std::function<void(const zelda3::RoomObject&)> callback) {
object_placed_callback_ = callback;
@@ -87,6 +93,10 @@ class DungeonObjectInteraction {
// Callbacks
std::function<void(const zelda3::RoomObject&)> object_placed_callback_;
std::function<void()> cache_invalidation_callback_;
// Clipboard for copy/paste
std::vector<zelda3::RoomObject> clipboard_;
bool has_clipboard_data_ = false;
};
} // namespace editor