yaze 0.3.2
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
yaze::editor::DungeonEditorV2 Class Reference

DungeonEditorV2 - Simplified dungeon editor using component delegation. More...

#include <dungeon_editor_v2.h>

Inheritance diagram for yaze::editor::DungeonEditorV2:

Classes

struct  PendingCollisionUndo
 
struct  PendingSwap
 
struct  PendingUndo
 
struct  PendingWaterFillUndo
 
struct  PendingWorkflowMode
 

Public Member Functions

 DungeonEditorV2 (Rom *rom=nullptr)
 
 ~DungeonEditorV2 () override
 
void SetGameData (zelda3::GameData *game_data) override
 
void Initialize () override
 
absl::Status Load () override
 
absl::Status Update () override
 
absl::Status Undo () override
 
absl::Status Redo () override
 
absl::Status Cut () override
 
absl::Status Copy () override
 
absl::Status Paste () override
 
absl::Status Find () override
 
absl::Status Save () override
 
void ContributeStatus (StatusBar *status_bar) override
 
absl::Status SaveRoom (int room_id)
 
int LoadedRoomCount () const
 
int TotalRoomCount () const
 
std::vector< std::pair< uint32_t, uint32_t > > CollectWriteRanges () const
 
void SetRom (Rom *rom)
 
Romrom () const
 
void add_room (int room_id)
 
void FocusRoom (int room_id)
 
void SelectObject (int obj_id)
 
void SetAgentMode (bool enabled)
 
bool IsRomLoaded () const override
 
std::string GetRomStatus () const override
 
void OpenWindow (const std::string &window_id)
 
void SetWorkbenchWorkflowMode (bool enabled, bool show_toast=true)
 
void QueueWorkbenchWorkflowMode (bool enabled, bool show_toast=true)
 
void ToggleWorkbenchWorkflowMode (bool show_toast=true)
 
bool IsWorkbenchWorkflowEnabled () const
 
int current_room_id () const
 
int * mutable_current_room_id ()
 
const ImVector< int > & active_rooms () const
 
DungeonRoomStorerooms ()
 
const DungeonRoomStorerooms () const
 
gfx::IRendererrenderer () const
 
ObjectSelectorContentobject_selector_panel () const
 
ObjectSelectorContentobject_editor_panel () const
 
ObjectEditorContentobject_editor_content () const
 
DoorEditorContentdoor_editor_panel () const
 
const std::deque< int > & GetRecentRooms () const
 Get the list of recently visited room IDs.
 
- Public Member Functions inherited from yaze::editor::Editor
 Editor ()=default
 
virtual ~Editor ()=default
 
virtual void SetDependencies (const EditorDependencies &deps)
 
virtual std::string GetUndoDescription () const
 
virtual std::string GetRedoDescription () const
 
const UndoManagerundo_manager () const
 
virtual absl::Status Clear ()
 
EditorType type () const
 
bool * active ()
 
void set_active (bool active)
 
void toggle_active ()
 
Romrom () const
 
zelda3::GameDatagame_data () const
 
EditorContext context () const
 
bool HasContext () const
 

Static Public Attributes

static constexpr const char * kRoomSelectorId = "dungeon.room_selector"
 
static constexpr const char * kEntranceListId = "dungeon.entrance_list"
 
static constexpr const char * kRoomMatrixId = "dungeon.room_matrix"
 
static constexpr const char * kRoomGraphicsId = "dungeon.room_graphics"
 
static constexpr const char * kObjectSelectorId = "dungeon.object_selector"
 
static constexpr const char * kObjectEditorId = "dungeon.object_editor"
 
static constexpr const char * kObjectToolsId = kObjectSelectorId
 
static constexpr const char * kDoorEditorId = "dungeon.door_editor"
 
static constexpr const char * kPaletteEditorId = "dungeon.palette_editor"
 

Private Member Functions

void DrawRoomPanels ()
 
void DrawRoomTab (int room_id)
 
void ProcessDeferredTextures ()
 
void OnRoomSelected (int room_id, bool request_focus=true)
 
void OnRoomSelected (int room_id, RoomSelectionIntent intent)
 
void OnEntranceSelected (int entrance_id)
 
void SyncPanelsToRoom (int room_id)
 
void ShowRoomPanel (int room_id)
 
void SaveAllRooms ()
 
void HandleObjectPlaced (const zelda3::RoomObject &obj)
 
void OpenGraphicsEditorForObject (int room_id, const zelda3::RoomObject &object)
 
DungeonCanvasViewerGetViewerForRoom (int room_id)
 
DungeonCanvasViewerGetWorkbenchViewer ()
 
DungeonCanvasViewerGetWorkbenchCompareViewer ()
 
void TouchViewerLru (int room_id)
 
void RemoveViewerFromLru (int room_id)
 
absl::Status SaveRoomData (int room_id)
 
void BeginUndoSnapshot (int room_id)
 
void FinalizeUndoAction (int room_id)
 
void RestoreRoomObjects (int room_id, const std::vector< zelda3::RoomObject > &objects)
 
void BeginCollisionUndoSnapshot (int room_id)
 
void FinalizeCollisionUndoAction (int room_id)
 
void RestoreRoomCustomCollision (int room_id, const zelda3::CustomCollisionMap &map)
 
void BeginWaterFillUndoSnapshot (int room_id)
 
void FinalizeWaterFillUndoAction (int room_id)
 
void RestoreRoomWaterFill (int room_id, const WaterFillSnapshot &snap)
 
void SwapRoomInPanel (int old_room_id, int new_room_id)
 
void ProcessPendingSwap ()
 
void ProcessPendingWorkflowMode ()
 
int GetOrCreateRoomPanelSlotId (int room_id)
 
void ReleaseRoomPanelSlotId (int room_id)
 

Static Private Member Functions

static bool IsValidRoomId (int room_id)
 

Private Attributes

gfx::IRendererrenderer_ = nullptr
 
Romrom_
 
zelda3::GameDatagame_data_ = nullptr
 
DungeonRoomStore rooms_
 
std::array< zelda3::RoomEntrance, 0x8C > entrances_
 
int current_entrance_id_ = 0
 
ImVector< int > active_rooms_
 
int current_room_id_ = 0
 
std::deque< int > recent_rooms_
 
