DungeonEditor class for editing dungeons. More...
#include <dungeon_editor.h>
Public Member Functions | |
DungeonEditor () | |
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 |
void | add_room (int i) |
Public Member Functions inherited from yaze::app::editor::Editor | |
Editor ()=default | |
virtual | ~Editor ()=default |
EditorType | type () const |
Public Member Functions inherited from yaze::app::SharedRom | |
SharedRom ()=default | |
virtual | ~SharedRom ()=default |
std::shared_ptr< Rom > | shared_rom () |
auto | rom () |
Public Member Functions inherited from yaze::app::core::ExperimentFlags | |
ExperimentFlags ()=default | |
virtual | ~ExperimentFlags ()=default |
auto | flags () const |
Flags * | mutable_flags () |
std::string | Serialize () const |
Private Types | |
enum | BackgroundType { kNoBackground , kBackground1 , kBackground2 , kBackground3 , kBackgroundAny } |
enum | PlacementType { kNoType , kSprite , kItem , kDoor , kBlock } |
Private Member Functions | |
absl::Status | Initialize () |
absl::Status | RefreshGraphics () |
void | LoadDungeonRoomSize () |
absl::Status | UpdateDungeonRoomView () |
void | DrawToolset () |
void | DrawRoomSelector () |
void | DrawEntranceSelector () |
void | DrawDungeonTabView () |
void | DrawDungeonCanvas (int room_id) |
void | DrawRoomGraphics () |
void | DrawTileSelector () |
void | DrawObjectRenderer () |
void | CalculateUsageStats () |
void | DrawUsageStats () |
void | DrawUsageGrid () |
void | RenderSetUsage (const absl::flat_hash_map< uint16_t, int > &usage_map, uint16_t &selected_set, int spriteset_offset=0x00) |
Additional Inherited Members | |
Static Public Attributes inherited from yaze::app::SharedRom | |
static std::shared_ptr< Rom > | shared_rom_ = nullptr |
Protected Attributes inherited from yaze::app::editor::Editor | |
EditorType | type_ |
EditorContext | context_ |
DungeonEditor class for editing dungeons.
This class is currently a work in progress and is used for editing dungeons. It provides various functions for updating, cutting, copying, pasting, undoing, and redoing. It also includes methods for drawing the toolset, room selector, entrance selector, dungeon tab view, dungeon canvas, room graphics, tile selector, and object renderer. Additionally, it handles loading room entrances, calculating usage statistics, and rendering set usage.
Definition at line 43 of file dungeon_editor.h.
|
private |
Enumerator | |
---|---|
kNoBackground | |
kBackground1 | |
kBackground2 | |
kBackground3 | |
kBackgroundAny |
Definition at line 84 of file dungeon_editor.h.
|
private |
Enumerator | |
---|---|
kNoType | |
kSprite | |
kItem | |
kDoor | |
kBlock |
Definition at line 91 of file dungeon_editor.h.
|
inline |
Definition at line 47 of file dungeon_editor.h.
References yaze::app::editor::kDungeon, and yaze::app::editor::Editor::type_.
|
overridevirtual |
Implements yaze::app::editor::Editor.
Definition at line 42 of file dungeon_editor.cc.
References CalculateUsageStats(), DrawUsageStats(), END_TAB_ITEM, Initialize(), is_loaded_, refresh_graphics_, RefreshGraphics(), RETURN_IF_ERROR, yaze::app::SharedRom::rom(), status_, TAB_ITEM, and UpdateDungeonRoomView().
Referenced by yaze::app::editor::EditorManager::ManageActiveEditors().
|
inlineoverridevirtual |
Implements yaze::app::editor::Editor.
Definition at line 50 of file dungeon_editor.h.
Referenced by DrawToolset().
|
inlineoverridevirtual |
Implements yaze::app::editor::Editor.
Definition at line 51 of file dungeon_editor.h.
Referenced by DrawToolset().
|
inlineoverridevirtual |
Implements yaze::app::editor::Editor.
Definition at line 52 of file dungeon_editor.h.
|
inlineoverridevirtual |
Implements yaze::app::editor::Editor.
Definition at line 53 of file dungeon_editor.h.
|
inlineoverridevirtual |
Implements yaze::app::editor::Editor.
Definition at line 54 of file dungeon_editor.h.
|
inlineoverridevirtual |
Implements yaze::app::editor::Editor.
Definition at line 55 of file dungeon_editor.h.
|
inline |
Definition at line 57 of file dungeon_editor.h.
References active_rooms_.
Referenced by yaze::app::editor::EditorManager::ManageActiveEditors().
|
private |
Definition at line 73 of file dungeon_editor.cc.
References ASSIGN_OR_RETURN, yaze::app::gfx::CreatePaletteGroupFromLargePalette(), current_palette_group_, current_palette_group_id_, current_room_id_, entrances_, yaze::app::core::ExperimentFlags::flags(), full_palette_, graphics_bin_, LoadDungeonRoomSize(), yaze::app::SharedRom::rom(), room_gfx_sheets_, room_palette_, room_size_addresses_, room_size_pointers_, and rooms_.
Referenced by Update().
|
private |
Definition at line 119 of file dungeon_editor.cc.
References current_palette_group_, current_palette_id_, current_room_id_, yaze::app::core::Renderer::GetInstance(), graphics_bin_, RETURN_IF_ERROR, yaze::app::SharedRom::rom(), rooms_, and yaze::app::core::Renderer::UpdateBitmap().
Referenced by Update().
|
private |
Definition at line 136 of file dungeon_editor.cc.
References room_size_addresses_, rooms_, and total_room_size_.
Referenced by Initialize().
|
private |
Definition at line 178 of file dungeon_editor.cc.
References current_palette_, current_palette_group_id_, current_palette_id_, DrawDungeonTabView(), DrawEntranceSelector(), DrawRoomSelector(), DrawTileSelector(), DrawToolset(), END_TAB_ITEM, yaze::app::editor::kDungeonTableFlags, palette_showing_, refresh_graphics_, yaze::app::SharedRom::rom(), yaze::app::gui::SelectablePalettePipeline(), and TAB_ITEM.
Referenced by Update().
|
private |
Definition at line 219 of file dungeon_editor.cc.
References background_type_, ICON_MD_FILTER_1, ICON_MD_FILTER_2, ICON_MD_FILTER_3, ICON_MD_FILTER_NONE, ICON_MD_GRASS, ICON_MD_MORE_VERT, ICON_MD_PALETTE, ICON_MD_PEST_CONTROL, ICON_MD_REDO, ICON_MD_SENSOR_DOOR, ICON_MD_SQUARE, ICON_MD_UNDO, kBackground1, kBackground2, kBackground3, kBackgroundAny, kBlock, kDoor, kItem, kSprite, palette_showing_, placement_type_, PRINT_IF_ERROR, Redo(), and Undo().
Referenced by UpdateDungeonRoomView().
|
private |
Definition at line 313 of file dungeon_editor.cc.
References active_rooms_, current_palette_id_, current_room_id_, yaze::app::gui::InputHex(), yaze::app::gui::InputHexWord(), yaze::app::zelda3::dungeon::kRoomNames, yaze::app::SharedRom::rom(), and yaze::app::core::UppercaseHexByte().
Referenced by UpdateDungeonRoomView().
|
private |
Definition at line 342 of file dungeon_editor.cc.
References active_rooms_, current_entrance_id_, entrances_, yaze::app::gui::InputHexByte(), yaze::app::gui::InputHexWord(), yaze::app::zelda3::dungeon::kEntranceNames, yaze::app::SharedRom::rom(), and yaze::app::core::UppercaseHexByte().
Referenced by UpdateDungeonRoomView().
|
private |
Definition at line 414 of file dungeon_editor.cc.
References active_rooms_, current_room_id_, DrawDungeonCanvas(), ICON_MD_ADD, yaze::app::editor::kDungeonTabBarFlags, yaze::app::editor::kDungeonTabFlags, and yaze::app::zelda3::dungeon::kRoomNames.
Referenced by UpdateDungeonRoomView().
|
private |
Definition at line 453 of file dungeon_editor.cc.
References canvas_, yaze::app::gui::Canvas::DrawBackground(), yaze::app::gui::Canvas::DrawBitmap(), yaze::app::gui::Canvas::DrawContextMenu(), yaze::app::gui::Canvas::DrawGrid(), yaze::app::gui::Canvas::DrawOverlay(), yaze::app::gui::InputHexByte(), yaze::app::gui::InputHexWord(), is_loaded_, and rooms_.
Referenced by DrawDungeonTabView().
|
private |
Definition at line 487 of file dungeon_editor.cc.
References current_room_id_, yaze::app::gui::Canvas::draw_list(), yaze::app::gui::Canvas::DrawBackground(), yaze::app::gui::Canvas::DrawContextMenu(), yaze::app::gui::Canvas::DrawGrid(), yaze::app::gui::Canvas::DrawOverlay(), yaze::app::gui::Canvas::DrawTileSelector(), graphics_bin_, is_loaded_, room_gfx_canvas_, rooms_, and yaze::app::gui::Canvas::zero_point().
Referenced by DrawTileSelector().
|
private |
Definition at line 514 of file dungeon_editor.cc.
References DrawObjectRenderer(), and DrawRoomGraphics().
Referenced by UpdateDungeonRoomView().
|
private |
Definition at line 534 of file dungeon_editor.cc.
References yaze::app::zelda3::dungeon::DungeonObjectRenderer::bitmap(), current_object_, current_room_id_, yaze::app::gui::Canvas::DrawBackground(), yaze::app::gui::Canvas::DrawBitmap(), yaze::app::gui::Canvas::DrawContextMenu(), yaze::app::gui::Canvas::DrawGrid(), yaze::app::gui::Canvas::DrawOverlay(), yaze::app::gui::Canvas::DrawTileSelector(), yaze::app::core::Renderer::GetInstance(), yaze::app::editor::kDungeonObjectTableFlags, yaze::app::zelda3::dungeon::DungeonObjectRenderer::LoadObject(), yaze::app::zelda3::dungeon::DungeonObjectRenderer::mutable_memory(), object_canvas_, object_loaded_, object_renderer_, yaze::app::core::Renderer::RenderBitmap(), and rooms_.
Referenced by DrawTileSelector().
|
private |
Definition at line 588 of file dungeon_editor.cc.
References blockset_usage_, palette_usage_, rooms_, and spriteset_usage_.
Referenced by DrawUsageStats(), and Update().
|
private |
Definition at line 658 of file dungeon_editor.cc.
References blockset_usage_, CalculateUsageStats(), yaze::app::editor::GfxGroupEditor::DrawBlocksetViewer(), yaze::app::editor::GfxGroupEditor::DrawSpritesetViewer(), DrawUsageGrid(), gfx_group_editor_, yaze::app::editor::kDungeonTableFlags, palette_usage_, RenderSetUsage(), selected_blockset_, selected_palette_, selected_spriteset_, yaze::app::editor::GfxGroupEditor::SetSelectedBlockset(), yaze::app::editor::GfxGroupEditor::SetSelectedSpriteset(), spriteset_usage_, and total_room_size_.
Referenced by Update().
|
private |
Definition at line 743 of file dungeon_editor.cc.
References room_palette_, rooms_, selected_blockset_, selected_palette_, and selected_spriteset_.
Referenced by DrawUsageStats().
|
private |
Definition at line 610 of file dungeon_editor.cc.
Referenced by DrawUsageStats().
|
private |
Definition at line 93 of file dungeon_editor.h.
Referenced by DrawToolset().
|
private |
Definition at line 94 of file dungeon_editor.h.
Referenced by DrawToolset().
|
private |
Definition at line 95 of file dungeon_editor.h.
Referenced by DrawObjectRenderer().
|
private |
Definition at line 97 of file dungeon_editor.h.
Referenced by DrawDungeonCanvas(), DrawRoomGraphics(), and Update().
|
private |
Definition at line 98 of file dungeon_editor.h.
Referenced by DrawObjectRenderer().
|
private |
Definition at line 99 of file dungeon_editor.h.
Referenced by DrawToolset(), and UpdateDungeonRoomView().
|
private |
Definition at line 100 of file dungeon_editor.h.
Referenced by Update(), and UpdateDungeonRoomView().
|
private |
Definition at line 102 of file dungeon_editor.h.
Referenced by DrawEntranceSelector().
|
private |
Definition at line 103 of file dungeon_editor.h.
Referenced by DrawDungeonTabView(), DrawObjectRenderer(), DrawRoomGraphics(), DrawRoomSelector(), Initialize(), and RefreshGraphics().
|
private |
Definition at line 104 of file dungeon_editor.h.
Referenced by DrawRoomSelector(), RefreshGraphics(), and UpdateDungeonRoomView().
|
private |
Definition at line 105 of file dungeon_editor.h.
Referenced by Initialize(), and UpdateDungeonRoomView().
|
private |
Definition at line 107 of file dungeon_editor.h.
Referenced by add_room(), DrawDungeonTabView(), DrawEntranceSelector(), and DrawRoomSelector().
|
private |
Definition at line 109 of file dungeon_editor.h.
Referenced by DrawUsageStats().
|
private |
Definition at line 110 of file dungeon_editor.h.
|
private |
Definition at line 111 of file dungeon_editor.h.
Referenced by UpdateDungeonRoomView().
|
private |
Definition at line 112 of file dungeon_editor.h.
Referenced by Initialize().
|
private |
Definition at line 113 of file dungeon_editor.h.
Referenced by Initialize(), and RefreshGraphics().
|
private |
Definition at line 115 of file dungeon_editor.h.
Referenced by DrawDungeonCanvas().
|
private |
Definition at line 116 of file dungeon_editor.h.
Referenced by DrawRoomGraphics().
|
private |
Definition at line 117 of file dungeon_editor.h.
Referenced by DrawObjectRenderer().
|
private |
Definition at line 119 of file dungeon_editor.h.
|
private |
Definition at line 120 of file dungeon_editor.h.
Referenced by DrawRoomGraphics(), Initialize(), and RefreshGraphics().
|
private |
Definition at line 122 of file dungeon_editor.h.
Referenced by Initialize().
|
private |
Definition at line 123 of file dungeon_editor.h.
Referenced by CalculateUsageStats(), DrawDungeonCanvas(), DrawObjectRenderer(), DrawRoomGraphics(), DrawUsageGrid(), Initialize(), LoadDungeonRoomSize(), and RefreshGraphics().
|
private |
Definition at line 124 of file dungeon_editor.h.
Referenced by DrawEntranceSelector(), and Initialize().
|
private |
Definition at line 125 of file dungeon_editor.h.
Referenced by DrawObjectRenderer().
|
private |
Definition at line 127 of file dungeon_editor.h.
Referenced by CalculateUsageStats(), and DrawUsageStats().
|
private |
Definition at line 128 of file dungeon_editor.h.
Referenced by CalculateUsageStats(), and DrawUsageStats().
|
private |
Definition at line 129 of file dungeon_editor.h.
Referenced by CalculateUsageStats(), and DrawUsageStats().
|
private |
Definition at line 131 of file dungeon_editor.h.
Referenced by Initialize().
|
private |
Definition at line 133 of file dungeon_editor.h.
Referenced by DrawUsageGrid(), and DrawUsageStats().
|
private |
Definition at line 134 of file dungeon_editor.h.
Referenced by DrawUsageGrid(), and DrawUsageStats().
|
private |
Definition at line 135 of file dungeon_editor.h.
Referenced by DrawUsageGrid(), and DrawUsageStats().
|
private |
Definition at line 137 of file dungeon_editor.h.
Referenced by DrawUsageStats(), and LoadDungeonRoomSize().
|
private |
Definition at line 139 of file dungeon_editor.h.
Referenced by Initialize(), and LoadDungeonRoomSize().
|
private |
Definition at line 140 of file dungeon_editor.h.
Referenced by DrawUsageGrid(), and Initialize().
|
private |
Definition at line 142 of file dungeon_editor.h.
Referenced by Update().