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
 
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 ShowPanel (const std::string &card_id)
 
void SetWorkbenchWorkflowMode (bool enabled, bool show_toast=true)
 
void QueueWorkbenchWorkflowMode (bool enabled, bool show_toast=true)
 
bool IsWorkbenchWorkflowEnabled () const
 
int current_room_id () const
 
int * mutable_current_room_id ()
 
const ImVector< int > & active_rooms () const
 
std::array< zelda3::Room, 0x128 > & rooms ()
 
const std::array< zelda3::Room, 0x128 > & rooms () const
 
gfx::IRendererrenderer () const
 
ObjectEditorPanelobject_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 * kObjectToolsId = "dungeon.object_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
 
std::array< zelda3::Room, 0x128 > 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 DungeonWorkbenchPanelworkbench_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_
 
ObjectEditorPanelobject_editor_panel_ = nullptr
 
DungeonRoomGraphicsPanelroom_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< ObjectEditorPanelowned_object_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 MakePanelId (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 PanelManager (registered EditorPanels):

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

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

Definition at line 85 of file dungeon_editor_v2.h.

Constructor & Destructor Documentation

◆ DungeonEditorV2()

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

Definition at line 87 of file dungeon_editor_v2.h.

References yaze::zelda3::CreateDungeonEditorSystem(), dungeon_editor_system_, yaze::editor::kDungeon, rom(), rooms_, 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 173 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_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(), kEntranceListId, yaze::editor::kError, kPaletteEditorId, kRoomGraphicsId, kRoomMatrixId, kRoomSelectorId, yaze::editor::kSuccess, LOG_ERROR, OnEntranceSelected(), OnRoomSelected(), yaze::editor::EditorDependencies::panel_manager, yaze::editor::EditorDependencies::project, QueueWorkbenchWorkflowMode(), recent_rooms_, Redo(), yaze::editor::PanelManager::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::DungeonWorkbenchPanel::SetUndoRedoProvider(), SetWorkbenchWorkflowMode(), yaze::editor::ToastManager::Show(), ShowPanel(), SwapRoomInPanel(), yaze::editor::EditorDependencies::toast_manager, Undo(), yaze::editor::Editor::undo_manager_, yaze::editor::UndoManager::UndoStackSize(), 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 417 of file dungeon_editor_v2.cc.

References active_rooms_, yaze::zelda3::CustomObjectManager::AddObjectFile(), ASSIGN_OR_RETURN, yaze::project::YazeProject::code_folder, yaze::gfx::CreatePaletteGroupFromLargePalette(), current_palette_, current_palette_group_, current_palette_group_id_, current_room_id_, custom_collision_panel_, yaze::project::YazeProject::custom_object_files, yaze::project::YazeProject::custom_objects_folder, yaze::editor::Editor::dependencies_, dungeon_editor_system_, yaze::gfx::PaletteGroupMap::dungeon_main, dungeon_settings_panel_, entrances_, 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_, item_editor_panel_, yaze::editor::kInfo, yaze::editor::kWarning, yaze::zelda3::LoadLegacyWaterGateZones(), yaze::editor::DungeonRoomLoader::LoadRoomEntrances(), yaze::zelda3::LoadWaterFillTable(), LOG_ERROR, LOG_WARN, minecart_track_editor_panel_, object_editor_panel_, yaze::editor::ObjectEditorPanel::object_selector(), object_tile_editor_panel_, OnRoomSelected(), yaze::editor::ObjectTileEditorPanel::OpenForObject(), overlay_manager_panel_, owned_object_editor_panel_, palette_editor_, yaze::zelda3::GameData::palette_groups, yaze::editor::EditorDependencies::panel_manager, yaze::editor::EditorDependencies::project, yaze::editor::PanelManager::RegisterEditorPanel(), render_service_, renderer_, RETURN_IF_ERROR, rom_, room_graphics_panel_, room_loader_, room_selector_, room_tag_editor_panel_, rooms_, yaze::project::YazeProject::Save(), SaveAllRooms(), SaveRoom(), yaze::editor::DungeonRoomSelector::set_active_rooms(), yaze::editor::DungeonRoomSelector::set_entrances(), yaze::editor::DungeonRoomSelector::set_rooms(), yaze::editor::DungeonObjectSelector::SetCustomObjectsFolder(), yaze::editor::ObjectEditorPanel::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::editor::ToastManager::Show(), ShowPanel(), sprite_editor_panel_, yaze::project::YazeProject::symbols_filename, yaze::editor::EditorDependencies::toast_manager, and water_fill_panel_.

◆ Update()

◆ Undo()

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

Implements yaze::editor::Editor.

Definition at line 2273 of file dungeon_editor_v2.cc.

Referenced by Initialize().

◆ Redo()

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

Implements yaze::editor::Editor.

Definition at line 2287 of file dungeon_editor_v2.cc.

Referenced by Initialize().

◆ Cut()

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

Implements yaze::editor::Editor.

Definition at line 2301 of file dungeon_editor_v2.cc.

◆ Copy()

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

Implements yaze::editor::Editor.

Definition at line 2309 of file dungeon_editor_v2.cc.

◆ Paste()

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

Implements yaze::editor::Editor.

Definition at line 2316 of file dungeon_editor_v2.cc.

◆ Find()

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

Implements yaze::editor::Editor.

Definition at line 131 of file dungeon_editor_v2.h.

◆ Save()

◆ SaveRoom()

◆ LoadedRoomCount()

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

Definition at line 1082 of file dungeon_editor_v2.cc.

References rooms_.

◆ TotalRoomCount()

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

Definition at line 135 of file dungeon_editor_v2.h.

References rooms_.

◆ CollectWriteRanges()

◆ SetRom()

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

Definition at line 143 of file dungeon_editor_v2.h.

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

Referenced by Initialize().

Here is the call graph for this function:

◆ rom()

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

Definition at line 165 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 1700 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 1704 of file dungeon_editor_v2.cc.

References room_cards_.

Referenced by OnRoomSelected().

◆ SelectObject()

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

Definition at line 1711 of file dungeon_editor_v2.cc.

References kObjectToolsId, object_editor_panel_, yaze::editor::ObjectEditorPanel::SelectObject(), and ShowPanel().

Here is the call graph for this function:

◆ SetAgentMode()

void yaze::editor::DungeonEditorV2::SetAgentMode ( bool enabled)

◆ IsRomLoaded()

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

Reimplemented from yaze::editor::Editor.

Definition at line 176 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 177 of file dungeon_editor_v2.h.

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

Here is the call graph for this function:

◆ ShowPanel()

void yaze::editor::DungeonEditorV2::ShowPanel ( const std::string & card_id)
inline

◆ SetWorkbenchWorkflowMode()

◆ QueueWorkbenchWorkflowMode()

void yaze::editor::DungeonEditorV2::QueueWorkbenchWorkflowMode ( bool enabled,
bool show_toast = true )

◆ IsWorkbenchWorkflowEnabled()

bool yaze::editor::DungeonEditorV2::IsWorkbenchWorkflowEnabled ( ) const

◆ current_room_id()

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

Definition at line 207 of file dungeon_editor_v2.h.

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

Here is the call graph for this function:

◆ mutable_current_room_id()

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

Definition at line 208 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 209 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]