std::vector< int > pinned_rooms_
 
class DungeonWorkbenchContentworkbench_panel_ = nullptr
 
gfx::SnesPalette current_palette_
 
gfx::PaletteGroup current_palette_group_
 
uint64_t current_palette_id_ = 0
 
uint64_t current_palette_group_id_ = 0
 
DungeonRoomLoader room_loader_
 
DungeonRoomSelector room_selector_
 
util::LruCache< int, std::unique_ptr< DungeonCanvasViewer > > room_viewers_
 
std::unique_ptr< DungeonCanvasViewerworkbench_viewer_
 
std::unique_ptr< DungeonCanvasViewerworkbench_compare_viewer_
 
gui::PaletteEditorWidget palette_editor_
 
ObjectSelectorContentobject_selector_panel_ = nullptr
 
ObjectEditorContentobject_editor_content_ = nullptr
 
DoorEditorContentdoor_editor_panel_ = nullptr
 
RoomGraphicsContentroom_graphics_panel_ = nullptr
 
class SpriteEditorPanelsprite_editor_panel_ = nullptr
 
class ItemEditorPanelitem_editor_panel_ = nullptr
 
class MinecartTrackEditorPanelminecart_track_editor_panel_ = nullptr
 
class RoomTagEditorPanelroom_tag_editor_panel_ = nullptr
 
class CustomCollisionPanelcustom_collision_panel_ = nullptr
 
class WaterFillPanelwater_fill_panel_ = nullptr
 
ObjectTileEditorPanelobject_tile_editor_panel_ = nullptr
 
class DungeonSettingsPaneldungeon_settings_panel_ = nullptr
 
OverlayManagerPaneloverlay_manager_panel_ = nullptr
 
std::unique_ptr< ObjectSelectorContentowned_object_selector_panel_
 
std::unique_ptr< ObjectEditorContentowned_object_editor_content_
 
std::unique_ptr< DoorEditorContentowned_door_editor_panel_
 
std::unique_ptr< zelda3::DungeonEditorSystemdungeon_editor_system_
 
std::unique_ptr< emu::render::EmulatorRenderServicerender_service_
 
bool is_loaded_ = false
 
ImGuiWindowClass room_window_class_
 
ImGuiID room_dock_id_ = 0
 
std::unordered_map< int, std::shared_ptr< gui::PanelWindow > > room_cards_
 
int next_room_panel_slot_id_ = 1
 
std::unordered_map< int, int > room_panel_slot_ids_
 
PendingUndo pending_undo_
 
bool has_pending_undo_ = false
 
PendingCollisionUndo pending_collision_undo_
 
PendingWaterFillUndo pending_water_fill_undo_
 
PendingSwap pending_swap_
 
PendingWorkflowMode pending_workflow_mode_
 

Static Private Attributes

static constexpr size_t kMaxRecentRooms = 10
 
static constexpr int kMaxCachedViewers = 20
 

Friends

class DungeonEditorV2RomSafetyTest_UndoSnapshotLeakDetection_Test
 
class DungeonEditorV2RomSafetyTest_ViewerCacheLRUEviction_Test
 
class DungeonEditorV2RomSafetyTest_ViewerCacheNeverEvictsActiveRooms_Test
 
class DungeonEditorV2RomSafetyTest_ViewerCacheLRUAccessOrderUpdate_Test
 

Additional Inherited Members

- Protected Member Functions inherited from yaze::editor::Editor
std::string MakePanelTitle (const std::string &base_title) const
 
std::string MakeWindowId (const std::string &base_id) const
 
template<typename T >
absl::StatusOr< T > SafeRomAccess (std::function< T()> accessor, const std::string &operation="") const
 
- Protected Attributes inherited from yaze::editor::Editor
bool active_ = false
 
EditorType type_
 
EditorDependencies dependencies_
 
UndoManager undo_manager_
 

Detailed Description

DungeonEditorV2 - Simplified dungeon editor using component delegation.

This is a drop-in replacement for DungeonEditor that properly delegates to the component system instead of implementing everything inline.

Architecture:

The editor acts as a coordinator, not an implementer.

Ownership Model

OWNED by DungeonEditorV2 (use unique_ptr or direct member):

  • rooms_ (std::array) - full ownership
  • entrances_ (std::array) - full ownership
  • room_viewers_ (map of unique_ptr) - owns canvas viewers per room
  • dungeon_editor_system_ (unique_ptr) - owns editor system
  • render_service_ (unique_ptr) - owns emulator render service
  • room_loader_, room_selector_, palette_editor_ - direct members

EXTERNALLY OWNED (raw pointers, lifetime managed elsewhere):

OWNED BY WorkspaceWindowManager (registered EditorPanels):

  • object_editor_panel_ - registered via RegisterWindowContent()
  • room_graphics_panel_ - registered via RegisterWindowContent()
  • sprite_editor_panel_ - registered via RegisterWindowContent()
  • item_editor_panel_ - registered via RegisterWindowContent()

Panel pointers are stored for convenience access but should NOT be deleted by this class. WorkspaceWindowManager owns them.

Definition at line 88 of file dungeon_editor_v2.h.

Constructor & Destructor Documentation

◆ DungeonEditorV2()

yaze::editor::DungeonEditorV2::DungeonEditorV2 ( Rom * rom = nullptr)
inlineexplicit

Definition at line 90 of file dungeon_editor_v2.h.

References yaze::zelda3::CreateDungeonEditorSystem(), dungeon_editor_system_, yaze::editor::kDungeon, rom(), and yaze::editor::Editor::type_.

Here is the call graph for this function:

◆ ~DungeonEditorV2()

Member Function Documentation

◆ SetGameData()

◆ Initialize()

void yaze::editor::DungeonEditorV2::Initialize ( )
overridevirtual

Implements yaze::editor::Editor.

Definition at line 185 of file dungeon_editor_v2.cc.

