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::editor::Editor | |
Editor ()=default | |
virtual | ~Editor ()=default |
EditorType | type () const |
Public Member Functions inherited from yaze::SharedRom | |
SharedRom ()=default | |
virtual | ~SharedRom ()=default |
std::shared_ptr< Rom > | shared_rom () |
auto | rom () |
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::SharedRom | |
static std::shared_ptr< Rom > | shared_rom_ = nullptr |
Protected Attributes inherited from yaze::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 41 of file dungeon_editor.h.
|
private |
Enumerator | |
---|---|
kNoBackground | |
kBackground1 | |
kBackground2 | |
kBackground3 | |
kBackgroundAny |
Definition at line 80 of file dungeon_editor.h.
|
private |
Enumerator | |
---|---|
kNoType | |
kSprite | |
kItem | |
kDoor | |
kBlock |
Definition at line 87 of file dungeon_editor.h.
|
inline |
Definition at line 43 of file dungeon_editor.h.
References yaze::editor::kDungeon, and yaze::editor::Editor::type_.
|
overridevirtual |
Implements yaze::editor::Editor.
Definition at line 44 of file dungeon_editor.cc.
References CalculateUsageStats(), DrawUsageStats(), END_TAB_ITEM, Initialize(), is_loaded_, refresh_graphics_, RefreshGraphics(), RETURN_IF_ERROR, yaze::SharedRom::rom(), status_, TAB_ITEM, and UpdateDungeonRoomView().
|
inlineoverridevirtual |
Implements yaze::editor::Editor.
Definition at line 46 of file dungeon_editor.h.
Referenced by DrawToolset().
|
inlineoverridevirtual |
Implements yaze::editor::Editor.
Definition at line 47 of file dungeon_editor.h.
Referenced by DrawToolset().
|
inlineoverridevirtual |
Implements yaze::editor::Editor.
Definition at line 48 of file dungeon_editor.h.
|
inlineoverridevirtual |
Implements yaze::editor::Editor.
Definition at line 49 of file dungeon_editor.h.
|
inlineoverridevirtual |
Implements yaze::editor::Editor.
Definition at line 50 of file dungeon_editor.h.
|
inlineoverridevirtual |
Implements yaze::editor::Editor.
Definition at line 51 of file dungeon_editor.h.
|
inline |
Definition at line 53 of file dungeon_editor.h.
References active_rooms_.
|
private |
Definition at line 75 of file dungeon_editor.cc.
References ASSIGN_OR_RETURN, yaze::gfx::CreatePaletteGroupFromLargePalette(), current_palette_group_, current_palette_group_id_, current_room_id_, entrances_, full_palette_, yaze::core::FeatureFlags::get(), yaze::GraphicsSheetManager::GetInstance(), yaze::GraphicsSheetManager::gfx_sheets(), graphics_bin_, LoadDungeonRoomSize(), yaze::SharedRom::rom(), room_gfx_sheets_, room_palette_, room_size_addresses_, room_size_pointers_, and rooms_.
Referenced by Update().
|
private |
Definition at line 122 of file dungeon_editor.cc.
References current_palette_group_, current_palette_id_, current_room_id_, yaze::editor::Renderer::GetInstance(), graphics_bin_, RETURN_IF_ERROR, yaze::SharedRom::rom(), rooms_, and yaze::core::Renderer::UpdateBitmap().
Referenced by Update().
|
private |
Definition at line 144 of file dungeon_editor.cc.
References room_size_addresses_, rooms_, and total_room_size_.
Referenced by Initialize().
|
private |
Definition at line 186 of file dungeon_editor.cc.
References current_palette_, current_palette_group_id_, current_palette_id_, DrawDungeonTabView(), DrawEntranceSelector(), DrawRoomSelector(), DrawTileSelector(), DrawToolset(), END_TAB_ITEM, yaze::editor::kDungeonTableFlags, palette_showing_, refresh_graphics_, yaze::SharedRom::rom(), yaze::gui::SelectablePalettePipeline(), and TAB_ITEM.
Referenced by Update().
|
private |
Definition at line 227 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 321 of file dungeon_editor.cc.
References active_rooms_, current_palette_id_, current_room_id_, yaze::util::HexByte(), yaze::gui::InputHex(), yaze::gui::InputHexWord(), yaze::zelda3::kRoomNames, and yaze::SharedRom::rom().
Referenced by UpdateDungeonRoomView().
|
private |
Definition at line 350 of file dungeon_editor.cc.
References active_rooms_, current_entrance_id_, entrances_, yaze::util::HexByte(), yaze::gui::InputHexByte(), yaze::gui::InputHexWord(), yaze::zelda3::kEntranceNames, and yaze::SharedRom::rom().
Referenced by UpdateDungeonRoomView().
|
private |
Definition at line 421 of file dungeon_editor.cc.
References active_rooms_, current_room_id_, DrawDungeonCanvas(), ICON_MD_ADD, yaze::editor::kDungeonTabBarFlags, yaze::editor::kDungeonTabFlags, and yaze::zelda3::kRoomNames.
Referenced by UpdateDungeonRoomView().
|
private |
Definition at line 460 of file dungeon_editor.cc.
References canvas_, yaze::gui::InputHexByte(), yaze::gui::InputHexWord(), is_loaded_, and rooms_.
Referenced by DrawDungeonTabView().
|
private |
Definition at line 494 of file dungeon_editor.cc.
References current_room_id_, graphics_bin_, is_loaded_, room_gfx_canvas_, and rooms_.
Referenced by DrawTileSelector().
|
private |
Definition at line 521 of file dungeon_editor.cc.
References DrawObjectRenderer(), and DrawRoomGraphics().
Referenced by UpdateDungeonRoomView().
|
private |
Definition at line 541 of file dungeon_editor.cc.
References current_object_, current_room_id_, yaze::editor::Renderer::GetInstance(), yaze::editor::kDungeonObjectTableFlags, object_canvas_, object_loaded_, object_renderer_, yaze::core::Renderer::RenderBitmap(), and rooms_.
Referenced by DrawTileSelector().
|
private |
Definition at line 593 of file dungeon_editor.cc.
References blockset_usage_, palette_usage_, rooms_, and spriteset_usage_.
Referenced by DrawUsageStats(), and Update().
|
private |
Definition at line 663 of file dungeon_editor.cc.
References blockset_usage_, CalculateUsageStats(), DrawUsageGrid(), gfx_group_editor_, yaze::editor::kDungeonTableFlags, palette_usage_, RenderSetUsage(), selected_blockset_, selected_palette_, selected_spriteset_, spriteset_usage_, and total_room_size_.
Referenced by Update().
|
private |
Definition at line 748 of file dungeon_editor.cc.
References room_palette_, rooms_, selected_blockset_, selected_palette_, and selected_spriteset_.
Referenced by DrawUsageStats().
|
private |
Definition at line 615 of file dungeon_editor.cc.
Referenced by DrawUsageStats().
|
private |
Definition at line 89 of file dungeon_editor.h.
Referenced by DrawToolset().
|
private |
Definition at line 90 of file dungeon_editor.h.
Referenced by DrawToolset().
|
private |
Definition at line 91 of file dungeon_editor.h.
Referenced by DrawObjectRenderer().
|
private |
Definition at line 93 of file dungeon_editor.h.
Referenced by DrawDungeonCanvas(), DrawRoomGraphics(), and Update().
|
private |
Definition at line 94 of file dungeon_editor.h.
Referenced by DrawObjectRenderer().
|
private |
Definition at line 95 of file dungeon_editor.h.
Referenced by DrawToolset(), and UpdateDungeonRoomView().
|
private |
Definition at line 96 of file dungeon_editor.h.
Referenced by Update(), and UpdateDungeonRoomView().
|
private |
Definition at line 98 of file dungeon_editor.h.
Referenced by DrawEntranceSelector().
|
private |
Definition at line 99 of file dungeon_editor.h.
Referenced by DrawDungeonTabView(), DrawObjectRenderer(), DrawRoomGraphics(), DrawRoomSelector(), Initialize(), and RefreshGraphics().
|
private |
Definition at line 100 of file dungeon_editor.h.
Referenced by DrawRoomSelector(), RefreshGraphics(), and UpdateDungeonRoomView().
|
private |
Definition at line 101 of file dungeon_editor.h.
Referenced by Initialize(), and UpdateDungeonRoomView().
|
private |
Definition at line 103 of file dungeon_editor.h.
Referenced by add_room(), DrawDungeonTabView(), DrawEntranceSelector(), and DrawRoomSelector().
|
private |
Definition at line 105 of file dungeon_editor.h.
Referenced by DrawUsageStats().
|
private |
Definition at line 106 of file dungeon_editor.h.
|
private |
Definition at line 107 of file dungeon_editor.h.
Referenced by UpdateDungeonRoomView().
|
private |
Definition at line 108 of file dungeon_editor.h.
Referenced by Initialize().
|
private |
Definition at line 109 of file dungeon_editor.h.
Referenced by Initialize(), and RefreshGraphics().
|
private |
Definition at line 111 of file dungeon_editor.h.
Referenced by DrawDungeonCanvas().
|
private |
Definition at line 112 of file dungeon_editor.h.
Referenced by DrawRoomGraphics().
|
private |
Definition at line 113 of file dungeon_editor.h.
Referenced by DrawObjectRenderer().
|
private |
Definition at line 115 of file dungeon_editor.h.
|
private |
Definition at line 116 of file dungeon_editor.h.
Referenced by DrawRoomGraphics(), Initialize(), and RefreshGraphics().
|
private |
Definition at line 118 of file dungeon_editor.h.
Referenced by Initialize().
|
private |
Definition at line 119 of file dungeon_editor.h.
Referenced by CalculateUsageStats(), DrawDungeonCanvas(), DrawObjectRenderer(), DrawRoomGraphics(), DrawUsageGrid(), Initialize(), LoadDungeonRoomSize(), and RefreshGraphics().
|
private |
Definition at line 120 of file dungeon_editor.h.
Referenced by DrawEntranceSelector(), and Initialize().
|
private |
Definition at line 121 of file dungeon_editor.h.
Referenced by DrawObjectRenderer().
|
private |
Definition at line 123 of file dungeon_editor.h.
Referenced by CalculateUsageStats(), and DrawUsageStats().
|
private |
Definition at line 124 of file dungeon_editor.h.
Referenced by CalculateUsageStats(), and DrawUsageStats().
|
private |
Definition at line 125 of file dungeon_editor.h.
Referenced by CalculateUsageStats(), and DrawUsageStats().
|
private |
Definition at line 127 of file dungeon_editor.h.
Referenced by Initialize().
|
private |
Definition at line 129 of file dungeon_editor.h.
Referenced by DrawUsageGrid(), and DrawUsageStats().
|
private |
Definition at line 130 of file dungeon_editor.h.
Referenced by DrawUsageGrid(), and DrawUsageStats().
|
private |
Definition at line 131 of file dungeon_editor.h.
Referenced by DrawUsageGrid(), and DrawUsageStats().
|
private |
Definition at line 133 of file dungeon_editor.h.
Referenced by DrawUsageStats(), and LoadDungeonRoomSize().
|
private |
Definition at line 135 of file dungeon_editor.h.
Referenced by Initialize(), and LoadDungeonRoomSize().
|
private |
Definition at line 136 of file dungeon_editor.h.
Referenced by DrawUsageGrid(), and Initialize().
|
private |
Definition at line 138 of file dungeon_editor.h.
Referenced by Update().