std::array< zelda3::Room, 0x128 > & yaze::editor::DungeonEditorV2::rooms ( )
inline

◆ rooms() [2/2]

const std::array< zelda3::Room, 0x128 > & yaze::editor::DungeonEditorV2::rooms ( ) const
inline

Definition at line 213 of file dungeon_editor_v2.h.

References rooms_.

◆ renderer()

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

Definition at line 214 of file dungeon_editor_v2.h.

References renderer_.

◆ object_editor_panel()

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

Definition at line 215 of file dungeon_editor_v2.h.

References object_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 223 of file dungeon_editor_v2.h.

References recent_rooms_.

◆ DrawRoomPanels()

◆ DrawRoomTab()

◆ ProcessDeferredTextures()

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

Definition at line 1729 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

◆ OnRoomSelected() [2/2]

void yaze::editor::DungeonEditorV2::OnRoomSelected ( int room_id,
RoomSelectionIntent intent )
private

◆ OnEntranceSelected()

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

Definition at line 1675 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 2435 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()

void yaze::editor::DungeonEditorV2::OpenGraphicsEditorForObject ( int room_id,
const zelda3::RoomObject & object )
private

◆ GetViewerForRoom()

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

◆ GetWorkbenchViewer()

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

Definition at line 2122 of file dungeon_editor_v2.cc.

References LOG_ERROR.

Referenced by GetViewerForRoom(), and Initialize().

◆ GetWorkbenchCompareViewer()

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

Definition at line 2242 of file dungeon_editor_v2.cc.

Referenced by Initialize().

◆ TouchViewerLru()

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

Definition at line 1935 of file dungeon_editor_v2.cc.

References room_viewers_.

◆ RemoveViewerFromLru()

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

Definition at line 1939 of file dungeon_editor_v2.cc.

◆ SaveRoomData()

◆ BeginUndoSnapshot()

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