References active_rooms_, yaze::editor::UndoManager::CanRedo(), yaze::editor::UndoManager::CanUndo(), yaze::zelda3::CreateDungeonEditorSystem(), current_entrance_id_, current_room_id_, yaze::editor::Editor::dependencies_, dungeon_editor_system_, entrances_, game_data_, yaze::core::FeatureFlags::get(), yaze::editor::UndoManager::GetRedoDescription(), yaze::editor::UndoManager::GetUndoDescription(), GetWorkbenchCompareViewer(), GetWorkbenchViewer(), yaze::project::YazeProject::hack_manifest, ICON_MD_CATEGORY, ICON_MD_DOOR_FRONT, ICON_MD_GRID_VIEW, ICON_MD_IMAGE, ICON_MD_LABEL, ICON_MD_LIST, ICON_MD_MAP, ICON_MD_PALETTE, ICON_MD_TUNE, ICON_MD_WORKSPACES, yaze::Rom::is_loaded(), kDoorEditorId, kEntranceListId, yaze::editor::kError, kObjectEditorId, kObjectSelectorId, kPaletteEditorId, kRoomGraphicsId, kRoomMatrixId, kRoomSelectorId, yaze::editor::kSuccess, LOG_ERROR, OnEntranceSelected(), OnRoomSelected(), OpenWindow(), yaze::editor::EditorDependencies::project, QueueWorkbenchWorkflowMode(), recent_rooms_, Redo(), yaze::editor::WorkspaceWindowManager::RegisterPanelAlias(), yaze::editor::EditorDependencies::renderer, renderer_, yaze::editor::EditorDependencies::rom, rom_, room_selector_, room_window_class_, rooms_, SaveRoom(), SetRom(), yaze::editor::DungeonRoomSelector::SetRoomSelectedWithIntentCallback(), yaze::editor::DungeonWorkbenchContent::SetUndoRedoProvider(), SetWorkbenchWorkflowMode(), yaze::editor::ToastManager::Show(), SwapRoomInPanel(), yaze::editor::EditorDependencies::toast_manager, Undo(), yaze::editor::Editor::undo_manager_, yaze::editor::UndoManager::UndoStackSize(), yaze::editor::EditorDependencies::window_manager, and workbench_panel_.

Referenced by yaze::test::DungeonEditorTestSuite::RunObjectManipulationTest(), and yaze::test::DungeonEditorTestSuite::RunRoomSaveTest().

◆ Load()

absl::Status yaze::editor::DungeonEditorV2::Load ( )
overridevirtual

Implements yaze::editor::Editor.

Definition at line 467 of file dungeon_editor_v2.cc.

References active_rooms_, yaze::zelda3::CustomObjectManager::AddObjectFile(), ASSIGN_OR_RETURN, yaze::zelda3::Room::ClearWaterFillDirty(), yaze::zelda3::Room::ClearWaterFillZone(), yaze::project::YazeProject::code_folder, yaze::gfx::CreatePaletteGroupFromLargePalette(), current_palette_, current_palette_group_, current_palette_group_id_, current_palette_id_, current_room_id_, custom_collision_panel_, yaze::project::YazeProject::custom_object_files, yaze::project::YazeProject::custom_objects_folder, yaze::editor::Editor::dependencies_, door_editor_panel_, dungeon_editor_system_, yaze::gfx::PaletteGroupMap::dungeon_main, dungeon_settings_panel_, entrances_, yaze::editor::DungeonRoomStore::ForEachMaterialized(), yaze::editor::Editor::game_data(), yaze::gfx::PaletteManager::Get(), yaze::core::FeatureFlags::get(), yaze::zelda3::CustomObjectManager::Get(), yaze::zelda3::ObjectDimensionTable::Get(), yaze::project::YazeProject::GetAbsolutePath(), yaze::zelda3::CustomObjectManager::Initialize(), yaze::gfx::PaletteManager::Initialize(), yaze::gui::PaletteEditorWidget::Initialize(), yaze::editor::DungeonObjectSelector::InvalidatePreviewCache(), yaze::Rom::is_loaded(), is_loaded_, IsWorkbenchWorkflowEnabled(), item_editor_panel_, yaze::editor::kInfo, kObjectEditorId, yaze::editor::kWarning, yaze::zelda3::LoadLegacyWaterGateZones(), yaze::editor::DungeonRoomLoader::LoadRoomEntrances(), yaze::zelda3::LoadWaterFillTable(), LOG_WARN, minecart_track_editor_panel_, object_editor_content_, yaze::editor::ObjectSelectorContent::object_selector(), object_selector_panel_, object_tile_editor_panel_, OnRoomSelected(), yaze::editor::ObjectTileEditorPanel::OpenForObject(), OpenWindow(), overlay_manager_panel_, owned_door_editor_panel_, owned_object_editor_content_, owned_object_selector_panel_, palette_editor_, yaze::zelda3::GameData::palette_groups, yaze::editor::EditorDependencies::project, yaze::editor::WorkspaceWindowManager::RegisterWindowContent(), renderer_, RETURN_IF_ERROR, rom_, room_graphics_panel_, room_loader_, room_selector_, room_tag_editor_panel_, room_viewers_, rooms_, yaze::project::YazeProject::Save(), SaveAllRooms(), SaveRoom(), yaze::editor::DungeonRoomSelector::set_active_rooms(), yaze::editor::DungeonRoomSelector::set_entrances(), yaze::editor::DungeonRoomSelector::set_rooms(), yaze::zelda3::Room::set_water_fill_sram_bit_mask(), yaze::editor::ObjectSelectorContent::SetCurrentPaletteGroup(), yaze::editor::RoomGraphicsContent::SetCurrentPaletteGroup(), yaze::editor::DungeonObjectSelector::SetCustomObjectsFolder(), yaze::gui::PaletteEditorWidget::SetDungeonRenderPaletteMode(), yaze::editor::ObjectSelectorContent::SetGameData(), yaze::gui::PaletteEditorWidget::SetOnPaletteChanged(), yaze::editor::DungeonObjectSelector::SetProject(), yaze::editor::MinecartTrackEditorPanel::SetProject(), yaze::editor::MinecartTrackEditorPanel::SetProjectRoot(), yaze::editor::MinecartTrackEditorPanel::SetRom(), yaze::editor::MinecartTrackEditorPanel::SetRoomNavigationCallback(), yaze::editor::MinecartTrackEditorPanel::SetRooms(), yaze::editor::DungeonRoomSelector::SetRoomSelectedCallback(), yaze::editor::DungeonRoomSelector::SetRoomSelectedWithIntentCallback(), yaze::editor::DungeonObjectSelector::SetTileEditorPanel(), yaze::zelda3::Room::SetWaterFillTile(), yaze::editor::ToastManager::Show(), yaze::editor::DungeonRoomStore::size(), sprite_editor_panel_, yaze::project::YazeProject::symbols_filename, yaze::editor::EditorDependencies::toast_manager, water_fill_panel_, yaze::editor::EditorDependencies::window_manager, workbench_compare_viewer_, and workbench_viewer_.

