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

Manipulates the Overworld and OverworldMap data in a Rom. More...

#include <overworld_editor.h>

Inheritance diagram for yaze::editor::OverworldEditor:

Classes

struct  ScratchSpaceSlot
 

Public Member Functions

 OverworldEditor (Rom *rom)
 
void Initialize (gfx::IRenderer *renderer, Rom *rom)
 
void Initialize () override
 
absl::Status Load () override
 
absl::Status Update () final
 
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 Clear () override
 
zelda3::Overworldoverworld ()
 
absl::Status ApplyZSCustomOverworldASM (int target_version)
 Apply ZSCustomOverworld ASM patch to upgrade ROM version.
 
absl::Status UpdateROMVersionMarkers (int target_version)
 Update ROM version markers and feature flags after ASM patching.
 
int jump_to_tab ()
 
bool IsRomLoaded () const override
 
std::string GetRomStatus () const override
 
void set_current_map (int map_id)
 
absl::Status LoadGraphics ()
 Load the Bitmap objects for each OverworldMap.
 
- Public Member Functions inherited from yaze::editor::Editor
 Editor ()=default
 
virtual ~Editor ()=default
 
EditorType type () const
 
void set_context (EditorContext *context)
 
bool * active ()
 
void set_active (bool active)
 

Public Attributes

int jump_to_tab_ = -1
 

Private Types

enum class  EditingMode { MOUSE , DRAW_TILE }
 
enum class  EntityEditMode {
  NONE , ENTRANCES , EXITS , ITEMS ,
  SPRITES , TRANSPORTS , MUSIC
}
 
enum  OverworldProperty {
  LW_AREA_GFX , DW_AREA_GFX , LW_AREA_PAL , DW_AREA_PAL ,
  LW_SPR_GFX_PART1 , LW_SPR_GFX_PART2 , DW_SPR_GFX_PART1 , DW_SPR_GFX_PART2 ,
  LW_SPR_PAL_PART1 , LW_SPR_PAL_PART2 , DW_SPR_PAL_PART1 , DW_SPR_PAL_PART2
}
 

Private Member Functions

void DrawFullscreenCanvas ()
 
void DrawToolset ()
 
void RefreshChildMap (int map_index)
 
void RefreshOverworldMap ()
 
void RefreshOverworldMapOnDemand (int map_index)
 On-demand map refresh that only updates what's actually needed.
 
void RefreshChildMapOnDemand (int map_index)
 On-demand child map refresh with selective updates.
 
void RefreshMultiAreaMapsSafely (int map_index, zelda3::OverworldMap *map)
 Safely refresh multi-area maps without recursion.
 
absl::Status RefreshMapPalette ()
 
void RefreshMapProperties ()
 
absl::Status RefreshTile16Blockset ()
 
void ForceRefreshGraphics (int map_index)
 
void RefreshSiblingMapGraphics (int map_index, bool include_self=false)
 
void DrawOverworldMaps ()
 
void DrawOverworldEdits ()
 
void RenderUpdatedMapBitmap (const ImVec2 &click_position, const std::vector< uint8_t > &tile_data)
 
void CheckForOverworldEdits ()
 Check for changes to the overworld map.
 
void CheckForSelectRectangle ()
 Draw and create the tile16 IDs that are currently selected.
 
absl::Status CheckForCurrentMap ()
 Check for changes to the overworld map. Calls RefreshOverworldMap and RefreshTile16Blockset on the current map if it is modified and is actively being edited.
 
void CheckForMousePan ()
 
void DrawOverworldCanvas ()
 
absl::Status DrawTile16Selector ()
 
void DrawTile8Selector ()
 
absl::Status DrawAreaGraphics ()
 
void UpdateBlocksetSelectorState ()
 
absl::Status LoadSpriteGraphics ()
 
void ProcessDeferredTextures ()
 Create textures for deferred map bitmaps on demand.
 
void EnsureMapTexture (int map_index)
 Ensure a specific map has its texture created.
 
void DrawOverworldProperties ()
 
void HandleMapInteraction ()
 
void HandleOverworldPan ()
 
void HandleOverworldZoom ()
 
void ResetOverworldView ()
 
void CenterOverworldView ()
 
void SetupCanvasAutomation ()
 
gui::CanvasGetOverworldCanvas ()
 
bool AutomationSetTile (int x, int y, int tile_id)
 
int AutomationGetTile (int x, int y)
 
void ScrollBlocksetCanvasToCurrentTile ()
 Scroll the blockset canvas to show the current selected tile16.
 
absl::Status DrawScratchSpace ()
 
absl::Status SaveCurrentSelectionToScratch (int slot)
 
absl::Status LoadScratchToSelection (int slot)
 
absl::Status ClearScratchSpace (int slot)
 
void DrawScratchSpaceEdits ()
 
void DrawScratchSpacePattern ()
 
void DrawScratchSpaceSelection ()
 
void UpdateScratchBitmapTile (int tile_x, int tile_y, int tile_id, int slot=-1)
 
absl::Status UpdateUsageStats ()
 
void DrawUsageGrid ()
 