Definition at line 2323 of file dungeon_editor_v2.cc.

References LOG_ERROR.

◆ FinalizeUndoAction()

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

Definition at line 2344 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 2487 of file dungeon_editor_v2.cc.

◆ BeginCollisionUndoSnapshot()

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

Definition at line 2497 of file dungeon_editor_v2.cc.

◆ FinalizeCollisionUndoAction()

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

Definition at line 2509 of file dungeon_editor_v2.cc.

◆ RestoreRoomCustomCollision()

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

Definition at line 2536 of file dungeon_editor_v2.cc.

◆ BeginWaterFillUndoSnapshot()

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

Definition at line 2564 of file dungeon_editor_v2.cc.

◆ FinalizeWaterFillUndoAction()

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

Definition at line 2576 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 1396 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 1406 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 408 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 226 of file dungeon_editor_v2.h.

◆ DungeonEditorV2RomSafetyTest_ViewerCacheLRUEviction_Test

friend class DungeonEditorV2RomSafetyTest_ViewerCacheLRUEviction_Test
friend

Definition at line 227 of file dungeon_editor_v2.h.

◆ DungeonEditorV2RomSafetyTest_ViewerCacheNeverEvictsActiveRooms_Test

friend class DungeonEditorV2RomSafetyTest_ViewerCacheNeverEvictsActiveRooms_Test
friend

Definition at line 229 of file dungeon_editor_v2.h.

◆ DungeonEditorV2RomSafetyTest_ViewerCacheLRUAccessOrderUpdate_Test

friend class DungeonEditorV2RomSafetyTest_ViewerCacheLRUAccessOrderUpdate_Test
friend

Definition at line 231 of file dungeon_editor_v2.h.

Member Data Documentation

◆ kRoomSelectorId

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

Definition at line 199 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 200 of file dungeon_editor_v2.h.

Referenced by Initialize().

◆ kRoomMatrixId

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

Definition at line 201 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 202 of file dungeon_editor_v2.h.

Referenced by Initialize(), and SetAgentMode().

◆ kObjectToolsId

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

Definition at line 203 of file dungeon_editor_v2.h.

Referenced by SelectObject(), and SetAgentMode().

◆ kPaletteEditorId

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

Definition at line 204 of file dungeon_editor_v2.h.

Referenced by Initialize().

◆ renderer_

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

Definition at line 233 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 272 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 274 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 277 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 284 of file dungeon_editor_v2.h.

Referenced by OnRoomSelected().

◆ recent_rooms_

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

Definition at line 285 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 286 of file dungeon_editor_v2.h.

◆ workbench_panel_

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

Definition at line 289 of file dungeon_editor_v2.h.

Referenced by Initialize(), and OnRoomSelected().

◆ current_palette_

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

Definition at line 292 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 293 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 294 of file dungeon_editor_v2.h.

Referenced by OnRoomSelected().

◆ current_palette_group_id_

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

Definition at line 295 of file dungeon_editor_v2.h.

Referenced by Load().

◆ room_loader_

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

Definition at line 298 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 300 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 303 of file dungeon_editor_v2.h.

◆ workbench_compare_viewer_

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

Definition at line 304 of file dungeon_editor_v2.h.

◆ palette_editor_

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

Definition at line 306 of file dungeon_editor_v2.h.

Referenced by Load(), and OnRoomSelected().

◆ object_editor_panel_

ObjectEditorPanel* yaze::editor::DungeonEditorV2::object_editor_panel_ = nullptr
private

◆ room_graphics_panel_

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

Definition at line 310 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 311 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 312 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 313 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 314 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 315 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 316 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 317 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 318 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 319 of file dungeon_editor_v2.h.

Referenced by Load().

◆ owned_object_editor_panel_

std::unique_ptr<ObjectEditorPanel> yaze::editor::DungeonEditorV2::owned_object_editor_panel_
private

Definition at line 323 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 325 of file dungeon_editor_v2.h.

Referenced by Load(), and SetRom().

◆ is_loaded_

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

Definition at line 327 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 330 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 333 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 336 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 341 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 351 of file dungeon_editor_v2.h.

◆ has_pending_undo_

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

Definition at line 352 of file dungeon_editor_v2.h.

◆ pending_collision_undo_

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

Definition at line 358 of file dungeon_editor_v2.h.

◆ pending_water_fill_undo_

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

Definition at line 364 of file dungeon_editor_v2.h.

◆ pending_swap_

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

Definition at line 372 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 379 of file dungeon_editor_v2.h.

Referenced by ProcessPendingWorkflowMode(), and QueueWorkbenchWorkflowMode().


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