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_ |
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 44 of file dungeon_editor.h.
|
private |
Enumerator | |
---|---|
kNoBackground | |
kBackground1 | |
kBackground2 | |
kBackground3 | |
kBackgroundAny |
Definition at line 85 of file dungeon_editor.h.
|
private |
Enumerator | |
---|---|
kNoType | |
kSprite | |
kItem | |
kDoor | |
kBlock |
Definition at line 92 of file dungeon_editor.h.
|
inline |
Definition at line 48 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_BAR, END_TAB_ITEM, Initialize(), is_loaded_, refresh_graphics_, RefreshGraphics(), RETURN_IF_ERROR, yaze::app::SharedRom::rom(), status_, TAB_BAR, TAB_ITEM, and UpdateDungeonRoomView().
Referenced by yaze::app::editor::EditorManager::ManageActiveEditors().
|
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.
Referenced by DrawToolset().
|
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.
|
inlineoverridevirtual |
Implements yaze::app::editor::Editor.
Definition at line 56 of file dungeon_editor.h.
|
inline |
Definition at line 58 of file dungeon_editor.h.
References active_rooms_.
Referenced by yaze::app::editor::EditorManager::ManageActiveEditors().
|
private |
Definition at line 72 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 118 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 135 of file dungeon_editor.cc.
References room_size_addresses_, rooms_, and total_room_size_.
Referenced by Initialize().
|
private |
Definition at line 177 of file dungeon_editor.cc.
References current_palette_, current_palette_group_id_, current_palette_id_, DrawDungeonTabView(), DrawEntranceSelector(), DrawRoomSelector(), DrawTileSelector(), DrawToolset(), END_TAB_BAR, END_TAB_ITEM, yaze::app::editor::kDungeonTableFlags, palette_showing_, refresh_graphics_, yaze::app::SharedRom::rom(), yaze::app::gui::SelectablePalettePipeline(), TAB_BAR, and TAB_ITEM.
Referenced by Update().
|
private |
Definition at line 217 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 311 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 340 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 412 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 451 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 485 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 512 of file dungeon_editor.cc.
References DrawObjectRenderer(), and DrawRoomGraphics().
Referenced by UpdateDungeonRoomView().
|
private |
Definition at line 532 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 586 of file dungeon_editor.cc.
References blockset_usage_, palette_usage_, rooms_, and spriteset_usage_.
Referenced by DrawUsageStats(), and Update().
|
private |
Definition at line 656 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 741 of file dungeon_editor.cc.
References room_palette_, rooms_, selected_blockset_, selected_palette_, and selected_spriteset_.
Referenced by DrawUsageStats().
|
private |
Definition at line 608 of file dungeon_editor.cc.
Referenced by DrawUsageStats().
|
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 DrawToolset().
|
private |
Definition at line 96 of file dungeon_editor.h.
Referenced by DrawObjectRenderer().
|
private |
Definition at line 98 of file dungeon_editor.h.
Referenced by DrawDungeonCanvas(), DrawRoomGraphics(), and Update().
|
private |
Definition at line 99 of file dungeon_editor.h.
Referenced by DrawObjectRenderer().
|
private |
Definition at line 100 of file dungeon_editor.h.
Referenced by DrawToolset(), and UpdateDungeonRoomView().
|
private |
Definition at line 101 of file dungeon_editor.h.
Referenced by Update(), and UpdateDungeonRoomView().
|
private |
Definition at line 103 of file dungeon_editor.h.
Referenced by DrawEntranceSelector().
|
private |
Definition at line 104 of file dungeon_editor.h.
Referenced by DrawDungeonTabView(), DrawObjectRenderer(), DrawRoomGraphics(), DrawRoomSelector(), Initialize(), and RefreshGraphics().
|
private |
Definition at line 105 of file dungeon_editor.h.
Referenced by DrawRoomSelector(), RefreshGraphics(), and UpdateDungeonRoomView().
|
private |
Definition at line 106 of file dungeon_editor.h.
Referenced by Initialize(), and UpdateDungeonRoomView().
|
private |
Definition at line 108 of file dungeon_editor.h.
Referenced by add_room(), DrawDungeonTabView(), DrawEntranceSelector(), and DrawRoomSelector().
|
private |
Definition at line 110 of file dungeon_editor.h.
Referenced by DrawUsageStats().
|
private |
Definition at line 111 of file dungeon_editor.h.
|
private |
Definition at line 112 of file dungeon_editor.h.
Referenced by UpdateDungeonRoomView().
|
private |
Definition at line 113 of file dungeon_editor.h.
Referenced by Initialize().
|
private |
Definition at line 114 of file dungeon_editor.h.
Referenced by Initialize(), and RefreshGraphics().
|
private |
Definition at line 116 of file dungeon_editor.h.
Referenced by DrawDungeonCanvas().
|
private |
Definition at line 117 of file dungeon_editor.h.
Referenced by DrawRoomGraphics().
|
private |
Definition at line 118 of file dungeon_editor.h.
Referenced by DrawObjectRenderer().
|
private |
Definition at line 120 of file dungeon_editor.h.
|
private |
Definition at line 121 of file dungeon_editor.h.
Referenced by DrawRoomGraphics(), Initialize(), and RefreshGraphics().
|
private |
Definition at line 123 of file dungeon_editor.h.
Referenced by Initialize().
|
private |
Definition at line 124 of file dungeon_editor.h.
Referenced by CalculateUsageStats(), DrawDungeonCanvas(), DrawObjectRenderer(), DrawRoomGraphics(), DrawUsageGrid(), Initialize(), LoadDungeonRoomSize(), and RefreshGraphics().
|
private |
Definition at line 125 of file dungeon_editor.h.
Referenced by DrawEntranceSelector(), and Initialize().
|
private |
Definition at line 126 of file dungeon_editor.h.
Referenced by DrawObjectRenderer().
|
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 130 of file dungeon_editor.h.
Referenced by CalculateUsageStats(), and DrawUsageStats().
|
private |
Definition at line 132 of file dungeon_editor.h.
Referenced by Initialize().
|
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 136 of file dungeon_editor.h.
Referenced by DrawUsageGrid(), and DrawUsageStats().
|
private |
Definition at line 138 of file dungeon_editor.h.
Referenced by DrawUsageStats(), and LoadDungeonRoomSize().
|
private |
Definition at line 140 of file dungeon_editor.h.
Referenced by Initialize(), and LoadDungeonRoomSize().
|
private |
Definition at line 141 of file dungeon_editor.h.
Referenced by DrawUsageGrid(), and Initialize().
|
private |
Definition at line 143 of file dungeon_editor.h.
Referenced by Update().