void DrawDebugWindow ()
 

Private Attributes

std::vector< int > selected_tile16_ids_
 
EditingMode current_mode = EditingMode::DRAW_TILE
 
EditingMode previous_mode = EditingMode::DRAW_TILE
 
EntityEditMode entity_edit_mode_ = EntityEditMode::NONE
 
int current_world_ = 0
 
int current_map_ = 0
 
int current_parent_ = 0
 
int current_entrance_id_ = 0
 
int current_exit_id_ = 0
 
int current_item_id_ = 0
 
int current_sprite_id_ = 0
 
int current_blockset_ = 0
 
int game_state_ = 1
 
int current_tile16_ = 0
 
int selected_entrance_ = 0
 
int selected_usage_map_ = 0xFFFF
 
bool all_gfx_loaded_ = false
 
bool map_blockset_loaded_ = false
 
bool selected_tile_loaded_ = false
 
bool show_tile16_editor_ = false
 
bool show_gfx_group_editor_ = false
 
bool show_properties_editor_ = false
 
bool overworld_canvas_fullscreen_ = false
 
bool middle_mouse_dragging_ = false
 
bool is_dragging_entity_ = false
 
bool dragged_entity_free_movement_ = false
 
bool current_map_lock_ = false
 
bool show_custom_bg_color_editor_ = false
 
bool show_overlay_editor_ = false
 
bool use_area_specific_bg_color_ = false
 
bool show_map_properties_panel_ = false
 
bool show_overlay_preview_ = false
 
bool show_tile16_selector_ = false
 
bool show_tile8_selector_ = false
 
bool show_area_gfx_ = false
 
bool show_scratch_ = false
 
bool show_gfx_groups_ = false
 
bool show_usage_stats_ = false
 
bool show_v3_settings_ = false
 
std::unique_ptr< MapPropertiesSystemmap_properties_system_
 
std::unique_ptr< OverworldEntityRendererentity_renderer_
 
std::array< ScratchSpaceSlot, 4 > scratch_spaces_
 
int current_scratch_slot_ = 0
 
gfx::Tilemap tile16_blockset_
 
Romrom_
 
gfx::IRendererrenderer_
 
Tile16Editor tile16_editor_ {rom_, &tile16_blockset_}
 
GfxGroupEditor gfx_group_editor_
 
PaletteEditor palette_editor_
 
gfx::SnesPalette palette_
 
gfx::Bitmap selected_tile_bmp_
 
gfx::Bitmap tile16_blockset_bmp_
 
gfx::Bitmap current_gfx_bmp_
 
gfx::Bitmap all_gfx_bmp
 
std::array< gfx::Bitmap, zelda3::kNumOverworldMapsmaps_bmp_
 
gfx::BitmapTable current_graphics_set_
 
std::vector< gfx::Bitmapsprite_previews_
 
zelda3::Overworld overworld_ {rom_}
 
zelda3::OverworldBlockset refresh_blockset_
 
zelda3::Sprite current_sprite_
 
zelda3::OverworldEntrance current_entrance_
 
zelda3::OverworldExit current_exit_
 
zelda3::OverworldItem current_item_
 
zelda3::OverworldEntranceTileTypes entrance_tiletypes_ = {}
 
zelda3::GameEntitycurrent_entity_ = nullptr
 
zelda3::GameEntitydragged_entity_ = nullptr
 
gui::Canvas ow_map_canvas_
 
gui::Canvas current_gfx_canvas_
 
gui::Canvas blockset_canvas_
 
std::unique_ptr< gui::TileSelectorWidgetblockset_selector_
 
gui::Canvas graphics_bin_canvas_
 
gui::Canvas properties_canvas_
 
gui::Canvas scratch_canvas_ {"ScratchSpace", ImVec2(320, 480), gui::CanvasGridSize::k32x32}
 
absl::Status status_
 

Additional Inherited Members

- Protected Member Functions inherited from yaze::editor::Editor
std::string MakeCardTitle (const std::string &base_title) 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_
 
EditorContextcontext_ = nullptr
 
- Static Protected Attributes inherited from yaze::gfx::GfxContext
static std::unordered_map< uint8_t, gfx::Palettesetpalettesets_
 

Detailed Description

Manipulates the Overworld and OverworldMap data in a Rom.

The OverworldEditor class is responsible for managing the editing and manipulation of the overworld in a game. The user can drag and drop tiles, modify OverworldEntrance, OverworldExit, Sprite, and OverworldItem as well as change the gfx and palettes used in each overworld map.

The Overworld itself is a series of bitmap images which exist inside each OverworldMap object. The drawing of the overworld is done using the Canvas class in conjunction with these underlying Bitmap objects.

Provides access to the GfxGroupEditor and Tile16Editor through popup windows.

Definition at line 64 of file overworld_editor.h.

Member Enumeration Documentation

◆ EditingMode

Enumerator
MOUSE 
DRAW_TILE 

Definition at line 232 of file overworld_editor.h.

◆ EntityEditMode

