fix: apply clang-format to all source files
Fixes formatting violations that were causing CI failures. Applied clang-format-14 to ensure consistent code formatting across the codebase. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -1,11 +1,11 @@
|
||||
#ifndef YAZE_APP_EDITOR_DUNGEON_DUNGEON_OBJECT_INTERACTION_H
|
||||
#define YAZE_APP_EDITOR_DUNGEON_DUNGEON_OBJECT_INTERACTION_H
|
||||
|
||||
#include <vector>
|
||||
#include <functional>
|
||||
#include <vector>
|
||||
|
||||
#include "imgui/imgui.h"
|
||||
#include "app/gui/canvas/canvas.h"
|
||||
#include "imgui/imgui.h"
|
||||
#include "zelda3/dungeon/room.h"
|
||||
#include "zelda3/dungeon/room_object.h"
|
||||
|
||||
@@ -21,45 +21,48 @@ namespace editor {
|
||||
class DungeonObjectInteraction {
|
||||
public:
|
||||
explicit DungeonObjectInteraction(gui::Canvas* canvas) : canvas_(canvas) {}
|
||||
|
||||
|
||||
// Main interaction handling
|
||||
void HandleCanvasMouseInput();
|
||||
void CheckForObjectSelection();
|
||||
void PlaceObjectAtPosition(int room_x, int room_y);
|
||||
|
||||
|
||||
// Selection rectangle (like OverworldEditor)
|
||||
void DrawObjectSelectRect();
|
||||
void SelectObjectsInRect();
|
||||
void DrawSelectionHighlights(); // Draw highlights for selected objects
|
||||
|
||||
|
||||
// Drag and select box functionality
|
||||
void DrawSelectBox();
|
||||
void DrawDragPreview();
|
||||
void UpdateSelectedObjects();
|
||||
bool IsObjectInSelectBox(const zelda3::RoomObject& object) const;
|
||||
|
||||
|
||||
// Coordinate conversion
|
||||
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;
|
||||
|
||||
|
||||
// State management
|
||||
void SetCurrentRoom(std::array<zelda3::Room, 0x128>* rooms, int room_id);
|
||||
void SetPreviewObject(const zelda3::RoomObject& object, bool loaded);
|
||||
|
||||
|
||||
// Selection state
|
||||
const std::vector<size_t>& GetSelectedObjectIndices() const { return selected_object_indices_; }
|
||||
const std::vector<size_t>& GetSelectedObjectIndices() const {
|
||||
return selected_object_indices_;
|
||||
}
|
||||
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) {
|
||||
void SetObjectPlacedCallback(
|
||||
std::function<void(const zelda3::RoomObject&)> callback) {
|
||||
object_placed_callback_ = callback;
|
||||
}
|
||||
void SetCacheInvalidationCallback(std::function<void()> callback) {
|
||||
@@ -70,11 +73,11 @@ class DungeonObjectInteraction {
|
||||
gui::Canvas* canvas_;
|
||||
std::array<zelda3::Room, 0x128>* rooms_ = nullptr;
|
||||
int current_room_id_ = 0;
|
||||
|
||||
|
||||
// Preview object state
|
||||
zelda3::RoomObject preview_object_{0, 0, 0, 0, 0};
|
||||
bool object_loaded_ = false;
|
||||
|
||||
|
||||
// Drag and select infrastructure
|
||||
bool is_dragging_ = false;
|
||||
bool is_selecting_ = false;
|
||||
@@ -83,17 +86,17 @@ class DungeonObjectInteraction {
|
||||
ImVec2 select_start_pos_;
|
||||
ImVec2 select_current_pos_;
|
||||
std::vector<int> selected_objects_;
|
||||
|
||||
|
||||
// Object selection rectangle (like OverworldEditor)
|
||||
bool object_select_active_ = false;
|
||||
ImVec2 object_select_start_;
|
||||
ImVec2 object_select_end_;
|
||||
std::vector<size_t> selected_object_indices_;
|
||||
|
||||
|
||||
// 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;
|
||||
|
||||
Reference in New Issue
Block a user