◆ Update()

◆ Undo()

absl::Status yaze::editor::DungeonEditorV2::Undo ( )
overridevirtual

Implements yaze::editor::Editor.

Definition at line 2418 of file dungeon_editor_v2.cc.

Referenced by Initialize().

◆ Redo()

absl::Status yaze::editor::DungeonEditorV2::Redo ( )
overridevirtual

Implements yaze::editor::Editor.

Definition at line 2432 of file dungeon_editor_v2.cc.

Referenced by Initialize().

◆ Cut()

absl::Status yaze::editor::DungeonEditorV2::Cut ( )
overridevirtual

Implements yaze::editor::Editor.

Definition at line 2446 of file dungeon_editor_v2.cc.

◆ Copy()

absl::Status yaze::editor::DungeonEditorV2::Copy ( )
overridevirtual

Implements yaze::editor::Editor.

Definition at line 2454 of file dungeon_editor_v2.cc.

◆ Paste()

absl::Status yaze::editor::DungeonEditorV2::Paste ( )
overridevirtual

Implements yaze::editor::Editor.

Definition at line 2461 of file dungeon_editor_v2.cc.

◆ Find()

absl::Status yaze::editor::DungeonEditorV2::Find ( )
inlineoverridevirtual

Implements yaze::editor::Editor.

Definition at line 129 of file dungeon_editor_v2.h.

◆ Save()

◆ ContributeStatus()

◆ SaveRoom()

◆ LoadedRoomCount()

int yaze::editor::DungeonEditorV2::LoadedRoomCount ( ) const

Definition at line 1254 of file dungeon_editor_v2.cc.

References yaze::editor::DungeonRoomStore::LoadedCount(), and rooms_.

Referenced by ContributeStatus().

Here is the call graph for this function:

◆ TotalRoomCount()

int yaze::editor::DungeonEditorV2::TotalRoomCount ( ) const
inline

Definition at line 134 of file dungeon_editor_v2.h.

References rooms_, and yaze::editor::DungeonRoomStore::size().

Referenced by ContributeStatus().

Here is the call graph for this function:

◆ CollectWriteRanges()

◆ SetRom()

void yaze::editor::DungeonEditorV2::SetRom ( Rom * rom)
inline

Definition at line 142 of file dungeon_editor_v2.h.

References rom(), rom_, room_loader_, room_selector_, room_viewers_, rooms_, yaze::editor::DungeonRoomSelector::SetRom(), and yaze::editor::DungeonRoomStore::SetRom().

Referenced by Initialize().

Here is the call graph for this function:

◆ rom()

Rom * yaze::editor::DungeonEditorV2::rom ( ) const
inline

Definition at line 155 of file dungeon_editor_v2.h.

References rom_.

Referenced by DungeonEditorV2(), and SetRom().

◆ add_room()

void yaze::editor::DungeonEditorV2::add_room ( int room_id)

Definition at line 1830 of file dungeon_editor_v2.cc.

References OnRoomSelected().

Referenced by yaze::test::DungeonEditorTestSuite::RunObjectManipulationTest(), and yaze::test::DungeonEditorTestSuite::RunRoomSaveTest().

Here is the call graph for this function:

◆ FocusRoom()

void yaze::editor::DungeonEditorV2::FocusRoom ( int room_id)

Definition at line 1834 of file dungeon_editor_v2.cc.

References room_cards_.

Referenced by OnRoomSelected().

◆ SelectObject()

void yaze::editor::DungeonEditorV2::SelectObject ( int obj_id)

Definition at line 1841 of file dungeon_editor_v2.cc.

References kObjectSelectorId, object_selector_panel_, OpenWindow(), and yaze::editor::ObjectSelectorContent::SelectObject().

Here is the call graph for this function:

◆ SetAgentMode()

◆ IsRomLoaded()

bool yaze::editor::DungeonEditorV2::IsRomLoaded ( ) const
inlineoverridevirtual

Reimplemented from yaze::editor::Editor.

Definition at line 166 of file dungeon_editor_v2.h.

References yaze::Rom::is_loaded(), and rom_.

Here is the call graph for this function:

◆ GetRomStatus()

std::string yaze::editor::DungeonEditorV2::GetRomStatus ( ) const
inlineoverridevirtual

Reimplemented from yaze::editor::Editor.

Definition at line 167 of file dungeon_editor_v2.h.

References yaze::Rom::is_loaded(), rom_, and yaze::Rom::title().

Here is the call graph for this function:

◆ OpenWindow()

void yaze::editor::DungeonEditorV2::OpenWindow ( const std::string & window_id)
inline

◆ SetWorkbenchWorkflowMode()

◆ QueueWorkbenchWorkflowMode()

◆ ToggleWorkbenchWorkflowMode()

void yaze::editor::DungeonEditorV2::ToggleWorkbenchWorkflowMode ( bool show_toast = true)

Definition at line 1458 of file dungeon_editor_v2.cc.

References IsWorkbenchWorkflowEnabled(), and QueueWorkbenchWorkflowMode().

Referenced by ContributeStatus(), and Update().

Here is the call graph for this function:

◆ IsWorkbenchWorkflowEnabled()

◆ current_room_id()

int yaze::editor::DungeonEditorV2::current_room_id ( ) const
inline

Definition at line 202 of file dungeon_editor_v2.h.

References yaze::editor::DungeonRoomSelector::current_room_id(), and room_selector_.

Referenced by ContributeStatus().

Here is the call graph for this function:

◆ mutable_current_room_id()

int * yaze::editor::DungeonEditorV2::mutable_current_room_id ( )
inline

Definition at line 203 of file dungeon_editor_v2.h.

References current_room_id_.

◆ active_rooms()

const ImVector< int > & yaze::editor::DungeonEditorV2::active_rooms ( ) const
inline

Definition at line 204 of file dungeon_editor_v2.h.

References yaze::editor::DungeonRoomSelector::active_rooms(), and room_selector_.