Enumerator
NONE 
ENTRANCES 
EXITS 
ITEMS 
SPRITES 
TRANSPORTS 
MUSIC 

Definition at line 241 of file overworld_editor.h.

◆ OverworldProperty

Enumerator
LW_AREA_GFX 
DW_AREA_GFX 
LW_AREA_PAL 
DW_AREA_PAL 
LW_SPR_GFX_PART1 
LW_SPR_GFX_PART2 
DW_SPR_GFX_PART1 
DW_SPR_GFX_PART2 
LW_SPR_PAL_PART1 
LW_SPR_PAL_PART2 
DW_SPR_PAL_PART1 
DW_SPR_PAL_PART2 

Definition at line 253 of file overworld_editor.h.

Constructor & Destructor Documentation

◆ OverworldEditor()

yaze::editor::OverworldEditor::OverworldEditor ( Rom rom)
inlineexplicit

Definition at line 66 of file overworld_editor.h.

References gfx_group_editor_, yaze::editor::kOverworld, yaze::editor::GfxGroupEditor::set_rom(), and yaze::editor::Editor::type_.

Here is the call graph for this function:

Member Function Documentation

◆ Initialize() [1/2]

void yaze::editor::OverworldEditor::Initialize ( gfx::IRenderer renderer,
Rom rom 
)

◆ Initialize() [2/2]

◆ Load()

◆ Update()

absl::Status yaze::editor::OverworldEditor::Update ( )
finalvirtual

Implements yaze::editor::Editor.

Definition at line 185 of file overworld_editor.cc.

References yaze::gui::EditorCard::Begin(), yaze::gui::BeginChildWithScrollbar(), yaze::gui::BeginPadding(), yaze::gui::CenterText(), current_entity_, current_entrance_, current_exit_, current_item_, current_map_, current_mode, current_sprite_, DrawAreaGraphics(), yaze::editor::DrawExitEditorPopup(), DrawFullscreenCanvas(), yaze::editor::DrawItemEditorPopup(), DrawOverworldCanvas(), yaze::editor::DrawOverworldEntrancePopup(), DrawScratchSpace(), yaze::editor::DrawSpriteEditorPopup(), DrawTile16Selector(), DrawTile8Selector(), DrawToolset(), yaze::gui::EditorCard::End(), yaze::gui::EndNoPadding(), entity_renderer_, yaze::zelda3::GameEntity::entity_type_, yaze::gui::EditorCard::Floating, gfx_group_editor_, ICON_MD_ANALYTICS, ICON_MD_BRUSH, ICON_MD_COLLECTIONS, ICON_MD_FORMAT_COLOR_FILL, ICON_MD_GRID_3X3, ICON_MD_GRID_4X4, ICON_MD_GRID_ON, ICON_MD_IMAGE, ICON_MD_LAYERS, ICON_MD_TUNE, yaze::Rom::is_loaded(), yaze::zelda3::Overworld::is_loaded(), jump_to_tab_, yaze::zelda3::GameEntity::kEntrance, yaze::zelda3::GameEntity::kExit, yaze::zelda3::GameEntity::kItem, yaze::zelda3::GameEntity::kSprite, yaze::editor::Editor::MakeCardTitle(), map_properties_system_, MOUSE, overworld_, overworld_canvas_fullscreen_, ProcessDeferredTextures(), yaze::gui::EditorCard::Right, rom_, yaze::Rom::set_dirty(), yaze::gui::EditorCard::SetDefaultSize(), yaze::gui::EditorCard::SetPosition(), show_area_gfx_, show_custom_bg_color_editor_, show_gfx_groups_, show_map_properties_panel_, show_overlay_editor_, show_scratch_, show_tile16_editor_, show_tile16_selector_, show_tile8_selector_, show_usage_stats_, status_, tile16_editor_, yaze::editor::GfxGroupEditor::Update(), yaze::editor::Tile16Editor::Update(), UpdateUsageStats(), and yaze::gui::VerticalSpacing().

◆ Undo()

absl::Status yaze::editor::OverworldEditor::Undo ( )
inlineoverridevirtual

Implements yaze::editor::Editor.

Definition at line 76 of file overworld_editor.h.

◆ Redo()

absl::Status yaze::editor::OverworldEditor::Redo ( )
inlineoverridevirtual

Implements yaze::editor::Editor.

Definition at line 77 of file overworld_editor.h.

◆ Cut()

absl::Status yaze::editor::OverworldEditor::Cut ( )
inlineoverridevirtual

Implements yaze::editor::Editor.

Definition at line 78 of file overworld_editor.h.

◆ Copy()

◆ Paste()

◆ Find()

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

Implements yaze::editor::Editor.

Definition at line 81 of file overworld_editor.h.

◆ Save()

◆ Clear()

absl::Status yaze::editor::OverworldEditor::Clear ( )
overridevirtual

Reimplemented from yaze::editor::Editor.

Definition at line 2716 of file overworld_editor.cc.

References all_gfx_loaded_, current_graphics_set_, yaze::zelda3::Overworld::Destroy(), map_blockset_loaded_, and overworld_.

Referenced by DrawToolset().

