Interactive dungeon object editor with scroll wheel support. More...
#include <dungeon_object_editor.h>
Classes | |
| struct | EditingState |
| struct | EditorConfig |
| struct | SelectionState |
| struct | UndoPoint |
Public Types | |
| enum class | Mode { kSelect , kInsert , kDelete , kEdit , kLayer , kPreview } |
| enum class | Alignment { Left , CenterX , Right , Top , CenterY , Bottom } |
| using | ObjectChangedCallback |
| using | RoomChangedCallback = std::function<void()> |
| using | SelectionChangedCallback = std::function<void(const SelectionState&)> |
Public Member Functions | |
| DungeonObjectEditor (Rom *rom) | |
| ~DungeonObjectEditor ()=default | |
| absl::Status | LoadRoom (int room_id) |
| absl::Status | SaveRoom () |
| absl::Status | ClearRoom () |
| absl::Status | InsertObject (int x, int y, int object_type, int size=0x12, int layer=0) |
| absl::Status | DeleteObject (size_t object_index) |
| absl::Status | DeleteSelectedObjects () |
| absl::Status | MoveObject (size_t object_index, int new_x, int new_y) |
| absl::Status | ResizeObject (size_t object_index, int new_size) |
| absl::Status | ChangeObjectType (size_t object_index, int new_type) |
| absl::Status | ChangeObjectLayer (size_t object_index, int new_layer) |
| absl::Status | BatchMoveObjects (const std::vector< size_t > &indices, int dx, int dy) |
| absl::Status | BatchChangeObjectLayer (const std::vector< size_t > &indices, int new_layer) |
| absl::Status | BatchResizeObjects (const std::vector< size_t > &indices, int new_size) |
| std::optional< size_t > | DuplicateObject (size_t object_index, int offset_x=1, int offset_y=1) |
| void | CopySelectedObjects (const std::vector< size_t > &indices) |
| std::vector< size_t > | PasteObjects () |
| absl::Status | AlignSelectedObjects (Alignment alignment) |
| absl::Status | InsertTemplate (const ObjectTemplate &tmpl, int x, int y) |
| absl::Status | CreateTemplateFromSelection (const std::string &name, const std::string &description) |
| const std::vector< ObjectTemplate > & | GetTemplates () const |
| absl::Status | SelectObject (int screen_x, int screen_y) |
| absl::Status | SelectObjects (int start_x, int start_y, int end_x, int end_y) |
| absl::Status | ClearSelection () |
| absl::Status | AddToSelection (size_t object_index) |
| absl::Status | RemoveFromSelection (size_t object_index) |
| absl::Status | HandleMouseClick (int x, int y, bool left_button, bool right_button, bool shift_pressed) |
| absl::Status | HandleMouseDrag (int start_x, int start_y, int current_x, int current_y) |
| absl::Status | HandleMouseRelease (int x, int y) |
| absl::Status | HandleScrollWheel (int delta, int x, int y, bool ctrl_pressed) |
| absl::Status | HandleKeyPress (int key_code, bool ctrl_pressed, bool shift_pressed) |
| void | SetMode (Mode mode) |
| Mode | GetMode () const |
| void | SetCurrentLayer (int layer) |
| int | GetCurrentLayer () const |
| absl::StatusOr< std::vector< RoomObject > > | GetObjectsByLayer (int layer) |
| absl::Status | MoveObjectToLayer (size_t object_index, int layer) |
| void | SetCurrentObjectType (int object_type) |
| int | GetCurrentObjectType () const |
| absl::StatusOr< std::vector< int > > | GetAvailableObjectTypes () |
| absl::Status | ValidateObjectType (int object_type) |
| absl::StatusOr< gfx::Bitmap > | RenderPreview (int x, int y) |
| void | SetPreviewPosition (int x, int y) |
| void | UpdatePreview () |
| void | RenderSelectionHighlight (gfx::Bitmap &canvas) |
| void | RenderLayerVisualization (gfx::Bitmap &canvas) |
| void | DrawPropertyUI () |
| void | RenderLayerControls () |
| absl::Status | HandleDragOperation (int current_x, int current_y) |
| absl::Status | Undo () |
| absl::Status | Redo () |
| bool | CanUndo () const |
| bool | CanRedo () const |
| void | ClearHistory () |
| void | SetROM (Rom *rom) |
| void | SetExternalRoom (Room *room) |
| void | SetConfig (const EditorConfig &config) |
| EditorConfig | GetConfig () const |
| void | SetSnapToGrid (bool enabled) |
| void | SetGridSize (int size) |
| void | SetShowGrid (bool enabled) |
| ValidationResult | ValidateRoom () |
| absl::Status | ValidateObject (const RoomObject &object) |
| std::vector< std::string > | GetValidationErrors () |
| void | SetObjectChangedCallback (ObjectChangedCallback callback) |
| void | SetRoomChangedCallback (RoomChangedCallback callback) |
| void | SetSelectionChangedCallback (SelectionChangedCallback callback) |
| absl::Status | InitializeEditor () |
| const Room & | GetRoom () const |
| Room * | GetMutableRoom () |
| const SelectionState & | GetSelection () const |
| const EditingState & | GetEditingState () const |
| size_t | GetObjectCount () const |
| const std::vector< RoomObject > & | GetObjects () const |
Private Member Functions | |
| absl::Status | CreateUndoPoint () |
| absl::Status | ApplyUndoPoint (const UndoPoint &undo_point) |
| std::pair< int, int > | ScreenToRoomCoordinates (int screen_x, int screen_y) |
| std::pair< int, int > | RoomToScreenCoordinates (int room_x, int room_y) |
| int | SnapToGrid (int coordinate) |
| std::optional< size_t > | FindObjectAt (int room_x, int room_y) |
| std::vector< size_t > | FindObjectsInArea (int start_x, int start_y, int end_x, int end_y) |
| bool | IsObjectAtPosition (const RoomObject &object, int x, int y) |
| bool | ObjectsCollide (const RoomObject &obj1, const RoomObject &obj2) |
| absl::StatusOr< gfx::Bitmap > | RenderObjectPreview (int object_type, int x, int y, int size) |
| void | UpdatePreviewObject () |
| absl::Status | ValidatePreviewPosition (int x, int y) |
| absl::Status | HandleSizeEdit (int delta, int x, int y) |
| int | GetNextSize (int current_size, int delta) |
| int | GetPreviousSize (int current_size, int delta) |
| bool | IsValidSize (int size) |
Private Attributes | |
| Rom * | rom_ |
| Room * | current_room_ = nullptr |
| std::unique_ptr< Room > | owned_room_ |
| SelectionState | selection_state_ |
| EditingState | editing_state_ |
| EditorConfig | config_ |
| std::vector< UndoPoint > | undo_history_ |
| std::vector< UndoPoint > | redo_history_ |
| std::optional< RoomObject > | preview_object_ |
| bool | preview_visible_ = false |
| ObjectChangedCallback | object_changed_callback_ |
| RoomChangedCallback | room_changed_callback_ |
| SelectionChangedCallback | selection_changed_callback_ |
| DungeonValidator | validator_ |
| ObjectTemplateManager | template_manager_ |
| std::vector< RoomObject > | empty_objects_ |
| std::vector< RoomObject > | clipboard_ |
Static Private Attributes | |
| static constexpr size_t | kMaxUndoHistory = 50 |
| static constexpr int | kMinObjectSize = 0x00 |
| static constexpr int | kMaxObjectSize = 0xFF |
| static constexpr int | kDefaultObjectSize = 0x12 |
| static constexpr int | kMinLayer = 0 |
| static constexpr int | kMaxLayer = 2 |
Interactive dungeon object editor with scroll wheel support.
This class provides a comprehensive object editing system for dungeon rooms, including:
Definition at line 38 of file dungeon_object_editor.h.
Definition at line 212 of file dungeon_object_editor.h.
| using yaze::zelda3::DungeonObjectEditor::RoomChangedCallback = std::function<void()> |
Definition at line 214 of file dungeon_object_editor.h.
| using yaze::zelda3::DungeonObjectEditor::SelectionChangedCallback = std::function<void(const SelectionState&)> |
Definition at line 215 of file dungeon_object_editor.h.
|
strong |
| Enumerator | |
|---|---|
| kSelect | |
| kInsert | |
| kDelete | |
| kEdit | |
| kLayer | |
| kPreview | |
Definition at line 41 of file dungeon_object_editor.h.
|
strong |
| Enumerator | |
|---|---|
| Left | |
| CenterX | |
| Right | |
| Top | |
| CenterY | |
| Bottom | |
Definition at line 133 of file dungeon_object_editor.h.
|
explicit |
Definition at line 22 of file dungeon_object_editor.cc.
|
default |
| absl::Status yaze::zelda3::DungeonObjectEditor::LoadRoom | ( | int | room_id | ) |
Definition at line 56 of file dungeon_object_editor.cc.
References ClearSelection(), CreateUndoPoint(), yaze::zelda3::DungeonObjectEditor::EditingState::current_layer, current_room_, editing_state_, yaze::zelda3::DungeonObjectEditor::EditingState::is_editing_position, yaze::zelda3::DungeonObjectEditor::EditingState::is_editing_size, yaze::zelda3::kNumberOfRooms, owned_room_, rom_, and room_changed_callback_.

