Handles all canvas drawing and panel rendering for the overworld editor. More...
#include <overworld_canvas_renderer.h>

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. | |
Private Attributes | |
| OverworldEditor * | editor_ |
| Non-owning pointer to the parent editor. | |
Handles all canvas drawing and panel rendering for the overworld editor.
Extracted from OverworldEditor to separate rendering concerns from editing logic. This class handles:
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 26 of file overworld_canvas_renderer.h.
|
explicit |
Definition at line 43 of file overworld_canvas_renderer.cc.
| void yaze::editor::OverworldCanvasRenderer::DrawOverworldCanvas | ( | ) |
Draw the main overworld canvas with toolbar, maps, and entities. This is the primary entry point called from the OverworldCanvasPanel.
Definition at line 50 of file overworld_canvas_renderer.cc.
References yaze::gui::AcceptTileDrop(), yaze::gui::BeginCanvas(), yaze::gui::BeginChildBothScrollbars(), yaze::gui::BeginNoPadding(), yaze::gui::CanvasFrameOptions::canvas_size, yaze::editor::OverworldEditor::CheckForCurrentMap(), yaze::editor::OverworldEditor::CheckForOverworldEdits(), yaze::gui::Canvas::ClearContextMenuItems(), yaze::editor::OverworldEditor::current_map_, yaze::editor::OverworldEditor::current_map_lock_, yaze::editor::OverworldEditor::current_mode, yaze::editor::OverworldEditor::current_tile16_, yaze::editor::OverworldEditor::current_world_, yaze::editor::Editor::dependencies_, yaze::editor::OverworldEditor::dragged_entity_, yaze::editor::OverworldEditor::dragged_entity_free_movement_, yaze::gui::CanvasFrameOptions::draw_context_menu, yaze::gui::CanvasFrameOptions::draw_grid, yaze::gui::CanvasFrameOptions::draw_overlay, yaze::editor::DRAW_TILE, DrawOverworldMaps(), editor_, yaze::gui::EndCanvas(), yaze::gui::EndNoPadding(), yaze::editor::OverworldEditor::entity_edit_mode_, yaze::editor::OverworldEditor::entity_renderer_, yaze::zelda3::GameEntity::entity_type_, yaze::editor::FILL_TILE, yaze::editor::OverworldEditor::game_state_, yaze::gui::CanvasFrameOptions::grid_step, yaze::editor::OverworldEditor::HandleMapInteraction(), yaze::editor::OverworldEditor::HandleOverworldPan(), yaze::editor::OverworldEditor::HandleOverworldZoom(), yaze::editor::OverworldEditor::ScratchSpace::in_use, yaze::editor::OverworldEditor::is_dragging_entity_, yaze::Rom::is_loaded(), yaze::zelda3::Overworld::is_loaded(), yaze::gui::kEntityManipulation, yaze::zelda3::GameEntity::kExit, yaze::editor::kOverworldCanvasSize(), yaze::gui::kTilePainting, yaze::zelda3::GameEntity::map_id_, yaze::editor::OverworldEditor::map_properties_system_, yaze::editor::MOUSE, yaze::editor::MoveEntityOnGrid(), yaze::editor::OverworldEditor::overworld_, yaze::editor::OverworldEditor::ow_map_canvas_, yaze::editor::EditorDependencies::panel_manager, yaze::gui::CanvasFrameOptions::render_popups, yaze::editor::OverworldEditor::rom_, yaze::editor::OverworldEditor::scratch_space_, yaze::gui::Canvas::select_rect_active(), yaze::gui::Canvas::selected_tiles(), yaze::Rom::set_dirty(), yaze::gui::Canvas::set_scrolling(), yaze::gui::Canvas::SetUsageMode(), yaze::editor::OverworldEditor::show_custom_bg_color_editor_, yaze::editor::OverworldEditor::show_map_properties_panel_, yaze::editor::OverworldEditor::show_overlay_editor_, yaze::editor::OverworldEditor::show_overlay_preview_, yaze::editor::OverworldEditor::status_, yaze::gui::TileDragPayload::tile_id, yaze::editor::OverworldEditor::toolbar_, yaze::zelda3::GameEntity::UpdateMapProperties(), yaze::gui::CanvasFrameOptions::use_child_window, yaze::zelda3::GameEntity::x_, and yaze::zelda3::GameEntity::y_.
| absl::Status yaze::editor::OverworldCanvasRenderer::DrawTile16Selector | ( | ) |
Draw the tile16 selector panel.
Definition at line 316 of file overworld_canvas_renderer.cc.
References yaze::gfx::Tilemap::atlas, yaze::gui::BeginChildWithScrollbar(), yaze::gui::BeginPadding(), yaze::editor::OverworldEditor::blockset_canvas_, yaze::editor::OverworldEditor::blockset_selector_, yaze::editor::OverworldEditor::current_tile16_, yaze::editor::Editor::dependencies_, yaze::gui::TileSelectorWidget::Config::display_scale, yaze::gui::TileSelectorWidget::Config::draw_offset, editor_, yaze::gui::TileSelectorWidget::Config::enable_drag, yaze::gui::EndPadding(), yaze::editor::AgentUI::GetTheme(), yaze::gui::TileSelectorWidget::Config::highlight_color, yaze::gfx::Bitmap::is_active(), yaze::zelda3::kNumTile16Individual, yaze::editor::OverworldPanelIds::kTile16Editor, yaze::util::logf(), yaze::editor::OverworldEditor::map_blockset_loaded_, yaze::editor::EditorDependencies::panel_manager, yaze::editor::Tile16Editor::SetCurrentTile(), yaze::gui::TileSelectorWidget::Config::show_hover_tooltip, yaze::editor::PanelManager::ShowPanel(), yaze::editor::OverworldEditor::tile16_blockset_, yaze::editor::OverworldEditor::tile16_editor_, yaze::gui::TileSelectorWidget::Config::tile_size, yaze::gui::TileSelectorWidget::Config::tiles_per_row, yaze::gui::TileSelectorWidget::Config::total_tiles, and yaze::editor::OverworldEditor::UpdateBlocksetSelectorState().
| void yaze::editor::OverworldCanvasRenderer::DrawTile8Selector | ( | ) |
Draw the tile8 selector panel (graphics bin)
Definition at line 383 of file overworld_canvas_renderer.cc.
References yaze::editor::OverworldEditor::all_gfx_loaded_, yaze::gui::BeginCanvas(), yaze::gui::CanvasFrameOptions::canvas_size, yaze::gui::CanvasFrameOptions::draw_context_menu, yaze::gui::CanvasFrameOptions::draw_grid, yaze::gui::CanvasFrameOptions::draw_overlay, editor_, yaze::gui::EndCanvas(), yaze::gfx::Arena::Get(), yaze::gfx::Arena::gfx_sheets(), yaze::editor::OverworldEditor::graphics_bin_canvas_, yaze::gui::CanvasFrameOptions::grid_step, yaze::editor::kGraphicsBinCanvasSize(), yaze::gui::CanvasFrameOptions::render_popups, and yaze::gui::CanvasFrameOptions::use_child_window.
| absl::Status yaze::editor::OverworldCanvasRenderer::DrawAreaGraphics | ( | ) |
Draw the area graphics panel.
Definition at line 418 of file overworld_canvas_renderer.cc.
References yaze::gui::BeginCanvas(), yaze::gui::BeginChildWithScrollbar(), yaze::gui::BeginPadding(), yaze::gui::CanvasFrameOptions::canvas_size, yaze::gfx::Arena::CREATE, yaze::zelda3::Overworld::current_area_palette(), yaze::editor::OverworldEditor::current_gfx_canvas_, yaze::zelda3::Overworld::current_graphics(), yaze::editor::OverworldEditor::current_graphics_set_, yaze::editor::OverworldEditor::current_map_, yaze::gui::CanvasFrameOptions::draw_context_menu, yaze::gui::CanvasFrameOptions::draw_grid, yaze::gui::CanvasFrameOptions::draw_overlay, yaze::gui::Canvas::DrawBitmap(), yaze::gui::Canvas::DrawTileSelector(), editor_, yaze::gui::EndCanvas(), yaze::gui::EndPadding(), yaze::gfx::Arena::Get(), yaze::gui::CanvasFrameOptions::grid_step, yaze::zelda3::Overworld::is_loaded(), yaze::editor::kCurrentGfxCanvasSize(), yaze::editor::kOverworldMapSize, yaze::editor::OverworldEditor::overworld_, yaze::editor::OverworldEditor::palette_, yaze::gfx::Arena::QueueTextureCommand(), yaze::gui::CanvasFrameOptions::render_popups, yaze::zelda3::Overworld::set_current_map(), and yaze::gui::CanvasFrameOptions::use_child_window.
| void yaze::editor::OverworldCanvasRenderer::DrawV3Settings | ( | ) |
Draw the v3 settings panel.
Definition at line 466 of file overworld_canvas_renderer.cc.
References yaze::gui::CenterText(), editor_, yaze::Rom::is_loaded(), and yaze::editor::OverworldEditor::rom_.