Here is the call graph for this function:

◆ overworld()

zelda3::Overworld & yaze::editor::OverworldEditor::overworld ( )
inline

Definition at line 84 of file overworld_editor.h.

References overworld_.

Referenced by LoadGraphics(), yaze::editor::EditorManager::overworld(), and Save().

◆ ApplyZSCustomOverworldASM()

absl::Status yaze::editor::OverworldEditor::ApplyZSCustomOverworldASM ( int  target_version)

◆ UpdateROMVersionMarkers()

◆ jump_to_tab()

int yaze::editor::OverworldEditor::jump_to_tab ( )
inline

Definition at line 96 of file overworld_editor.h.

References jump_to_tab_.

◆ IsRomLoaded()

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

Reimplemented from yaze::editor::Editor.

Definition at line 100 of file overworld_editor.h.

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

Here is the call graph for this function:

◆ GetRomStatus()

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

Reimplemented from yaze::editor::Editor.

Definition at line 101 of file overworld_editor.h.

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

Here is the call graph for this function:

◆ set_current_map()

void yaze::editor::OverworldEditor::set_current_map ( int  map_id)
inline

◆ LoadGraphics()

◆ DrawFullscreenCanvas()

void yaze::editor::OverworldEditor::DrawFullscreenCanvas ( )
private

Definition at line 427 of file overworld_editor.cc.

References DrawOverworldCanvas(), DrawToolset(), and overworld_canvas_fullscreen_.

Referenced by Update().

Here is the call graph for this function:

◆ DrawToolset()

void yaze::editor::OverworldEditor::DrawToolset ( )
private

◆ RefreshChildMap()

void yaze::editor::OverworldEditor::RefreshChildMap ( int  map_index)
private

◆ RefreshOverworldMap()

void yaze::editor::OverworldEditor::RefreshOverworldMap ( )
private

Definition at line 1915 of file overworld_editor.cc.

References current_map_, and RefreshOverworldMapOnDemand().

Referenced by CheckForCurrentMap(), CheckForOverworldEdits(), Initialize(), Load(), and Paste().

Here is the call graph for this function:

◆ RefreshOverworldMapOnDemand()

void yaze::editor::OverworldEditor::RefreshOverworldMapOnDemand ( int  map_index)
private

On-demand map refresh that only updates what's actually needed.

This method intelligently determines what needs to be refreshed based on the type of change and only updates the necessary components, avoiding expensive full rebuilds when possible.

Definition at line 1927 of file overworld_editor.cc.

References current_map_, current_world_, yaze::zelda3::kNumOverworldMaps, maps_bmp_, and RefreshChildMapOnDemand().

Referenced by ProcessDeferredTextures(), and RefreshOverworldMap().

Here is the call graph for this function:

◆ RefreshChildMapOnDemand()

◆ RefreshMultiAreaMapsSafely()

void yaze::editor::OverworldEditor::RefreshMultiAreaMapsSafely ( int  map_index,
zelda3::OverworldMap map 
)
private

Safely refresh multi-area maps without recursion.

This function handles the coordination of large, wide, and tall area maps by using a non-recursive approach with explicit map list processing. It respects the ZScream area size logic and prevents infinite recursion.

Definition at line 2029 of file overworld_editor.cc.

References yaze::zelda3::OverworldMap::area_size(), yaze::zelda3::Overworld::current_area_palette(), current_map_, current_world_, EnsureMapTexture(), yaze::gfx::Arena::Get(), yaze::zelda3::Overworld::GetMapTiles(), yaze::zelda3::kNumOverworldMaps, LOG_DEBUG, LOG_ERROR, LOG_WARN, maps_bmp_, yaze::zelda3::Overworld::mutable_overworld_map(), yaze::zelda3::Overworld::mutable_tiles16(), overworld_, yaze::zelda3::OverworldMap::parent(), yaze::gfx::Arena::QueueTextureCommand(), yaze::zelda3::Overworld::tiles16(), and yaze::gfx::Arena::UPDATE.

Referenced by RefreshChildMapOnDemand().

◆ RefreshMapPalette()

absl::Status yaze::editor::OverworldEditor::RefreshMapPalette ( )
private

◆ RefreshMapProperties()

void yaze::editor::OverworldEditor::RefreshMapProperties ( )
private

◆ RefreshTile16Blockset()

◆ ForceRefreshGraphics()

void yaze::editor::OverworldEditor::ForceRefreshGraphics ( int  map_index)
private

Definition at line 2258 of file overworld_editor.cc.

References current_blockset_, LOG_DEBUG, and maps_bmp_.

Referenced by Initialize().

◆ RefreshSiblingMapGraphics()

void yaze::editor::OverworldEditor::RefreshSiblingMapGraphics ( int  map_index,
bool  include_self = false 
)
private

◆ DrawOverworldMaps()

void yaze::editor::OverworldEditor::DrawOverworldMaps ( )
private

◆ DrawOverworldEdits()

◆ RenderUpdatedMapBitmap()