| absl::Status yaze::zelda3::DungeonObjectEditor::SaveRoom | ( | ) |
Definition at line 91 of file dungeon_object_editor.cc.
References config_, current_room_, yaze::zelda3::Room::SaveObjects(), yaze::zelda3::DungeonObjectEditor::EditorConfig::validate_objects, and ValidateRoom().

| absl::Status yaze::zelda3::DungeonObjectEditor::ClearRoom | ( | ) |
Definition at line 112 of file dungeon_object_editor.cc.
References ClearSelection(), yaze::zelda3::Room::ClearTileObjects(), CreateUndoPoint(), current_room_, and room_changed_callback_.

| absl::Status yaze::zelda3::DungeonObjectEditor::InsertObject | ( | int | x, |
| int | y, | ||
| int | object_type, | ||
| int | size = 0x12, | ||
| int | layer = 0 ) |
Definition at line 137 of file dungeon_object_editor.cc.
References yaze::zelda3::Room::AddObject(), ClearSelection(), config_, CreateUndoPoint(), current_room_, yaze::zelda3::RoomObject::EnsureTilesLoaded(), yaze::zelda3::Room::GetTileObjectCount(), yaze::zelda3::Room::GetTileObjects(), kMaxLayer, kMaxObjectSize, object_changed_callback_, ObjectsCollide(), rom_, room_changed_callback_, yaze::zelda3::DungeonObjectEditor::SelectionState::selected_objects, selection_changed_callback_, selection_state_, yaze::zelda3::RoomObject::SetRom(), yaze::zelda3::DungeonObjectEditor::EditorConfig::snap_to_grid, SnapToGrid(), and yaze::zelda3::DungeonObjectEditor::EditorConfig::validate_objects.
Referenced by HandleMouseClick().
| absl::Status yaze::zelda3::DungeonObjectEditor::DeleteObject | ( | size_t | object_index | ) |
Definition at line 212 of file dungeon_object_editor.cc.
References CreateUndoPoint(), current_room_, yaze::zelda3::Room::GetTileObjectCount(), yaze::zelda3::Room::RemoveObject(), room_changed_callback_, yaze::zelda3::DungeonObjectEditor::SelectionState::selected_objects, selection_changed_callback_, and selection_state_.
Referenced by DrawPropertyUI(), and HandleMouseClick().

| absl::Status yaze::zelda3::DungeonObjectEditor::DeleteSelectedObjects | ( | ) |
Definition at line 258 of file dungeon_object_editor.cc.
References ClearSelection(), CreateUndoPoint(), current_room_, yaze::zelda3::Room::RemoveTileObject(), room_changed_callback_, yaze::zelda3::DungeonObjectEditor::SelectionState::selected_objects, and selection_state_.
Referenced by DrawPropertyUI().

