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

Handles all canvas drawing and panel rendering for the overworld editor. More...

#include <overworld_canvas_renderer.h>

Collaboration diagram for yaze::editor::OverworldCanvasRenderer:

Classes

struct  OverlayLayer
 

Public Member Functions

 OverworldCanvasRenderer (OverworldEditor *editor)
 
void DrawOverworldCanvas ()
 Draw the main overworld canvas with toolbar, maps, and entities. This is the primary entry point called from the OverworldCanvasPanel.
 
absl::Status DrawTile16Selector ()
 Draw the tile16 selector panel.
 
void DrawTile8Selector ()
 Draw the tile8 selector panel (graphics bin)
 
absl::Status DrawAreaGraphics ()
 Draw the area graphics panel.
 
void DrawV3Settings ()
 Draw the v3 settings panel.
 
void DrawMapProperties ()
 Draw the map properties panel (sidebar-based)
 
void DrawOverworldProperties ()
 Draw the overworld properties grid (debug/info view)
 

Private Member Functions

void DrawOverworldMaps ()
 Render the 64 overworld map bitmaps to the canvas.
 
void DrawMapWithAreaLayers (int map_index, int map_x, int map_y, float scale)
 
OverlayLayer * EnsureOverlayLayer (int map_index)
 
bool PrepareContextMenu (const ImVec2 &screen_position)
 
void FilterHoveredEntityByMode ()
 In an entity mode only that entity type responds to hover/drag/menu.
 

Private Attributes

std::unordered_map< int, OverlayLayer > overlay_layers_
 
OverworldEditor * editor_
 Non-owning pointer to the parent editor.
 
gui::AdaptiveSheetScaleMode tile16_scale_mode_
 
gui::AdaptiveSheetScaleMode area_graphics_scale_mode_
 

Detailed Description

Handles all canvas drawing and panel rendering for the overworld editor.

Extracted from OverworldEditor to separate rendering concerns from editing logic. This class handles:

  • Main overworld canvas drawing (map bitmaps, entities, tile edits)
  • Panel rendering (tile16 selector, tile8 selector, area graphics, etc.)
  • Properties panel rendering

All state is accessed through a pointer to the owning OverworldEditor. The renderer is declared as a friend class of OverworldEditor for direct member access.

Definition at line 32 of file overworld_canvas_renderer.h.

Constructor & Destructor Documentation

◆ OverworldCanvasRenderer()

yaze::editor::OverworldCanvasRenderer::OverworldCanvasRenderer ( OverworldEditor * editor)
explicit

Member Function Documentation

◆ DrawOverworldCanvas()

◆ DrawTile16Selector()

◆ DrawTile8Selector()

◆ DrawAreaGraphics()

◆ DrawV3Settings()

void yaze::editor::OverworldCanvasRenderer::DrawV3Settings ( )

Draw the v3 settings panel.

Definition at line 697 of file overworld_canvas_renderer.cc.

References yaze::gui::CenterText(), ICON_MD_SAVE, and yaze::zelda3::OverworldCustomASMHasBeenApplied.

Here is the call graph for this function:

◆ DrawMapProperties()

void yaze::editor::OverworldCanvasRenderer::DrawMapProperties ( )

Draw the map properties panel (sidebar-based)

Definition at line 779 of file overworld_canvas_renderer.cc.

◆ DrawOverworldProperties()

void yaze::editor::OverworldCanvasRenderer::DrawOverworldProperties ( )

Draw the overworld properties grid (debug/info view)

Definition at line 791 of file overworld_canvas_renderer.cc.

References yaze::gui::BeginWindowWithDisplaySettings(), and yaze::gui::EndWindowWithDisplaySettings().

Here is the call graph for this function:

◆ DrawOverworldMaps()

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

Render the 64 overworld map bitmaps to the canvas.

Definition at line 373 of file overworld_canvas_renderer.cc.

References IM_PI, and yaze::editor::kOverworldMapSize.

◆ DrawMapWithAreaLayers()

void yaze::editor::OverworldCanvasRenderer::DrawMapWithAreaLayers ( int map_index,
int map_x,
int map_y,
float scale )
private

Definition at line 295 of file overworld_canvas_renderer.cc.

References yaze::editor::kOverworldMapSize.

◆ EnsureOverlayLayer()

◆ PrepareContextMenu()

◆ FilterHoveredEntityByMode()

void yaze::editor::OverworldCanvasRenderer::FilterHoveredEntityByMode ( )
private

In an entity mode only that entity type responds to hover/drag/menu.

Definition at line 751 of file overworld_canvas_renderer.cc.

Member Data Documentation

◆ overlay_layers_

std::unordered_map<int, OverlayLayer> yaze::editor::OverworldCanvasRenderer::overlay_layers_
private

Definition at line 84 of file overworld_canvas_renderer.h.

◆ editor_

OverworldEditor* yaze::editor::OverworldCanvasRenderer::editor_
private

Non-owning pointer to the parent editor.

Definition at line 93 of file overworld_canvas_renderer.h.

Referenced by DrawOverworldCanvas(), OverworldCanvasRenderer(), and PrepareContextMenu().

◆ tile16_scale_mode_

gui::AdaptiveSheetScaleMode yaze::editor::OverworldCanvasRenderer::tile16_scale_mode_
private

◆ area_graphics_scale_mode_

gui::AdaptiveSheetScaleMode yaze::editor::OverworldCanvasRenderer::area_graphics_scale_mode_
private
Initial value:

Definition at line 96 of file overworld_canvas_renderer.h.


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