void yaze::editor::OverworldEditor::RenderUpdatedMapBitmap ( const ImVec2 &  click_position,
const std::vector< uint8_t > &  tile_data 
)
private

◆ CheckForOverworldEdits()

void yaze::editor::OverworldEditor::CheckForOverworldEdits ( )
private

Check for changes to the overworld map.

This function either draws the tile painter with the current tile16 or group of tile16 data with ow_map_canvas_ and DrawOverworldEdits or it checks for left mouse button click/drag to select a tile16 or group of tile16 data from the overworld map canvas. Similar to ZScream selection.

Definition at line 868 of file overworld_editor.cc.

References CheckForSelectRectangle(), current_tile16_, current_world_, DrawOverworldEdits(), yaze::gui::Canvas::DrawTilemapPainter(), yaze::gfx::GetTilemapData(), yaze::editor::kTile16Size, LOG_DEBUG, LOG_ERROR, yaze::zelda3::Overworld::mutable_map_tiles(), overworld_, ow_map_canvas_, RefreshOverworldMap(), RenderUpdatedMapBitmap(), yaze::gui::Canvas::select_rect_active(), yaze::gui::Canvas::selected_points(), selected_tile16_ids_, and tile16_blockset_.

Referenced by DrawOverworldCanvas().

◆ CheckForSelectRectangle()

◆ CheckForCurrentMap()

absl::Status yaze::editor::OverworldEditor::CheckForCurrentMap ( )
private

◆ CheckForMousePan()

void yaze::editor::OverworldEditor::CheckForMousePan ( )
private

Definition at line 1413 of file overworld_editor.cc.

References HandleOverworldPan().

Here is the call graph for this function:

◆ DrawOverworldCanvas()

◆ DrawTile16Selector()

◆ DrawTile8Selector()

◆ DrawAreaGraphics()

◆ UpdateBlocksetSelectorState()

void yaze::editor::OverworldEditor::UpdateBlocksetSelectorState ( )
private

◆ LoadSpriteGraphics()

absl::Status yaze::editor::OverworldEditor::LoadSpriteGraphics ( )
private
Todo:
Queue texture for later rendering.

Definition at line 1817 of file overworld_editor.cc.

References yaze::zelda3::Overworld::mutable_sprites(), overworld_, palette_, and sprite_previews_.

Referenced by LoadGraphics().

Here is the call graph for this function:

◆ ProcessDeferredTextures()

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

Create textures for deferred map bitmaps on demand.

This method should be called periodically to create textures for maps that are needed but haven't had their textures created yet. This allows for smooth loading without blocking the main thread during ROM loading.

Definition at line 1839 of file overworld_editor.cc.

References current_map_, current_world_, yaze::gfx::Arena::Get(), yaze::zelda3::kNumOverworldMaps, maps_bmp_, yaze::gfx::Arena::ProcessTextureQueue(), RefreshOverworldMapOnDemand(), and renderer_.

Referenced by Update().

Here is the call graph for this function:

◆ EnsureMapTexture()

void yaze::editor::OverworldEditor::EnsureMapTexture ( int  map_index)
private

◆ DrawOverworldProperties()

◆ HandleMapInteraction()

void yaze::editor::OverworldEditor::HandleMapInteraction ( )
private

◆ HandleOverworldPan()

void yaze::editor::OverworldEditor::HandleOverworldPan ( )
private

◆ HandleOverworldZoom()

◆ ResetOverworldView()

void yaze::editor::OverworldEditor::ResetOverworldView ( )
private

Definition at line 1394 of file overworld_editor.cc.

References ow_map_canvas_, yaze::gui::Canvas::set_global_scale(), and yaze::gui::Canvas::set_scrolling().

Here is the call graph for this function:

◆ CenterOverworldView()

void yaze::editor::OverworldEditor::CenterOverworldView ( )
private

Definition at line 1399 of file overworld_editor.cc.

References yaze::gui::Canvas::canvas_size(), yaze::gui::Canvas::global_scale(), ow_map_canvas_, and yaze::gui::Canvas::set_scrolling().

Here is the call graph for this function:

◆ SetupCanvasAutomation()

void yaze::editor::OverworldEditor::SetupCanvasAutomation ( )
private

◆ GetOverworldCanvas()

gui::Canvas * yaze::editor::OverworldEditor::GetOverworldCanvas ( )
inlineprivate

Definition at line 207 of file overworld_editor.h.

References ow_map_canvas_.

◆ AutomationSetTile()

◆ AutomationGetTile()

int yaze::editor::OverworldEditor::AutomationGetTile ( int  x,
int  y 
)
private

◆ ScrollBlocksetCanvasToCurrentTile()

void yaze::editor::OverworldEditor::ScrollBlocksetCanvasToCurrentTile ( )
private

Scroll the blockset canvas to show the current selected tile16.

Definition at line 2464 of file overworld_editor.cc.

References blockset_selector_, and current_tile16_.

Referenced by CheckForSelectRectangle().

◆ DrawScratchSpace()

◆ SaveCurrentSelectionToScratch()

◆ LoadScratchToSelection()

absl::Status yaze::editor::OverworldEditor::LoadScratchToSelection ( int  slot)
private