| absl::Status yaze::zelda3::DungeonObjectEditor::MoveObject | ( | size_t | object_index, |
| int | new_x, | ||
| int | new_y ) |
Definition at line 296 of file dungeon_object_editor.cc.
References config_, CreateUndoPoint(), current_room_, yaze::zelda3::Room::GetTileObject(), yaze::zelda3::Room::GetTileObjectCount(), yaze::zelda3::Room::GetTileObjects(), yaze::zelda3::Room::MarkSaveDirtyForTileObject(), object_changed_callback_, ObjectsCollide(), room_changed_callback_, yaze::zelda3::RoomObject::set_x(), yaze::zelda3::RoomObject::set_y(), yaze::zelda3::DungeonObjectEditor::EditorConfig::snap_to_grid, SnapToGrid(), and yaze::zelda3::DungeonObjectEditor::EditorConfig::validate_objects.
| absl::Status yaze::zelda3::DungeonObjectEditor::ResizeObject | ( | size_t | object_index, |
| int | new_size ) |
Definition at line 359 of file dungeon_object_editor.cc.
References CreateUndoPoint(), current_room_, yaze::zelda3::Room::GetTileObject(), yaze::zelda3::Room::GetTileObjectCount(), kMaxObjectSize, yaze::zelda3::Room::MarkSaveDirtyForTileObject(), object_changed_callback_, room_changed_callback_, and yaze::zelda3::RoomObject::size().
Referenced by HandleSizeEdit().
| absl::Status yaze::zelda3::DungeonObjectEditor::ChangeObjectType | ( | size_t | object_index, |
| int | new_type ) |
Definition at line 668 of file dungeon_object_editor.cc.
References CreateUndoPoint(), current_room_, yaze::zelda3::Room::GetTileObject(), yaze::zelda3::Room::GetTileObjectCount(), yaze::zelda3::RoomObject::id_, yaze::zelda3::Room::MarkSaveDirtyForTileObject(), object_changed_callback_, and room_changed_callback_.

| absl::Status yaze::zelda3::DungeonObjectEditor::ChangeObjectLayer | ( | size_t | object_index, |
| int | new_layer ) |
Definition at line 910 of file dungeon_object_editor.cc.
References BatchChangeObjectLayer(), current_room_, yaze::zelda3::Room::GetTileObjectCount(), and kMaxLayer.
Referenced by DrawPropertyUI().

| absl::Status yaze::zelda3::DungeonObjectEditor::BatchMoveObjects | ( | const std::vector< size_t > & | indices, |
| int | dx, | ||
| int | dy ) |
Definition at line 402 of file dungeon_object_editor.cc.
References CreateUndoPoint(), current_room_, yaze::zelda3::Room::GetTileObject(), yaze::zelda3::Room::GetTileObjectCount(), yaze::zelda3::Room::MarkSaveDirtyForTileObject(), object_changed_callback_, room_changed_callback_, and yaze::zelda3::RoomObject::x().
Referenced by DrawPropertyUI().
| absl::Status yaze::zelda3::DungeonObjectEditor::BatchChangeObjectLayer | ( | const std::vector< size_t > & | indices, |
| int | new_layer ) |
Definition at line 453 of file dungeon_object_editor.cc.
References CreateUndoPoint(), current_room_, yaze::zelda3::Room::GetTileObjects(), kMaxLayer, yaze::zelda3::Room::MarkSaveDirtyForTileObject(), object_changed_callback_, yaze::zelda3::ReassignObjectStorage(), room_changed_callback_, yaze::zelda3::DungeonObjectEditor::SelectionState::selected_objects, selection_changed_callback_, selection_state_, and yaze::zelda3::UsesSpecialLayerSelector().
Referenced by ChangeObjectLayer(), and DrawPropertyUI().
| absl::Status yaze::zelda3::DungeonObjectEditor::BatchResizeObjects | ( | const std::vector< size_t > & | indices, |
| int | new_size ) |
Definition at line 531 of file dungeon_object_editor.cc.
References CreateUndoPoint(), current_room_, yaze::zelda3::Room::GetTileObject(), yaze::zelda3::Room::GetTileObjectCount(), kMaxObjectSize, yaze::zelda3::Room::MarkSaveDirtyForTileObject(), object_changed_callback_, room_changed_callback_, and yaze::zelda3::RoomObject::size().
Referenced by DrawPropertyUI().
| std::optional< size_t > yaze::zelda3::DungeonObjectEditor::DuplicateObject | ( | size_t | object_index, |
| int | offset_x = 1, | ||
| int | offset_y = 1 ) |
Definition at line 575 of file dungeon_object_editor.cc.
References yaze::zelda3::Room::AddObject(), yaze::zelda3::RoomObject::CopyForNewPlacement(), CreateUndoPoint(), current_room_, yaze::zelda3::Room::GetTileObject(), yaze::zelda3::Room::GetTileObjectCount(), room_changed_callback_, and yaze::zelda3::RoomObject::x().
Referenced by DrawPropertyUI().
| void yaze::zelda3::DungeonObjectEditor::CopySelectedObjects | ( | const std::vector< size_t > & | indices | ) |
Definition at line 617 of file dungeon_object_editor.cc.
References clipboard_, current_room_, and yaze::zelda3::Room::GetTileObject().

| std::vector< size_t > yaze::zelda3::DungeonObjectEditor::PasteObjects | ( | ) |
Definition at line 631 of file dungeon_object_editor.cc.
References yaze::zelda3::Room::AddObject(), clipboard_, yaze::zelda3::RoomObject::CopyForNewPlacement(), CreateUndoPoint(), current_room_, yaze::zelda3::Room::GetTileObjectCount(), room_changed_callback_, yaze::zelda3::RoomObject::set_x(), yaze::zelda3::RoomObject::set_y(), yaze::zelda3::RoomObject::x(), and yaze::zelda3::RoomObject::y().
| absl::Status yaze::zelda3::DungeonObjectEditor::AlignSelectedObjects | ( | Alignment | alignment | ) |
Definition at line 800 of file dungeon_object_editor.cc.
References Bottom, CenterX, CenterY, CreateUndoPoint(), current_room_, yaze::zelda3::Room::GetTileObject(), yaze::zelda3::Room::GetTileObjectCount(), Left, yaze::zelda3::Room::MarkSaveDirtyForTileObject(), object_changed_callback_, Right, room_changed_callback_, yaze::zelda3::DungeonObjectEditor::SelectionState::selected_objects, selection_state_, Top, and yaze::zelda3::RoomObject::x().
| absl::Status yaze::zelda3::DungeonObjectEditor::InsertTemplate | ( | const ObjectTemplate & | tmpl, |
| int | x, | ||
| int | y ) |
Definition at line 710 of file dungeon_object_editor.cc.
References yaze::zelda3::Room::AddObject(), ClearSelection(), config_, CreateUndoPoint(), current_room_, yaze::zelda3::Room::GetTileObjectCount(), yaze::zelda3::Room::GetTileObjects(), yaze::zelda3::ObjectTemplateManager::InstantiateTemplate(), yaze::zelda3::DungeonObjectEditor::SelectionState::is_multi_select, ObjectsCollide(), rom_, room_changed_callback_, yaze::zelda3::DungeonObjectEditor::SelectionState::selected_objects, selection_state_, yaze::zelda3::DungeonObjectEditor::EditorConfig::snap_to_grid, SnapToGrid(), template_manager_, and yaze::zelda3::DungeonObjectEditor::EditorConfig::validate_objects.
| absl::Status yaze::zelda3::DungeonObjectEditor::CreateTemplateFromSelection | ( | const std::string & | name, |
| const std::string & | description ) |
Definition at line 767 of file dungeon_object_editor.cc.
References yaze::zelda3::ObjectTemplateManager::CreateFromObjects(), current_room_, yaze::zelda3::description, yaze::zelda3::Room::GetTileObject(), yaze::zelda3::name, yaze::zelda3::ObjectTemplateManager::SaveTemplate(), yaze::zelda3::DungeonObjectEditor::SelectionState::selected_objects, selection_state_, template_manager_, and yaze::zelda3::RoomObject::x().