Here is the call graph for this function:

◆ rooms() [1/2]

DungeonRoomStore & yaze::editor::DungeonEditorV2::rooms ( )
inline

◆ rooms() [2/2]

const DungeonRoomStore & yaze::editor::DungeonEditorV2::rooms ( ) const
inline

Definition at line 208 of file dungeon_editor_v2.h.

References rooms_.

◆ renderer()

gfx::IRenderer * yaze::editor::DungeonEditorV2::renderer ( ) const
inline

Definition at line 209 of file dungeon_editor_v2.h.

References renderer_.

◆ object_selector_panel()

ObjectSelectorContent * yaze::editor::DungeonEditorV2::object_selector_panel ( ) const
inline

Definition at line 210 of file dungeon_editor_v2.h.

References object_selector_panel_.

◆ object_editor_panel()

ObjectSelectorContent * yaze::editor::DungeonEditorV2::object_editor_panel ( ) const
inline

Definition at line 213 of file dungeon_editor_v2.h.

References object_selector_panel_.

◆ object_editor_content()

ObjectEditorContent * yaze::editor::DungeonEditorV2::object_editor_content ( ) const
inline

Definition at line 216 of file dungeon_editor_v2.h.

References object_editor_content_.

◆ door_editor_panel()

DoorEditorContent * yaze::editor::DungeonEditorV2::door_editor_panel ( ) const
inline

Definition at line 219 of file dungeon_editor_v2.h.

References door_editor_panel_.

◆ GetRecentRooms()

const std::deque< int > & yaze::editor::DungeonEditorV2::GetRecentRooms ( ) const
inline

Get the list of recently visited room IDs.

Returns
Deque of room IDs, most recent first (max 10 entries)

Definition at line 225 of file dungeon_editor_v2.h.

References recent_rooms_.

◆ DrawRoomPanels()

◆ DrawRoomTab()

◆ ProcessDeferredTextures()

void yaze::editor::DungeonEditorV2::ProcessDeferredTextures ( )
private

Definition at line 1864 of file dungeon_editor_v2.cc.

References yaze::gfx::Arena::Get(), yaze::gfx::Arena::ProcessTextureQueue(), and renderer_.

Here is the call graph for this function:

◆ OnRoomSelected() [1/2]

void yaze::editor::DungeonEditorV2::OnRoomSelected ( int room_id,
bool request_focus = true )
private

Definition at line 1682 of file dungeon_editor_v2.cc.

References active_rooms_, yaze::gfx::CreatePaletteGroupFromLargePalette(), current_palette_, current_palette_group_, current_palette_group_id_, current_palette_id_, current_room_id_, yaze::editor::Editor::dependencies_, dungeon_editor_system_, yaze::gfx::PaletteGroupMap::dungeon_main, FocusRoom(), yaze::editor::Editor::game_data(), yaze::zelda3::GetRoomLabel(), GetViewerForRoom(), ICON_MD_GRID_ON, yaze::editor::WorkspaceWindowManager::IsWindowOpen(), IsWorkbenchWorkflowEnabled(), kMaxRecentRooms, yaze::editor::DungeonRoomLoader::LoadRoom(), LOG_WARN, yaze::editor::DungeonWorkbenchContent::NotifyRoomChanged(), object_selector_panel_, yaze::editor::WorkspaceWindowManager::OpenWindow(), palette_editor_, yaze::zelda3::GameData::palette_groups, recent_rooms_, yaze::editor::WorkspaceWindowManager::RegisterWindow(), room_graphics_panel_, room_loader_, room_selector_, rooms_, yaze::editor::DungeonRoomSelector::set_active_rooms(), yaze::editor::DungeonRoomSelector::set_current_room_id(), yaze::editor::ObjectSelectorContent::SetCurrentPaletteGroup(), yaze::editor::RoomGraphicsContent::SetCurrentPaletteGroup(), yaze::gui::PaletteEditorWidget::SetCurrentPaletteId(), yaze::editor::DungeonRoomStore::size(), SyncPanelsToRoom(), yaze::editor::EditorDependencies::window_manager, and workbench_panel_.

Referenced by add_room(), DrawRoomPanels(), Initialize(), Load(), OnEntranceSelected(), OnRoomSelected(), ProcessPendingSwap(), and Update().

◆ OnRoomSelected() [2/2]

◆ OnEntranceSelected()

void yaze::editor::DungeonEditorV2::OnEntranceSelected ( int entrance_id)
private

Definition at line 1805 of file dungeon_editor_v2.cc.

References entrances_, and OnRoomSelected().

Referenced by Initialize().

Here is the call graph for this function:

◆ SyncPanelsToRoom()

◆ ShowRoomPanel()

void yaze::editor::DungeonEditorV2::ShowRoomPanel ( int room_id)
private

Definition at line 2597 of file dungeon_editor_v2.cc.

References yaze::zelda3::GetRoomLabel(), ICON_MD_GRID_ON, and yaze::gui::MakePanelTitle().

Referenced by DrawRoomPanels(), OnRoomSelected(), and SetWorkbenchWorkflowMode().

Here is the call graph for this function:

◆ SaveAllRooms()

void yaze::editor::DungeonEditorV2::SaveAllRooms ( )
private

◆ HandleObjectPlaced()

◆ OpenGraphicsEditorForObject()

◆ GetViewerForRoom()

DungeonCanvasViewer * yaze::editor::DungeonEditorV2::GetViewerForRoom ( int room_id)
private

◆ GetWorkbenchViewer()

DungeonCanvasViewer * yaze::editor::DungeonEditorV2::GetWorkbenchViewer ( )
private

Definition at line 2261 of file dungeon_editor_v2.cc.

References LOG_ERROR.

Referenced by GetViewerForRoom(), and Initialize().

◆ GetWorkbenchCompareViewer()

DungeonCanvasViewer * yaze::editor::DungeonEditorV2::GetWorkbenchCompareViewer ( )
private

Definition at line 2386 of file dungeon_editor_v2.cc.

Referenced by Initialize().

◆ TouchViewerLru()

void yaze::editor::DungeonEditorV2::TouchViewerLru ( int room_id)
private

Definition at line 2070 of file dungeon_editor_v2.cc.

References room_viewers_.

◆ RemoveViewerFromLru()