Definition at line 409 of file scratch_space.cc.

References yaze::util::logf(), and scratch_spaces_.

Referenced by DrawScratchSpace().

Here is the call graph for this function:

◆ ClearScratchSpace()

absl::Status yaze::editor::OverworldEditor::ClearScratchSpace ( int  slot)
private

Definition at line 425 of file scratch_space.cc.

References yaze::gfx::Arena::Get(), yaze::gfx::Arena::QueueTextureCommand(), scratch_spaces_, and yaze::gfx::Arena::UPDATE.

Referenced by DrawScratchSpace().

Here is the call graph for this function:

◆ DrawScratchSpaceEdits()

void yaze::editor::OverworldEditor::DrawScratchSpaceEdits ( )
private

◆ DrawScratchSpacePattern()

◆ DrawScratchSpaceSelection()

void yaze::editor::OverworldEditor::DrawScratchSpaceSelection ( )
private

◆ UpdateScratchBitmapTile()

void yaze::editor::OverworldEditor::UpdateScratchBitmapTile ( int  tile_x,
int  tile_y,
int  tile_id,
int  slot = -1 
)
private

◆ UpdateUsageStats()

◆ DrawUsageGrid()

void yaze::editor::OverworldEditor::DrawUsageGrid ( )
private

Definition at line 2640 of file overworld_editor.cc.

References yaze::gui::GetSelectedColor(), and selected_usage_map_.

Referenced by UpdateUsageStats().

Here is the call graph for this function:

◆ DrawDebugWindow()

void yaze::editor::OverworldEditor::DrawDebugWindow ( )
private

Member Data Documentation

◆ jump_to_tab_

int yaze::editor::OverworldEditor::jump_to_tab_ = -1

Definition at line 97 of file overworld_editor.h.

Referenced by jump_to_tab(), and Update().

◆ selected_tile16_ids_

std::vector<int> yaze::editor::OverworldEditor::selected_tile16_ids_
private

Definition at line 160 of file overworld_editor.h.

Referenced by CheckForOverworldEdits(), and CheckForSelectRectangle().

◆ current_mode

EditingMode yaze::editor::OverworldEditor::current_mode = EditingMode::DRAW_TILE
private

Definition at line 237 of file overworld_editor.h.

Referenced by DrawOverworldCanvas(), DrawToolset(), and Update().

◆ previous_mode

EditingMode yaze::editor::OverworldEditor::previous_mode = EditingMode::DRAW_TILE
private

Definition at line 238 of file overworld_editor.h.

◆ entity_edit_mode_

EntityEditMode yaze::editor::OverworldEditor::entity_edit_mode_ = EntityEditMode::NONE
private

Definition at line 251 of file overworld_editor.h.

Referenced by DrawOverworldCanvas(), and DrawToolset().

◆ current_world_

◆ current_map_

◆ current_parent_

int yaze::editor::OverworldEditor::current_parent_ = 0
private

Definition at line 270 of file overworld_editor.h.

Referenced by CheckForCurrentMap().

◆ current_entrance_id_

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

Definition at line 271 of file overworld_editor.h.

◆ current_exit_id_

int yaze::editor::OverworldEditor::current_exit_id_ = 0
private

Definition at line 272 of file overworld_editor.h.

◆ current_item_id_

int yaze::editor::OverworldEditor::current_item_id_ = 0
private

Definition at line 273 of file overworld_editor.h.

◆ current_sprite_id_

int yaze::editor::OverworldEditor::current_sprite_id_ = 0
private

Definition at line 274 of file overworld_editor.h.

◆ current_blockset_

int yaze::editor::OverworldEditor::current_blockset_ = 0
private

Definition at line 275 of file overworld_editor.h.

Referenced by ForceRefreshGraphics(), and RefreshTile16Blockset().

◆ game_state_

int yaze::editor::OverworldEditor::game_state_ = 1
private

Definition at line 276 of file overworld_editor.h.

Referenced by DrawOverworldCanvas(), and RefreshMapProperties().

◆ current_tile16_

◆ selected_entrance_

int yaze::editor::OverworldEditor::selected_entrance_ = 0
private

Definition at line 278 of file overworld_editor.h.

Referenced by UpdateUsageStats().

◆ selected_usage_map_

int yaze::editor::OverworldEditor::selected_usage_map_ = 0xFFFF
private

Definition at line 279 of file overworld_editor.h.

Referenced by DrawUsageGrid(), and UpdateUsageStats().

◆ all_gfx_loaded_

bool yaze::editor::OverworldEditor::all_gfx_loaded_ = false
private

◆ map_blockset_loaded_

bool yaze::editor::OverworldEditor::map_blockset_loaded_ = false
private

Definition at line 282 of file overworld_editor.h.

Referenced by Clear(), DrawScratchSpace(), DrawTile16Selector(), and LoadGraphics().

◆ selected_tile_loaded_

bool yaze::editor::OverworldEditor::selected_tile_loaded_ = false
private

Definition at line 283 of file overworld_editor.h.