| const std::vector< ObjectTemplate > & yaze::zelda3::DungeonObjectEditor::GetTemplates | ( | ) | const |
Definition at line 796 of file dungeon_object_editor.cc.
References yaze::zelda3::ObjectTemplateManager::GetTemplates(), and template_manager_.

| absl::Status yaze::zelda3::DungeonObjectEditor::SelectObject | ( | int | screen_x, |
| int | screen_y ) |
Definition at line 1136 of file dungeon_object_editor.cc.
References ClearSelection(), current_room_, FindObjectAt(), ScreenToRoomCoordinates(), yaze::zelda3::DungeonObjectEditor::SelectionState::selected_objects, selection_changed_callback_, and selection_state_.
Referenced by HandleMouseClick().

| absl::Status yaze::zelda3::DungeonObjectEditor::SelectObjects | ( | int | start_x, |
| int | start_y, | ||
| int | end_x, | ||
| int | end_y ) |
| absl::Status yaze::zelda3::DungeonObjectEditor::ClearSelection | ( | ) |
Definition at line 1164 of file dungeon_object_editor.cc.
References yaze::zelda3::DungeonObjectEditor::SelectionState::is_dragging, yaze::zelda3::DungeonObjectEditor::SelectionState::is_multi_select, yaze::zelda3::DungeonObjectEditor::SelectionState::selected_objects, selection_changed_callback_, and selection_state_.
Referenced by ClearRoom(), DeleteSelectedObjects(), DrawPropertyUI(), InsertObject(), InsertTemplate(), LoadRoom(), SelectObject(), and SetExternalRoom().
| absl::Status yaze::zelda3::DungeonObjectEditor::AddToSelection | ( | size_t | object_index | ) |
Definition at line 1177 of file dungeon_object_editor.cc.
References current_room_, yaze::zelda3::Room::GetTileObjectCount(), yaze::zelda3::DungeonObjectEditor::SelectionState::is_multi_select, yaze::zelda3::DungeonObjectEditor::SelectionState::selected_objects, selection_changed_callback_, and selection_state_.
Referenced by HandleMouseClick().

| absl::Status yaze::zelda3::DungeonObjectEditor::RemoveFromSelection | ( | size_t | object_index | ) |
| absl::Status yaze::zelda3::DungeonObjectEditor::HandleMouseClick | ( | int | x, |
| int | y, | ||
| bool | left_button, | ||
| bool | right_button, | ||
| bool | shift_pressed ) |
Definition at line 1021 of file dungeon_object_editor.cc.
References AddToSelection(), yaze::zelda3::DungeonObjectEditor::EditingState::current_layer, yaze::zelda3::DungeonObjectEditor::EditingState::current_mode, yaze::zelda3::DungeonObjectEditor::EditingState::current_object_type, current_room_, DeleteObject(), editing_state_, FindObjectAt(), InsertObject(), kDelete, kEdit, kInsert, kSelect, yaze::zelda3::DungeonObjectEditor::EditingState::preview_size, ScreenToRoomCoordinates(), and SelectObject().
| absl::Status yaze::zelda3::DungeonObjectEditor::HandleMouseDrag | ( | int | start_x, |
| int | start_y, | ||
| int | current_x, | ||
| int | current_y ) |
Definition at line 1093 of file dungeon_object_editor.cc.
References CreateUndoPoint(), current_room_, yaze::zelda3::DungeonObjectEditor::SelectionState::drag_start_x, yaze::zelda3::DungeonObjectEditor::SelectionState::drag_start_y, HandleDragOperation(), yaze::zelda3::DungeonObjectEditor::SelectionState::is_dragging, yaze::zelda3::DungeonObjectEditor::SelectionState::selected_objects, and selection_state_.

| absl::Status yaze::zelda3::DungeonObjectEditor::HandleMouseRelease | ( | int | x, |
| int | y ) |
Definition at line 1118 of file dungeon_object_editor.cc.
References current_room_, yaze::zelda3::DungeonObjectEditor::SelectionState::is_dragging, room_changed_callback_, and selection_state_.
| absl::Status yaze::zelda3::DungeonObjectEditor::HandleScrollWheel | ( | int | delta, |
| int | x, | ||
| int | y, | ||
| bool | ctrl_pressed ) |
Definition at line 927 of file dungeon_object_editor.cc.
References yaze::zelda3::DungeonObjectEditor::EditingState::current_layer, yaze::zelda3::DungeonObjectEditor::EditingState::current_mode, current_room_, editing_state_, HandleSizeEdit(), kEdit, kInsert, kMaxLayer, kMinLayer, ScreenToRoomCoordinates(), yaze::zelda3::DungeonObjectEditor::SelectionState::selected_objects, selection_state_, and SetCurrentLayer().