| void yaze::editor::OverworldCanvasRenderer::DrawMapProperties | ( | ) |
Draw the map properties panel (sidebar-based)
Definition at line 488 of file overworld_canvas_renderer.cc.
References yaze::editor::OverworldEditor::current_map_, yaze::editor::OverworldEditor::current_map_lock_, yaze::editor::OverworldEditor::current_world_, editor_, yaze::editor::OverworldEditor::map_properties_system_, and yaze::editor::OverworldEditor::sidebar_.
| void yaze::editor::OverworldCanvasRenderer::DrawOverworldProperties | ( | ) |
Draw the overworld properties grid (debug/info view)
Definition at line 527 of file overworld_canvas_renderer.cc.
References yaze::gui::BeginWindowWithDisplaySettings(), yaze::editor::OverworldEditor::DW_AREA_GFX, yaze::editor::OverworldEditor::DW_AREA_PAL, yaze::editor::OverworldEditor::DW_SPR_GFX_PART1, yaze::editor::OverworldEditor::DW_SPR_GFX_PART2, yaze::editor::OverworldEditor::DW_SPR_PAL_PART1, yaze::editor::OverworldEditor::DW_SPR_PAL_PART2, editor_, yaze::gui::EndWindowWithDisplaySettings(), yaze::editor::OverworldEditor::gfx_group_editor_, yaze::editor::OverworldEditor::LW_AREA_GFX, yaze::editor::OverworldEditor::LW_AREA_PAL, yaze::editor::OverworldEditor::LW_SPR_GFX_PART1, yaze::editor::OverworldEditor::LW_SPR_GFX_PART2, yaze::editor::OverworldEditor::LW_SPR_PAL_PART1, yaze::editor::OverworldEditor::LW_SPR_PAL_PART2, yaze::gui::Canvas::mutable_labels(), yaze::editor::OverworldEditor::overworld_, yaze::zelda3::Overworld::overworld_map(), yaze::editor::OverworldEditor::properties_canvas_, yaze::editor::OverworldEditor::status_, yaze::editor::GfxGroupEditor::Update(), and yaze::gui::Canvas::UpdateInfoGrid().
|
private |
Render the 64 overworld map bitmaps to the canvas.
Definition at line 231 of file overworld_canvas_renderer.cc.
References yaze::editor::OverworldEditor::current_world_, yaze::gui::Canvas::DrawBitmap(), editor_, yaze::editor::OverworldEditor::EnsureMapTexture(), yaze::editor::AgentUI::GetTheme(), yaze::gui::Canvas::global_scale(), IM_PI, yaze::editor::kOverworldMapSize, yaze::editor::OverworldEditor::maps_bmp_, yaze::editor::OverworldEditor::ow_map_canvas_, yaze::gui::Canvas::scrolling(), and yaze::gui::Canvas::zero_point().
Referenced by DrawOverworldCanvas().
|
private |
Non-owning pointer to the parent editor.
Definition at line 72 of file overworld_canvas_renderer.h.
Referenced by DrawAreaGraphics(), DrawMapProperties(), DrawOverworldCanvas(), DrawOverworldMaps(), DrawOverworldProperties(), DrawTile16Selector(), DrawTile8Selector(), and DrawV3Settings().