◆ show_tile16_editor_

bool yaze::editor::OverworldEditor::show_tile16_editor_ = false
private

Definition at line 284 of file overworld_editor.h.

Referenced by DrawTile16Selector(), DrawToolset(), and Update().

◆ show_gfx_group_editor_

bool yaze::editor::OverworldEditor::show_gfx_group_editor_ = false
private

Definition at line 285 of file overworld_editor.h.

◆ show_properties_editor_

bool yaze::editor::OverworldEditor::show_properties_editor_ = false
private

Definition at line 286 of file overworld_editor.h.

◆ overworld_canvas_fullscreen_

bool yaze::editor::OverworldEditor::overworld_canvas_fullscreen_ = false
private

Definition at line 287 of file overworld_editor.h.

Referenced by DrawFullscreenCanvas(), DrawToolset(), and Update().

◆ middle_mouse_dragging_

bool yaze::editor::OverworldEditor::middle_mouse_dragging_ = false
private

Definition at line 288 of file overworld_editor.h.

Referenced by HandleOverworldPan().

◆ is_dragging_entity_

bool yaze::editor::OverworldEditor::is_dragging_entity_ = false
private

Definition at line 289 of file overworld_editor.h.

Referenced by DrawOverworldCanvas().

◆ dragged_entity_free_movement_

bool yaze::editor::OverworldEditor::dragged_entity_free_movement_ = false
private

Definition at line 290 of file overworld_editor.h.

Referenced by DrawOverworldCanvas().

◆ current_map_lock_

bool yaze::editor::OverworldEditor::current_map_lock_ = false
private

◆ show_custom_bg_color_editor_

bool yaze::editor::OverworldEditor::show_custom_bg_color_editor_ = false
private

Definition at line 292 of file overworld_editor.h.

Referenced by DrawOverworldCanvas(), and Update().

◆ show_overlay_editor_

bool yaze::editor::OverworldEditor::show_overlay_editor_ = false
private

Definition at line 293 of file overworld_editor.h.

Referenced by DrawOverworldCanvas(), and Update().

◆ use_area_specific_bg_color_

bool yaze::editor::OverworldEditor::use_area_specific_bg_color_ = false
private

Definition at line 294 of file overworld_editor.h.

◆ show_map_properties_panel_

bool yaze::editor::OverworldEditor::show_map_properties_panel_ = false
private

Definition at line 295 of file overworld_editor.h.

Referenced by DrawOverworldCanvas(), DrawToolset(), HandleMapInteraction(), and Update().

◆ show_overlay_preview_

bool yaze::editor::OverworldEditor::show_overlay_preview_ = false
private

Definition at line 296 of file overworld_editor.h.

Referenced by DrawOverworldCanvas().

◆ show_tile16_selector_

bool yaze::editor::OverworldEditor::show_tile16_selector_ = false
private

Definition at line 299 of file overworld_editor.h.

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

◆ show_tile8_selector_

bool yaze::editor::OverworldEditor::show_tile8_selector_ = false
private

Definition at line 300 of file overworld_editor.h.

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

◆ show_area_gfx_

bool yaze::editor::OverworldEditor::show_area_gfx_ = false
private

Definition at line 301 of file overworld_editor.h.

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

◆ show_scratch_

bool yaze::editor::OverworldEditor::show_scratch_ = false
private

Definition at line 302 of file overworld_editor.h.

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

◆ show_gfx_groups_

bool yaze::editor::OverworldEditor::show_gfx_groups_ = false
private

Definition at line 303 of file overworld_editor.h.

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

◆ show_usage_stats_

bool yaze::editor::OverworldEditor::show_usage_stats_ = false
private

Definition at line 304 of file overworld_editor.h.

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

◆ show_v3_settings_

bool yaze::editor::OverworldEditor::show_v3_settings_ = false
private

Definition at line 305 of file overworld_editor.h.

Referenced by Initialize().

◆ map_properties_system_

std::unique_ptr<MapPropertiesSystem> yaze::editor::OverworldEditor::map_properties_system_
private

Definition at line 308 of file overworld_editor.h.

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

◆ entity_renderer_

std::unique_ptr<OverworldEntityRenderer> yaze::editor::OverworldEditor::entity_renderer_
private

Definition at line 309 of file overworld_editor.h.

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

◆ scratch_spaces_

◆ current_scratch_slot_

int yaze::editor::OverworldEditor::current_scratch_slot_ = 0
private

◆ tile16_blockset_

◆ rom_

Rom* yaze::editor::OverworldEditor::rom_
private

◆ renderer_

gfx::IRenderer* yaze::editor::OverworldEditor::renderer_
private

◆ tile16_editor_

Tile16Editor yaze::editor::OverworldEditor::tile16_editor_ {rom_, &tile16_blockset_}
private

Definition at line 333 of file overworld_editor.h.

Referenced by DrawTile16Selector(), Load(), and Update().

◆ gfx_group_editor_

GfxGroupEditor yaze::editor::OverworldEditor::gfx_group_editor_
private

Definition at line 334 of file overworld_editor.h.