| absl::Status yaze::zelda3::DungeonObjectEditor::HandleKeyPress | ( | int | key_code, |
| bool | ctrl_pressed, | ||
| bool | shift_pressed ) |
| void yaze::zelda3::DungeonObjectEditor::SetMode | ( | Mode | mode | ) |
Definition at line 1203 of file dungeon_object_editor.cc.
References yaze::zelda3::DungeonObjectEditor::EditingState::current_mode, editing_state_, and UpdatePreviewObject().

|
inline |
Definition at line 162 of file dungeon_object_editor.h.
References yaze::zelda3::DungeonObjectEditor::EditingState::current_mode, and editing_state_.
| void yaze::zelda3::DungeonObjectEditor::SetCurrentLayer | ( | int | layer | ) |
Definition at line 1210 of file dungeon_object_editor.cc.
References yaze::zelda3::DungeonObjectEditor::EditingState::current_layer, editing_state_, kMaxLayer, kMinLayer, and UpdatePreviewObject().
Referenced by HandleScrollWheel().

|
inline |
Definition at line 166 of file dungeon_object_editor.h.
References yaze::zelda3::DungeonObjectEditor::EditingState::current_layer, and editing_state_.
| absl::StatusOr< std::vector< RoomObject > > yaze::zelda3::DungeonObjectEditor::GetObjectsByLayer | ( | int | layer | ) |
| absl::Status yaze::zelda3::DungeonObjectEditor::MoveObjectToLayer | ( | size_t | object_index, |
| int | layer ) |
| void yaze::zelda3::DungeonObjectEditor::SetCurrentObjectType | ( | int | object_type | ) |
Definition at line 1217 of file dungeon_object_editor.cc.
References yaze::zelda3::DungeonObjectEditor::EditingState::current_object_type, editing_state_, and UpdatePreviewObject().

|
inline |
Definition at line 172 of file dungeon_object_editor.h.
References yaze::zelda3::DungeonObjectEditor::EditingState::current_object_type, and editing_state_.
| absl::StatusOr< std::vector< int > > yaze::zelda3::DungeonObjectEditor::GetAvailableObjectTypes | ( | ) |
| absl::Status yaze::zelda3::DungeonObjectEditor::ValidateObjectType | ( | int | object_type | ) |
| absl::StatusOr< gfx::Bitmap > yaze::zelda3::DungeonObjectEditor::RenderPreview | ( | int | x, |
| int | y ) |
| void yaze::zelda3::DungeonObjectEditor::SetPreviewPosition | ( | int | x, |
| int | y ) |
| void yaze::zelda3::DungeonObjectEditor::UpdatePreview | ( | ) |
| void yaze::zelda3::DungeonObjectEditor::RenderSelectionHighlight | ( | gfx::Bitmap & | canvas | ) |
Definition at line 1474 of file dungeon_object_editor.cc.
References config_, current_room_, yaze::zelda3::Room::GetTileObject(), yaze::zelda3::Room::GetTileObjectCount(), yaze::gfx::Bitmap::height(), yaze::zelda3::DungeonObjectEditor::SelectionState::selected_objects, yaze::zelda3::DungeonObjectEditor::EditorConfig::selection_color, selection_state_, yaze::gfx::Bitmap::SetPixel(), yaze::zelda3::DungeonObjectEditor::EditorConfig::show_selection_highlight, yaze::gfx::Bitmap::width(), and yaze::zelda3::RoomObject::x().
| void yaze::zelda3::DungeonObjectEditor::RenderLayerVisualization | ( | gfx::Bitmap & | canvas | ) |
Definition at line 1508 of file dungeon_object_editor.cc.
References config_, current_room_, yaze::zelda3::Room::GetTileObjects(), yaze::gfx::Bitmap::height(), yaze::zelda3::DungeonObjectEditor::EditorConfig::layer0_color, yaze::zelda3::DungeonObjectEditor::EditorConfig::layer1_color, yaze::zelda3::DungeonObjectEditor::EditorConfig::layer2_color, yaze::gfx::Bitmap::SetPixel(), yaze::zelda3::DungeonObjectEditor::EditorConfig::show_layer_colors, and yaze::gfx::Bitmap::width().

| void yaze::zelda3::DungeonObjectEditor::DrawPropertyUI | ( | ) |
Definition at line 1550 of file dungeon_object_editor.cc.
References BatchChangeObjectLayer(), BatchMoveObjects(), BatchResizeObjects(), yaze::gui::BeginPropertyTable(), ChangeObjectLayer(), ClearSelection(), config_, current_room_, DeleteObject(), DeleteSelectedObjects(), yaze::zelda3::ObjectLayerSemantics::draws_to_both_bgs, DuplicateObject(), yaze::zelda3::EffectiveBgLayerLabel(), yaze::gui::EndPropertyTable(), yaze::zelda3::GetObjectLayerSemantics(), yaze::zelda3::GetObjectName(), yaze::zelda3::GetObjectSubtype(), yaze::editor::AgentUI::GetTheme(), yaze::zelda3::Room::GetTileObject(), yaze::zelda3::Room::GetTileObjectCount(), yaze::gui::HelpMarker(), ICON_MD_ARROW_BACK, ICON_MD_ARROW_DOWNWARD, ICON_MD_ARROW_FORWARD, ICON_MD_ARROW_UPWARD, ICON_MD_ASPECT_RATIO, ICON_MD_CONTENT_COPY, ICON_MD_DELETE, ICON_MD_DELETE_SWEEP, ICON_MD_DESELECT, ICON_MD_LAYERS, ICON_MD_OPEN_WITH, ICON_MD_PALETTE, ICON_MD_PLACE, ICON_MD_SELECT_ALL, ICON_MD_TAG, yaze::zelda3::Room::MarkSaveDirtyForTileObject(), object_changed_callback_, yaze::gui::PropertyRow(), yaze::gui::SectionHeader(), yaze::zelda3::DungeonObjectEditor::SelectionState::selected_objects, selection_state_, yaze::zelda3::DungeonObjectEditor::EditorConfig::show_property_panel, and yaze::zelda3::UsesRoomObjectStream().
| void yaze::zelda3::DungeonObjectEditor::RenderLayerControls | ( | ) |
Definition at line 1867 of file dungeon_object_editor.cc.
References config_, yaze::zelda3::DungeonObjectEditor::EditingState::current_layer, current_room_, editing_state_, yaze::zelda3::Room::GetTileObjects(), yaze::zelda3::DungeonObjectEditor::EditorConfig::layer0_color, yaze::zelda3::DungeonObjectEditor::EditorConfig::layer1_color, yaze::zelda3::DungeonObjectEditor::EditorConfig::layer2_color, and yaze::zelda3::DungeonObjectEditor::EditorConfig::show_layer_colors.

