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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user