Referenced by DrawOverworldProperties(), OverworldEditor(), and Update().

◆ palette_editor_

PaletteEditor yaze::editor::OverworldEditor::palette_editor_
private

Definition at line 335 of file overworld_editor.h.

◆ palette_

gfx::SnesPalette yaze::editor::OverworldEditor::palette_
private

◆ selected_tile_bmp_

gfx::Bitmap yaze::editor::OverworldEditor::selected_tile_bmp_
private

Definition at line 339 of file overworld_editor.h.

◆ tile16_blockset_bmp_

gfx::Bitmap yaze::editor::OverworldEditor::tile16_blockset_bmp_
private

Definition at line 340 of file overworld_editor.h.

Referenced by Load().

◆ current_gfx_bmp_

gfx::Bitmap yaze::editor::OverworldEditor::current_gfx_bmp_
private

Definition at line 341 of file overworld_editor.h.

Referenced by Load().

◆ all_gfx_bmp

gfx::Bitmap yaze::editor::OverworldEditor::all_gfx_bmp
private

Definition at line 342 of file overworld_editor.h.

◆ maps_bmp_

◆ current_graphics_set_

gfx::BitmapTable yaze::editor::OverworldEditor::current_graphics_set_
private

Definition at line 345 of file overworld_editor.h.

Referenced by Clear(), and DrawAreaGraphics().

◆ sprite_previews_

std::vector<gfx::Bitmap> yaze::editor::OverworldEditor::sprite_previews_
private

Definition at line 346 of file overworld_editor.h.

Referenced by Initialize(), and LoadSpriteGraphics().

◆ overworld_

◆ refresh_blockset_

zelda3::OverworldBlockset yaze::editor::OverworldEditor::refresh_blockset_
private

Definition at line 352 of file overworld_editor.h.

◆ current_sprite_

zelda3::Sprite yaze::editor::OverworldEditor::current_sprite_
private

Definition at line 354 of file overworld_editor.h.

Referenced by Update().

◆ current_entrance_

zelda3::OverworldEntrance yaze::editor::OverworldEditor::current_entrance_
private

Definition at line 356 of file overworld_editor.h.

Referenced by Update().

◆ current_exit_

zelda3::OverworldExit yaze::editor::OverworldEditor::current_exit_
private

Definition at line 357 of file overworld_editor.h.

Referenced by Update().

◆ current_item_

zelda3::OverworldItem yaze::editor::OverworldEditor::current_item_
private

Definition at line 358 of file overworld_editor.h.

Referenced by Update().

◆ entrance_tiletypes_

zelda3::OverworldEntranceTileTypes yaze::editor::OverworldEditor::entrance_tiletypes_ = {}
private

Definition at line 359 of file overworld_editor.h.

Referenced by Load().

◆ current_entity_

zelda3::GameEntity* yaze::editor::OverworldEditor::current_entity_ = nullptr
private

Definition at line 361 of file overworld_editor.h.

Referenced by Update().

◆ dragged_entity_

zelda3::GameEntity* yaze::editor::OverworldEditor::dragged_entity_ = nullptr
private

Definition at line 362 of file overworld_editor.h.

Referenced by DrawOverworldCanvas().

◆ ow_map_canvas_

◆ current_gfx_canvas_

gui::Canvas yaze::editor::OverworldEditor::current_gfx_canvas_
private
Initial value:
{"CurrentGfx", kCurrentGfxCanvasSize,
constexpr ImVec2 kCurrentGfxCanvasSize(0x100+1, 0x10 *0x40+1)

Definition at line 366 of file overworld_editor.h.

Referenced by DrawAreaGraphics().

◆ blockset_canvas_

gui::Canvas yaze::editor::OverworldEditor::blockset_canvas_
private
Initial value:
{"OwBlockset", kBlocksetCanvasSize,
constexpr ImVec2 kBlocksetCanvasSize(0x100+1, 0x4000+1)

Definition at line 368 of file overworld_editor.h.

Referenced by DrawTile16Selector().

◆ blockset_selector_

std::unique_ptr<gui::TileSelectorWidget> yaze::editor::OverworldEditor::blockset_selector_
private

◆ graphics_bin_canvas_

gui::Canvas yaze::editor::OverworldEditor::graphics_bin_canvas_
private
Initial value:
{"GraphicsBin", kGraphicsBinCanvasSize,
constexpr ImVec2 kGraphicsBinCanvasSize(0x100+1, kNumSheetsToLoad *0x40+1)

Definition at line 371 of file overworld_editor.h.

Referenced by DrawTile8Selector().

◆ properties_canvas_

gui::Canvas yaze::editor::OverworldEditor::properties_canvas_
private

Definition at line 373 of file overworld_editor.h.

Referenced by DrawOverworldProperties(), and UpdateUsageStats().

◆ scratch_canvas_

gui::Canvas yaze::editor::OverworldEditor::scratch_canvas_ {"ScratchSpace", ImVec2(320, 480), gui::CanvasGridSize::k32x32}
private

◆ status_

absl::Status yaze::editor::OverworldEditor::status_
private

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