| absl::Status yaze::zelda3::DungeonObjectEditor::HandleDragOperation | ( | int | current_x, |
| int | current_y ) |
Definition at line 1923 of file dungeon_object_editor.cc.
References config_, current_room_, yaze::zelda3::DungeonObjectEditor::SelectionState::drag_start_x, yaze::zelda3::DungeonObjectEditor::SelectionState::drag_start_y, yaze::zelda3::Room::GetTileObject(), yaze::zelda3::Room::GetTileObjectCount(), yaze::zelda3::DungeonObjectEditor::EditorConfig::grid_size, yaze::zelda3::DungeonObjectEditor::SelectionState::is_dragging, yaze::zelda3::Room::MarkSaveDirtyForTileObject(), object_changed_callback_, yaze::zelda3::DungeonObjectEditor::SelectionState::selected_objects, selection_state_, and yaze::zelda3::RoomObject::x().
Referenced by HandleMouseDrag().

| absl::Status yaze::zelda3::DungeonObjectEditor::Undo | ( | ) |
Definition at line 1366 of file dungeon_object_editor.cc.
References ApplyUndoPoint(), CanUndo(), current_room_, yaze::zelda3::DungeonObjectEditor::UndoPoint::editing, editing_state_, yaze::zelda3::Room::GetTileObjects(), yaze::zelda3::DungeonObjectEditor::UndoPoint::objects, redo_history_, yaze::zelda3::DungeonObjectEditor::UndoPoint::selection, selection_state_, yaze::zelda3::DungeonObjectEditor::UndoPoint::timestamp, and undo_history_.

| absl::Status yaze::zelda3::DungeonObjectEditor::Redo | ( | ) |
Definition at line 1387 of file dungeon_object_editor.cc.
References ApplyUndoPoint(), CanRedo(), current_room_, yaze::zelda3::DungeonObjectEditor::UndoPoint::editing, editing_state_, yaze::zelda3::Room::GetTileObjects(), yaze::zelda3::DungeonObjectEditor::UndoPoint::objects, redo_history_, yaze::zelda3::DungeonObjectEditor::UndoPoint::selection, selection_state_, yaze::zelda3::DungeonObjectEditor::UndoPoint::timestamp, and undo_history_.

| bool yaze::zelda3::DungeonObjectEditor::CanUndo | ( | ) | const |
Definition at line 1435 of file dungeon_object_editor.cc.
References undo_history_.
Referenced by Undo().
| bool yaze::zelda3::DungeonObjectEditor::CanRedo | ( | ) | const |
Definition at line 1439 of file dungeon_object_editor.cc.
References redo_history_.
Referenced by Redo().
| void yaze::zelda3::DungeonObjectEditor::ClearHistory | ( | ) |
Definition at line 1443 of file dungeon_object_editor.cc.
References redo_history_, and undo_history_.
Referenced by SetExternalRoom().
| void yaze::zelda3::DungeonObjectEditor::SetROM | ( | Rom * | rom | ) |
Definition at line 2028 of file dungeon_object_editor.cc.
References InitializeEditor(), and rom_.

| void yaze::zelda3::DungeonObjectEditor::SetExternalRoom | ( | Room * | room | ) |
Definition at line 2034 of file dungeon_object_editor.cc.
References ClearHistory(), ClearSelection(), yaze::zelda3::DungeonObjectEditor::EditingState::current_layer, current_room_, editing_state_, yaze::zelda3::DungeonObjectEditor::EditingState::is_editing_position, yaze::zelda3::DungeonObjectEditor::EditingState::is_editing_size, and room_changed_callback_.

| void yaze::zelda3::DungeonObjectEditor::SetConfig | ( | const EditorConfig & | config | ) |
Definition at line 2024 of file dungeon_object_editor.cc.
References config_.
|
inline |
Definition at line 201 of file dungeon_object_editor.h.
References config_.
| void yaze::zelda3::DungeonObjectEditor::SetSnapToGrid | ( | bool | enabled | ) |
| void yaze::zelda3::DungeonObjectEditor::SetGridSize | ( | int | size | ) |
| void yaze::zelda3::DungeonObjectEditor::SetShowGrid | ( | bool | enabled | ) |
| ValidationResult yaze::zelda3::DungeonObjectEditor::ValidateRoom | ( | ) |
Definition at line 1977 of file dungeon_object_editor.cc.
References config_, current_room_, yaze::zelda3::ValidationResult::errors, yaze::zelda3::Room::GetTileObjects(), yaze::zelda3::ValidationResult::is_valid, ObjectsCollide(), yaze::zelda3::DungeonObjectEditor::EditorConfig::validate_objects, yaze::zelda3::DungeonValidator::ValidateRoom(), and validator_.
Referenced by GetValidationErrors(), and SaveRoom().

| absl::Status yaze::zelda3::DungeonObjectEditor::ValidateObject | ( | const RoomObject & | object | ) |
| std::vector< std::string > yaze::zelda3::DungeonObjectEditor::GetValidationErrors | ( | ) |
Definition at line 2002 of file dungeon_object_editor.cc.
References ValidateRoom().