void yaze::editor::DungeonEditorV2::RemoveViewerFromLru ( int room_id)
private

Definition at line 2074 of file dungeon_editor_v2.cc.

◆ SaveRoomData()

◆ BeginUndoSnapshot()

void yaze::editor::DungeonEditorV2::BeginUndoSnapshot ( int room_id)
private

Definition at line 2468 of file dungeon_editor_v2.cc.

References LOG_ERROR.

◆ FinalizeUndoAction()

void yaze::editor::DungeonEditorV2::FinalizeUndoAction ( int room_id)
private

Definition at line 2489 of file dungeon_editor_v2.cc.

◆ RestoreRoomObjects()

void yaze::editor::DungeonEditorV2::RestoreRoomObjects ( int room_id,
const std::vector< zelda3::RoomObject > & objects )
private

Definition at line 2649 of file dungeon_editor_v2.cc.

◆ BeginCollisionUndoSnapshot()

void yaze::editor::DungeonEditorV2::BeginCollisionUndoSnapshot ( int room_id)
private

Definition at line 2659 of file dungeon_editor_v2.cc.

◆ FinalizeCollisionUndoAction()

void yaze::editor::DungeonEditorV2::FinalizeCollisionUndoAction ( int room_id)
private

Definition at line 2671 of file dungeon_editor_v2.cc.

◆ RestoreRoomCustomCollision()

void yaze::editor::DungeonEditorV2::RestoreRoomCustomCollision ( int room_id,
const zelda3::CustomCollisionMap & map )
private

Definition at line 2698 of file dungeon_editor_v2.cc.

◆ BeginWaterFillUndoSnapshot()

void yaze::editor::DungeonEditorV2::BeginWaterFillUndoSnapshot ( int room_id)
private

Definition at line 2726 of file dungeon_editor_v2.cc.

◆ FinalizeWaterFillUndoAction()

void yaze::editor::DungeonEditorV2::FinalizeWaterFillUndoAction ( int room_id)
private

Definition at line 2738 of file dungeon_editor_v2.cc.

◆ RestoreRoomWaterFill()

void yaze::editor::DungeonEditorV2::RestoreRoomWaterFill ( int room_id,
const WaterFillSnapshot & snap )
private

◆ SwapRoomInPanel()

void yaze::editor::DungeonEditorV2::SwapRoomInPanel ( int old_room_id,
int new_room_id )
private

◆ ProcessPendingSwap()

◆ ProcessPendingWorkflowMode()

void yaze::editor::DungeonEditorV2::ProcessPendingWorkflowMode ( )
private

◆ GetOrCreateRoomPanelSlotId()

int yaze::editor::DungeonEditorV2::GetOrCreateRoomPanelSlotId ( int room_id)
private

Definition at line 1529 of file dungeon_editor_v2.cc.

References next_room_panel_slot_id_, and room_panel_slot_ids_.

◆ ReleaseRoomPanelSlotId()

void yaze::editor::DungeonEditorV2::ReleaseRoomPanelSlotId ( int room_id)
private

Definition at line 1539 of file dungeon_editor_v2.cc.

References room_panel_slot_ids_.

Referenced by DrawRoomPanels().

◆ IsValidRoomId()

static bool yaze::editor::DungeonEditorV2::IsValidRoomId ( int room_id)
inlinestaticprivate

Definition at line 414 of file dungeon_editor_v2.h.

References yaze::zelda3::kNumberOfRooms.

Referenced by HandleObjectPlaced(), and Update().

Friends And Related Symbol Documentation

◆ DungeonEditorV2RomSafetyTest_UndoSnapshotLeakDetection_Test

friend class DungeonEditorV2RomSafetyTest_UndoSnapshotLeakDetection_Test
friend

Definition at line 228 of file dungeon_editor_v2.h.

◆ DungeonEditorV2RomSafetyTest_ViewerCacheLRUEviction_Test

friend class DungeonEditorV2RomSafetyTest_ViewerCacheLRUEviction_Test
friend

Definition at line 229 of file dungeon_editor_v2.h.

◆ DungeonEditorV2RomSafetyTest_ViewerCacheNeverEvictsActiveRooms_Test

friend class DungeonEditorV2RomSafetyTest_ViewerCacheNeverEvictsActiveRooms_Test
friend

Definition at line 231 of file dungeon_editor_v2.h.

◆ DungeonEditorV2RomSafetyTest_ViewerCacheLRUAccessOrderUpdate_Test

friend class DungeonEditorV2RomSafetyTest_ViewerCacheLRUAccessOrderUpdate_Test
friend

Definition at line 233 of file dungeon_editor_v2.h.

Member Data Documentation

◆ kRoomSelectorId

constexpr const char* yaze::editor::DungeonEditorV2::kRoomSelectorId = "dungeon.room_selector"
staticconstexpr

Definition at line 191 of file dungeon_editor_v2.h.

Referenced by Initialize(), SetAgentMode(), and SetWorkbenchWorkflowMode().

◆ kEntranceListId

constexpr const char* yaze::editor::DungeonEditorV2::kEntranceListId = "dungeon.entrance_list"
staticconstexpr

Definition at line 192 of file dungeon_editor_v2.h.

Referenced by Initialize().

◆ kRoomMatrixId

constexpr const char* yaze::editor::DungeonEditorV2::kRoomMatrixId = "dungeon.room_matrix"
staticconstexpr

Definition at line 193 of file dungeon_editor_v2.h.

Referenced by Initialize(), and SetWorkbenchWorkflowMode().

◆ kRoomGraphicsId

constexpr const char* yaze::editor::DungeonEditorV2::kRoomGraphicsId = "dungeon.room_graphics"
staticconstexpr

Definition at line 194 of file dungeon_editor_v2.h.

Referenced by Initialize(), and SetAgentMode().

◆ kObjectSelectorId

constexpr const char* yaze::editor::DungeonEditorV2::kObjectSelectorId = "dungeon.object_selector"
staticconstexpr

Definition at line 195 of file dungeon_editor_v2.h.

Referenced by Initialize(), SelectObject(), and SetAgentMode().

◆ kObjectEditorId

constexpr const char* yaze::editor::DungeonEditorV2::kObjectEditorId = "dungeon.object_editor"
staticconstexpr