| void yaze::zelda3::DungeonObjectEditor::SetObjectChangedCallback | ( | ObjectChangedCallback | callback | ) |
Definition at line 2010 of file dungeon_object_editor.cc.
References object_changed_callback_.
| void yaze::zelda3::DungeonObjectEditor::SetRoomChangedCallback | ( | RoomChangedCallback | callback | ) |
Definition at line 2015 of file dungeon_object_editor.cc.
References room_changed_callback_.
| void yaze::zelda3::DungeonObjectEditor::SetSelectionChangedCallback | ( | SelectionChangedCallback | callback | ) |
Definition at line 2019 of file dungeon_object_editor.cc.
References selection_changed_callback_.
| absl::Status yaze::zelda3::DungeonObjectEditor::InitializeEditor | ( | ) |
Definition at line 24 of file dungeon_object_editor.cc.
References yaze::zelda3::DungeonObjectEditor::EditorConfig::auto_save, yaze::zelda3::DungeonObjectEditor::EditorConfig::auto_save_interval, config_, yaze::zelda3::DungeonObjectEditor::EditingState::current_layer, yaze::zelda3::DungeonObjectEditor::EditingState::current_mode, yaze::zelda3::DungeonObjectEditor::EditingState::current_object_type, current_room_, editing_state_, yaze::zelda3::DungeonObjectEditor::EditorConfig::grid_size, kDefaultObjectSize, kSelect, yaze::zelda3::ObjectTemplateManager::LoadTemplates(), owned_room_, yaze::zelda3::DungeonObjectEditor::EditingState::preview_size, rom_, yaze::zelda3::DungeonObjectEditor::EditorConfig::show_collision_bounds, yaze::zelda3::DungeonObjectEditor::EditorConfig::show_grid, yaze::zelda3::DungeonObjectEditor::EditorConfig::show_preview, yaze::zelda3::DungeonObjectEditor::EditorConfig::snap_to_grid, template_manager_, and yaze::zelda3::DungeonObjectEditor::EditorConfig::validate_objects.
Referenced by SetROM().

|
inline |
Definition at line 224 of file dungeon_object_editor.h.
References current_room_.
|
inline |
Definition at line 225 of file dungeon_object_editor.h.
References current_room_.
|
inline |
Definition at line 226 of file dungeon_object_editor.h.
References selection_state_.
|
inline |
Definition at line 227 of file dungeon_object_editor.h.
References editing_state_.
|
inline |
Definition at line 228 of file dungeon_object_editor.h.
References current_room_, and yaze::zelda3::Room::GetTileObjects().

|
inline |
Definition at line 231 of file dungeon_object_editor.h.
References current_room_, empty_objects_, and yaze::zelda3::Room::GetTileObjects().

|
private |
Definition at line 1340 of file dungeon_object_editor.cc.
References current_room_, yaze::zelda3::DungeonObjectEditor::UndoPoint::editing, editing_state_, yaze::zelda3::Room::GetTileObjects(), kMaxUndoHistory, yaze::zelda3::DungeonObjectEditor::UndoPoint::objects, redo_history_, yaze::zelda3::DungeonObjectEditor::UndoPoint::selection, selection_state_, yaze::zelda3::DungeonObjectEditor::UndoPoint::timestamp, and undo_history_.
Referenced by AlignSelectedObjects(), BatchChangeObjectLayer(), BatchMoveObjects(), BatchResizeObjects(), ChangeObjectType(), ClearRoom(), DeleteObject(), DeleteSelectedObjects(), DuplicateObject(), HandleMouseDrag(), InsertObject(), InsertTemplate(), LoadRoom(), MoveObject(), PasteObjects(), and ResizeObject().

|
private |
Definition at line 1408 of file dungeon_object_editor.cc.
References current_room_, yaze::zelda3::DungeonObjectEditor::UndoPoint::editing, editing_state_, yaze::zelda3::DungeonObjectEditor::UndoPoint::objects, room_changed_callback_, yaze::zelda3::DungeonObjectEditor::UndoPoint::selection, selection_changed_callback_, selection_state_, yaze::zelda3::Room::SetTileObjects(), and UpdatePreviewObject().
Referenced by Redo(), and Undo().

|
private |
Definition at line 1290 of file dungeon_object_editor.cc.
Referenced by HandleMouseClick(), HandleScrollWheel(), and SelectObject().
|
private |
Definition at line 1302 of file dungeon_object_editor.cc.
|
private |
Definition at line 1311 of file dungeon_object_editor.cc.
References config_, yaze::zelda3::DungeonObjectEditor::EditorConfig::grid_size, and yaze::zelda3::DungeonObjectEditor::EditorConfig::snap_to_grid.
Referenced by InsertObject(), InsertTemplate(), and MoveObject().
|
private |
Definition at line 1225 of file dungeon_object_editor.cc.
References current_room_, yaze::zelda3::Room::GetTileObject(), yaze::zelda3::Room::GetTileObjectCount(), and IsObjectAtPosition().
Referenced by HandleMouseClick(), and SelectObject().

|
private |
|
private |
Definition at line 1242 of file dungeon_object_editor.cc.
Referenced by FindObjectAt().
|
private |
Definition at line 1260 of file dungeon_object_editor.cc.
References yaze::zelda3::RoomObject::size_, yaze::zelda3::RoomObject::x_, and yaze::zelda3::RoomObject::y_.
Referenced by InsertObject(), InsertTemplate(), MoveObject(), and ValidateRoom().
|
private |
|
private |
Definition at line 1326 of file dungeon_object_editor.cc.
References yaze::zelda3::DungeonObjectEditor::EditingState::current_layer, yaze::zelda3::DungeonObjectEditor::EditingState::current_mode, yaze::zelda3::DungeonObjectEditor::EditingState::current_object_type, editing_state_, kInsert, preview_object_, yaze::zelda3::DungeonObjectEditor::EditingState::preview_size, preview_visible_, yaze::zelda3::DungeonObjectEditor::EditingState::preview_x, yaze::zelda3::DungeonObjectEditor::EditingState::preview_y, and rom_.
Referenced by ApplyUndoPoint(), HandleSizeEdit(), SetCurrentLayer(), SetCurrentObjectType(), and SetMode().
|
private |
|
private |
Definition at line 959 of file dungeon_object_editor.cc.
References yaze::zelda3::DungeonObjectEditor::EditingState::current_mode, current_room_, editing_state_, GetNextSize(), yaze::zelda3::Room::GetTileObject(), IsValidSize(), kEdit, kInsert, yaze::zelda3::DungeonObjectEditor::EditingState::preview_size, ResizeObject(), yaze::zelda3::DungeonObjectEditor::SelectionState::selected_objects, selection_state_, and UpdatePreviewObject().
Referenced by HandleScrollWheel().
|
private |
Definition at line 991 of file dungeon_object_editor.cc.
Referenced by HandleSizeEdit().
|
private |
|
private |
Definition at line 1017 of file dungeon_object_editor.cc.
References kMaxObjectSize, and kMinObjectSize.
Referenced by HandleSizeEdit().
|
private |
Definition at line 265 of file dungeon_object_editor.h.
Referenced by InitializeEditor(), InsertObject(), InsertTemplate(), LoadRoom(), SetROM(), and UpdatePreviewObject().
|
private |
Definition at line 266 of file dungeon_object_editor.h.
Referenced by AddToSelection(), AlignSelectedObjects(), ApplyUndoPoint(), BatchChangeObjectLayer(), BatchMoveObjects(), BatchResizeObjects(), ChangeObjectLayer(), ChangeObjectType(), ClearRoom(), CopySelectedObjects(), CreateTemplateFromSelection(), CreateUndoPoint(), DeleteObject(), DeleteSelectedObjects(), DrawPropertyUI(), DuplicateObject(), FindObjectAt(), GetMutableRoom(), GetObjectCount(), GetObjects(), GetRoom(), HandleDragOperation(), HandleMouseClick(), HandleMouseDrag(), HandleMouseRelease(), HandleScrollWheel(), HandleSizeEdit(), InitializeEditor(), InsertObject(), InsertTemplate(), LoadRoom(), MoveObject(), PasteObjects(), Redo(), RenderLayerControls(), RenderLayerVisualization(), RenderSelectionHighlight(), ResizeObject(), SaveRoom(), SelectObject(), SetExternalRoom(), Undo(), and ValidateRoom().
|
private |
Definition at line 267 of file dungeon_object_editor.h.
Referenced by InitializeEditor(), and LoadRoom().
|
private |
Definition at line 269 of file dungeon_object_editor.h.
Referenced by AddToSelection(), AlignSelectedObjects(), ApplyUndoPoint(), BatchChangeObjectLayer(), ClearSelection(), CreateTemplateFromSelection(), CreateUndoPoint(), DeleteObject(), DeleteSelectedObjects(), DrawPropertyUI(), GetSelection(), HandleDragOperation(), HandleMouseDrag(), HandleMouseRelease(), HandleScrollWheel(), HandleSizeEdit(), InsertObject(), InsertTemplate(), Redo(), RenderSelectionHighlight(), SelectObject(), and Undo().
|
private |
Definition at line 270 of file dungeon_object_editor.h.
Referenced by ApplyUndoPoint(), CreateUndoPoint(), GetCurrentLayer(), GetCurrentObjectType(), GetEditingState(), GetMode(), HandleMouseClick(), HandleScrollWheel(), HandleSizeEdit(), InitializeEditor(), LoadRoom(), Redo(), RenderLayerControls(), SetCurrentLayer(), SetCurrentObjectType(), SetExternalRoom(), SetMode(), Undo(), and UpdatePreviewObject().
|
private |
Definition at line 271 of file dungeon_object_editor.h.
Referenced by DrawPropertyUI(), GetConfig(), HandleDragOperation(), InitializeEditor(), InsertObject(), InsertTemplate(), MoveObject(), RenderLayerControls(), RenderLayerVisualization(), RenderSelectionHighlight(), SaveRoom(), SetConfig(), SnapToGrid(), and ValidateRoom().
|
private |
Definition at line 273 of file dungeon_object_editor.h.
Referenced by CanUndo(), ClearHistory(), CreateUndoPoint(), Redo(), and Undo().
|
private |
Definition at line 274 of file dungeon_object_editor.h.
Referenced by CanRedo(), ClearHistory(), CreateUndoPoint(), Redo(), and Undo().
|
staticconstexprprivate |
Definition at line 275 of file dungeon_object_editor.h.
Referenced by CreateUndoPoint().
|
private |
Definition at line 278 of file dungeon_object_editor.h.
Referenced by UpdatePreviewObject().
|
private |
Definition at line 279 of file dungeon_object_editor.h.
Referenced by UpdatePreviewObject().
|
private |
Definition at line 282 of file dungeon_object_editor.h.
Referenced by AlignSelectedObjects(), BatchChangeObjectLayer(), BatchMoveObjects(), BatchResizeObjects(), ChangeObjectType(), DrawPropertyUI(), HandleDragOperation(), InsertObject(), MoveObject(), ResizeObject(), and SetObjectChangedCallback().
|
private |
Definition at line 283 of file dungeon_object_editor.h.
Referenced by AlignSelectedObjects(), ApplyUndoPoint(), BatchChangeObjectLayer(), BatchMoveObjects(), BatchResizeObjects(), ChangeObjectType(), ClearRoom(), DeleteObject(), DeleteSelectedObjects(), DuplicateObject(), HandleMouseRelease(), InsertObject(), InsertTemplate(), LoadRoom(), MoveObject(), PasteObjects(), ResizeObject(), SetExternalRoom(), and SetRoomChangedCallback().
|
private |
Definition at line 284 of file dungeon_object_editor.h.
Referenced by AddToSelection(), ApplyUndoPoint(), BatchChangeObjectLayer(), ClearSelection(), DeleteObject(), InsertObject(), SelectObject(), and SetSelectionChangedCallback().
|
staticconstexprprivate |
Definition at line 287 of file dungeon_object_editor.h.
Referenced by IsValidSize().
|
staticconstexprprivate |
Definition at line 288 of file dungeon_object_editor.h.
Referenced by BatchResizeObjects(), InsertObject(), IsValidSize(), and ResizeObject().
|
staticconstexprprivate |
Definition at line 289 of file dungeon_object_editor.h.
Referenced by InitializeEditor().
|
staticconstexprprivate |
Definition at line 290 of file dungeon_object_editor.h.
Referenced by HandleScrollWheel(), and SetCurrentLayer().
|
staticconstexprprivate |
Definition at line 291 of file dungeon_object_editor.h.
Referenced by BatchChangeObjectLayer(), ChangeObjectLayer(), HandleScrollWheel(), InsertObject(), and SetCurrentLayer().
|
private |
Definition at line 293 of file dungeon_object_editor.h.
Referenced by ValidateRoom().
|
private |
Definition at line 294 of file dungeon_object_editor.h.
Referenced by CreateTemplateFromSelection(), GetTemplates(), InitializeEditor(), and InsertTemplate().
|
private |
Definition at line 297 of file dungeon_object_editor.h.
Referenced by GetObjects().
|
private |
Definition at line 300 of file dungeon_object_editor.h.
Referenced by CopySelectedObjects(), and PasteObjects().