Definition at line 196 of file dungeon_editor_v2.h.

Referenced by Initialize(), Load(), and SetAgentMode().

◆ kObjectToolsId

constexpr const char* yaze::editor::DungeonEditorV2::kObjectToolsId = kObjectSelectorId
staticconstexpr

Definition at line 197 of file dungeon_editor_v2.h.

◆ kDoorEditorId

constexpr const char* yaze::editor::DungeonEditorV2::kDoorEditorId = "dungeon.door_editor"
staticconstexpr

Definition at line 198 of file dungeon_editor_v2.h.

Referenced by Initialize().

◆ kPaletteEditorId

constexpr const char* yaze::editor::DungeonEditorV2::kPaletteEditorId = "dungeon.palette_editor"
staticconstexpr

Definition at line 199 of file dungeon_editor_v2.h.

Referenced by Initialize().

◆ renderer_

gfx::IRenderer* yaze::editor::DungeonEditorV2::renderer_ = nullptr
private

Definition at line 235 of file dungeon_editor_v2.h.

Referenced by Initialize(), Load(), ProcessDeferredTextures(), and renderer().

◆ rom_

Rom* yaze::editor::DungeonEditorV2::rom_
private

◆ game_data_

zelda3::GameData* yaze::editor::DungeonEditorV2::game_data_ = nullptr
private

Definition at line 274 of file dungeon_editor_v2.h.

Referenced by Initialize(), and SetGameData().

◆ rooms_

◆ entrances_

std::array<zelda3::RoomEntrance, 0x8C> yaze::editor::DungeonEditorV2::entrances_
private

Definition at line 276 of file dungeon_editor_v2.h.

Referenced by Initialize(), Load(), and OnEntranceSelected().

◆ current_entrance_id_

int yaze::editor::DungeonEditorV2::current_entrance_id_ = 0
private

Definition at line 279 of file dungeon_editor_v2.h.

Referenced by Initialize().

◆ active_rooms_

ImVector<int> yaze::editor::DungeonEditorV2::active_rooms_
private

◆ current_room_id_

int yaze::editor::DungeonEditorV2::current_room_id_ = 0
private

◆ kMaxRecentRooms

constexpr size_t yaze::editor::DungeonEditorV2::kMaxRecentRooms = 10
staticconstexprprivate

Definition at line 286 of file dungeon_editor_v2.h.

Referenced by OnRoomSelected().

◆ recent_rooms_

std::deque<int> yaze::editor::DungeonEditorV2::recent_rooms_
private

Definition at line 287 of file dungeon_editor_v2.h.

Referenced by GetRecentRooms(), Initialize(), OnRoomSelected(), and Update().

◆ pinned_rooms_

std::vector<int> yaze::editor::DungeonEditorV2::pinned_rooms_
private

Definition at line 288 of file dungeon_editor_v2.h.

◆ workbench_panel_

class DungeonWorkbenchContent* yaze::editor::DungeonEditorV2::workbench_panel_ = nullptr
private

Definition at line 291 of file dungeon_editor_v2.h.

Referenced by Initialize(), and OnRoomSelected().

◆ current_palette_

gfx::SnesPalette yaze::editor::DungeonEditorV2::current_palette_
private

Definition at line 294 of file dungeon_editor_v2.h.

Referenced by Load(), and OnRoomSelected().

◆ current_palette_group_

gfx::PaletteGroup yaze::editor::DungeonEditorV2::current_palette_group_
private

Definition at line 295 of file dungeon_editor_v2.h.

Referenced by Load(), and OnRoomSelected().

◆ current_palette_id_

uint64_t yaze::editor::DungeonEditorV2::current_palette_id_ = 0
private

Definition at line 296 of file dungeon_editor_v2.h.

Referenced by Load(), and OnRoomSelected().

◆ current_palette_group_id_

uint64_t yaze::editor::DungeonEditorV2::current_palette_group_id_ = 0
private

Definition at line 297 of file dungeon_editor_v2.h.

Referenced by Load(), and OnRoomSelected().

◆ room_loader_

DungeonRoomLoader yaze::editor::DungeonEditorV2::room_loader_
private

Definition at line 300 of file dungeon_editor_v2.h.

Referenced by DrawRoomTab(), Load(), OnRoomSelected(), SetGameData(), and SetRom().

◆ room_selector_

DungeonRoomSelector yaze::editor::DungeonEditorV2::room_selector_
private

◆ kMaxCachedViewers

constexpr int yaze::editor::DungeonEditorV2::kMaxCachedViewers = 20
staticconstexprprivate

Definition at line 302 of file dungeon_editor_v2.h.

◆ room_viewers_

util::LruCache<int, std::unique_ptr<DungeonCanvasViewer> > yaze::editor::DungeonEditorV2::room_viewers_
private

◆ workbench_viewer_

std::unique_ptr<DungeonCanvasViewer> yaze::editor::DungeonEditorV2::workbench_viewer_
private

Definition at line 305 of file dungeon_editor_v2.h.

Referenced by Load().

◆ workbench_compare_viewer_

std::unique_ptr<DungeonCanvasViewer> yaze::editor::DungeonEditorV2::workbench_compare_viewer_
private

Definition at line 306 of file dungeon_editor_v2.h.

Referenced by Load().

◆ palette_editor_

gui::PaletteEditorWidget yaze::editor::DungeonEditorV2::palette_editor_
private

Definition at line 308 of file dungeon_editor_v2.h.

Referenced by Load(), and OnRoomSelected().

◆ object_selector_panel_

ObjectSelectorContent* yaze::editor::DungeonEditorV2::object_selector_panel_ = nullptr
private

◆ object_editor_content_

ObjectEditorContent* yaze::editor::DungeonEditorV2::object_editor_content_ = nullptr
private

Definition at line 312 of file dungeon_editor_v2.h.

Referenced by Load(), object_editor_content(), and ~DungeonEditorV2().

◆ door_editor_panel_

DoorEditorContent* yaze::editor::DungeonEditorV2::door_editor_panel_ = nullptr
private

Definition at line 313 of file dungeon_editor_v2.h.

Referenced by door_editor_panel(), Load(), and ~DungeonEditorV2().

◆ room_graphics_panel_

RoomGraphicsContent* yaze::editor::DungeonEditorV2::room_graphics_panel_ = nullptr
private

Definition at line 314 of file dungeon_editor_v2.h.

Referenced by Load(), and OnRoomSelected().

◆ sprite_editor_panel_

class SpriteEditorPanel* yaze::editor::DungeonEditorV2::sprite_editor_panel_ = nullptr
private

Definition at line 315 of file dungeon_editor_v2.h.

Referenced by Load(), and ~DungeonEditorV2().

◆ item_editor_panel_

class ItemEditorPanel* yaze::editor::DungeonEditorV2::item_editor_panel_ = nullptr
private

Definition at line 316 of file dungeon_editor_v2.h.

Referenced by Load(), and ~DungeonEditorV2().

◆ minecart_track_editor_panel_

class MinecartTrackEditorPanel* yaze::editor::DungeonEditorV2::minecart_track_editor_panel_ = nullptr
private

Definition at line 317 of file dungeon_editor_v2.h.

Referenced by Load().

◆ room_tag_editor_panel_

class RoomTagEditorPanel* yaze::editor::DungeonEditorV2::room_tag_editor_panel_ = nullptr
private

Definition at line 318 of file dungeon_editor_v2.h.

Referenced by Load().

◆ custom_collision_panel_

class CustomCollisionPanel* yaze::editor::DungeonEditorV2::custom_collision_panel_ = nullptr
private

Definition at line 319 of file dungeon_editor_v2.h.

Referenced by Load(), and ~DungeonEditorV2().

◆ water_fill_panel_

class WaterFillPanel* yaze::editor::DungeonEditorV2::water_fill_panel_ = nullptr
private

Definition at line 320 of file dungeon_editor_v2.h.

Referenced by Load(), and ~DungeonEditorV2().

◆ object_tile_editor_panel_

ObjectTileEditorPanel* yaze::editor::DungeonEditorV2::object_tile_editor_panel_ = nullptr
private

Definition at line 321 of file dungeon_editor_v2.h.

Referenced by Load().

◆ dungeon_settings_panel_

class DungeonSettingsPanel* yaze::editor::DungeonEditorV2::dungeon_settings_panel_ = nullptr
private

Definition at line 322 of file dungeon_editor_v2.h.

Referenced by Load(), and ~DungeonEditorV2().

◆ overlay_manager_panel_

OverlayManagerPanel* yaze::editor::DungeonEditorV2::overlay_manager_panel_ = nullptr
private

Definition at line 323 of file dungeon_editor_v2.h.

Referenced by Load().

◆ owned_object_selector_panel_

std::unique_ptr<ObjectSelectorContent> yaze::editor::DungeonEditorV2::owned_object_selector_panel_
private

Definition at line 327 of file dungeon_editor_v2.h.

Referenced by Load().

◆ owned_object_editor_content_

std::unique_ptr<ObjectEditorContent> yaze::editor::DungeonEditorV2::owned_object_editor_content_
private

Definition at line 328 of file dungeon_editor_v2.h.

Referenced by Load().

◆ owned_door_editor_panel_

std::unique_ptr<DoorEditorContent> yaze::editor::DungeonEditorV2::owned_door_editor_panel_
private

Definition at line 329 of file dungeon_editor_v2.h.

Referenced by Load().

◆ dungeon_editor_system_

std::unique_ptr<zelda3::DungeonEditorSystem> yaze::editor::DungeonEditorV2::dungeon_editor_system_
private

◆ render_service_

std::unique_ptr<emu::render::EmulatorRenderService> yaze::editor::DungeonEditorV2::render_service_
private

Definition at line 331 of file dungeon_editor_v2.h.

◆ is_loaded_

bool yaze::editor::DungeonEditorV2::is_loaded_ = false
private

Definition at line 333 of file dungeon_editor_v2.h.

Referenced by Load(), and Update().

◆ room_window_class_

ImGuiWindowClass yaze::editor::DungeonEditorV2::room_window_class_
private

Definition at line 336 of file dungeon_editor_v2.h.

Referenced by DrawRoomPanels(), Initialize(), and Update().

◆ room_dock_id_

ImGuiID yaze::editor::DungeonEditorV2::room_dock_id_ = 0
private

Definition at line 339 of file dungeon_editor_v2.h.

Referenced by DrawRoomPanels().

◆ room_cards_

std::unordered_map<int, std::shared_ptr<gui::PanelWindow> > yaze::editor::DungeonEditorV2::room_cards_
private

Definition at line 342 of file dungeon_editor_v2.h.

Referenced by DrawRoomPanels(), FocusRoom(), and ProcessPendingSwap().

◆ next_room_panel_slot_id_

int yaze::editor::DungeonEditorV2::next_room_panel_slot_id_ = 1
private

Definition at line 347 of file dungeon_editor_v2.h.

Referenced by GetOrCreateRoomPanelSlotId(), and ProcessPendingSwap().

◆ room_panel_slot_ids_

std::unordered_map<int, int> yaze::editor::DungeonEditorV2::room_panel_slot_ids_
private

◆ pending_undo_

PendingUndo yaze::editor::DungeonEditorV2::pending_undo_
private

Definition at line 357 of file dungeon_editor_v2.h.

◆ has_pending_undo_

bool yaze::editor::DungeonEditorV2::has_pending_undo_ = false
private

Definition at line 358 of file dungeon_editor_v2.h.

◆ pending_collision_undo_

PendingCollisionUndo yaze::editor::DungeonEditorV2::pending_collision_undo_
private

Definition at line 364 of file dungeon_editor_v2.h.

◆ pending_water_fill_undo_

PendingWaterFillUndo yaze::editor::DungeonEditorV2::pending_water_fill_undo_
private

Definition at line 370 of file dungeon_editor_v2.h.

◆ pending_swap_

PendingSwap yaze::editor::DungeonEditorV2::pending_swap_
private

Definition at line 378 of file dungeon_editor_v2.h.

Referenced by ProcessPendingSwap(), and SwapRoomInPanel().

◆ pending_workflow_mode_

PendingWorkflowMode yaze::editor::DungeonEditorV2::pending_workflow_mode_
private

Definition at line 385 of file dungeon_editor_v2.h.

Referenced by ProcessPendingWorkflowMode(), and QueueWorkbenchWorkflowMode().


The documentation for this class was generated from the following files: