#include <map_refresh_coordinator.h>

Public Member Functions | |
| MapRefreshCoordinator (const MapRefreshContext &ctx) | |
| void | InvalidateGraphicsCache (int map_id=-1) |
| Invalidate cached graphics for a specific map or all maps. | |
| void | InvalidateTile16Definitions () |
| Shared Tile16 definitions affect maps in every world, including hidden maps. | |
| absl::Status | RefreshPaletteUsers (const std::string &group, int palette_index) |
| void | RefreshChildMap (int map_index) |
| Refresh a child map's graphics pipeline (legacy full rebuild) | |
| void | RefreshOverworldMap () |
| Refresh the current overworld map. | |
| 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 (int map_id=-1) |
| Refresh map palette after palette property changes. | |
| void | ForceRefreshGraphics (int map_index) |
| Force refresh graphics for a specific map. | |
| void | RefreshSiblingMapGraphics (int map_index, bool include_self=false) |
| Refresh sibling map graphics for multi-area maps. | |
| void | RefreshMapProperties (int map_id=-1) |
| Refresh map properties (copy parent properties to siblings) | |
| absl::Status | RefreshTile16Blockset () |
| Refresh the tile16 blockset after graphics/palette changes. | |
| void | UpdateBlocksetWithPendingTileChanges () |
| Update blockset atlas with pending tile16 editor changes. | |
Private Attributes | |
| MapRefreshContext | ctx_ |
Definition at line 66 of file map_refresh_coordinator.h.
|
inlineexplicit |
Definition at line 68 of file map_refresh_coordinator.h.
| void yaze::editor::MapRefreshCoordinator::InvalidateGraphicsCache | ( | int | map_id = -1 | ) |
Invalidate cached graphics for a specific map or all maps.
| map_id | The map to invalidate (-1 to invalidate all maps) |
Definition at line 103 of file map_refresh_coordinator.cc.
References yaze::zelda3::Overworld::ClearGraphicsConfigCache(), ctx_, yaze::editor::MapRefreshContext::current_graphics_set, yaze::zelda3::Overworld::InvalidateSiblingMapCaches(), and yaze::editor::MapRefreshContext::overworld.
Referenced by InvalidateTile16Definitions().

| void yaze::editor::MapRefreshCoordinator::InvalidateTile16Definitions | ( | ) |
Shared Tile16 definitions affect maps in every world, including hidden maps.
Definition at line 116 of file map_refresh_coordinator.cc.
References ctx_, InvalidateGraphicsCache(), yaze::zelda3::kNumOverworldMaps, yaze::editor::MapRefreshContext::maps_bmp, yaze::zelda3::Overworld::mutable_overworld_map(), and yaze::editor::MapRefreshContext::overworld.

| absl::Status yaze::editor::MapRefreshCoordinator::RefreshPaletteUsers | ( | const std::string & | group, |
| int | palette_index ) |
Definition at line 425 of file map_refresh_coordinator.cc.
References yaze::gfx::Arena::CREATE, ctx_, yaze::gfx::Arena::Get(), yaze::zelda3::kNumOverworldMaps, yaze::editor::MapRefreshContext::maps_bmp, yaze::zelda3::Overworld::mutable_overworld_map(), yaze::editor::MapRefreshContext::overworld, yaze::gfx::Arena::QueueTextureCommand(), RefreshTile16Blockset(), RETURN_IF_ERROR, and yaze::gfx::Arena::UPDATE.

| void yaze::editor::MapRefreshCoordinator::RefreshChildMap | ( | int | map_index | ) |
Refresh a child map's graphics pipeline (legacy full rebuild)
Definition at line 126 of file map_refresh_coordinator.cc.
References ctx_, yaze::editor::MapRefreshContext::maps_bmp, yaze::zelda3::Overworld::mutable_overworld_map(), yaze::zelda3::Overworld::mutable_tiles16(), yaze::editor::MapRefreshContext::overworld, PRINT_IF_ERROR, yaze::editor::MapRefreshContext::status, and yaze::zelda3::Overworld::tiles16().

| void yaze::editor::MapRefreshCoordinator::RefreshOverworldMap | ( | ) |
Refresh the current overworld map.
Definition at line 145 of file map_refresh_coordinator.cc.
References ctx_, yaze::editor::MapRefreshContext::current_map, and RefreshOverworldMapOnDemand().

| void yaze::editor::MapRefreshCoordinator::RefreshOverworldMapOnDemand | ( | int | map_index | ) |
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 157 of file map_refresh_coordinator.cc.
References ctx_, yaze::editor::MapRefreshContext::current_map, yaze::editor::MapRefreshContext::current_world, yaze::zelda3::kNumOverworldMaps, yaze::editor::MapRefreshContext::maps_bmp, and RefreshChildMapOnDemand().
Referenced by RefreshOverworldMap().

| void yaze::editor::MapRefreshCoordinator::RefreshChildMapOnDemand | ( | int | map_index | ) |
On-demand child map refresh with selective updates.
Definition at line 181 of file map_refresh_coordinator.cc.
References yaze::gfx::Arena::CREATE, ctx_, yaze::gfx::Arena::Get(), yaze::zelda3::OverworldVersionHelper::GetVersion(), LOG_ERROR, LOG_WARN, yaze::editor::MapRefreshContext::maps_bmp, yaze::zelda3::Overworld::mutable_overworld_map(), yaze::zelda3::Overworld::mutable_tiles16(), yaze::editor::MapRefreshContext::overworld, yaze::gfx::Arena::QueueTextureCommand(), RefreshMultiAreaMapsSafely(), yaze::editor::MapRefreshContext::rom, yaze::zelda3::OverworldVersionHelper::SupportsAreaEnum(), yaze::zelda3::Overworld::tiles16(), and yaze::gfx::Arena::UPDATE.
Referenced by RefreshOverworldMapOnDemand(), and RefreshSiblingMapGraphics().
| void yaze::editor::MapRefreshCoordinator::RefreshMultiAreaMapsSafely | ( | int | map_index, |
| zelda3::OverworldMap * | map ) |
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 always works from the parent perspective to ensure consistent behavior whether the trigger map is the parent or a child.
Key improvements:
Definition at line 275 of file map_refresh_coordinator.cc.
References yaze::zelda3::OverworldMap::area_size(), ctx_, yaze::editor::MapRefreshContext::current_map, yaze::editor::MapRefreshContext::current_world, yaze::editor::MapRefreshContext::ensure_map_texture, yaze::gfx::Arena::Get(), yaze::zelda3::kNumOverworldMaps, LOG_DEBUG, LOG_ERROR, LOG_WARN, yaze::editor::MapRefreshContext::maps_bmp, yaze::zelda3::Overworld::mutable_overworld_map(), yaze::zelda3::Overworld::mutable_tiles16(), yaze::editor::MapRefreshContext::overworld, yaze::zelda3::OverworldMap::parent(), yaze::gfx::Arena::QueueTextureCommand(), yaze::zelda3::Overworld::tiles16(), and yaze::gfx::Arena::UPDATE.
Referenced by RefreshChildMapOnDemand().
| absl::Status yaze::editor::MapRefreshCoordinator::RefreshMapPalette | ( | int | map_id = -1 | ) |
Refresh map palette after palette property changes.
Definition at line 459 of file map_refresh_coordinator.cc.
References ctx_, yaze::editor::MapRefreshContext::current_map, yaze::zelda3::OverworldVersionHelper::GetVersion(), yaze::zelda3::kNumOverworldMaps, yaze::editor::MapRefreshContext::maps_bmp, yaze::zelda3::Overworld::mutable_overworld_map(), yaze::editor::MapRefreshContext::overworld, RefreshTile16Blockset(), RETURN_IF_ERROR, yaze::editor::MapRefreshContext::rom, and yaze::zelda3::OverworldVersionHelper::SupportsAreaEnum().

| void yaze::editor::MapRefreshCoordinator::ForceRefreshGraphics | ( | int | map_index | ) |
Force refresh graphics for a specific map.
Definition at line 558 of file map_refresh_coordinator.cc.
References ctx_, yaze::editor::MapRefreshContext::current_blockset, yaze::zelda3::Overworld::InvalidateSiblingMapCaches(), yaze::zelda3::kNumOverworldMaps, LOG_DEBUG, yaze::editor::MapRefreshContext::maps_bmp, and yaze::editor::MapRefreshContext::overworld.

| void yaze::editor::MapRefreshCoordinator::RefreshSiblingMapGraphics | ( | int | map_index, |
| bool | include_self = false ) |
Refresh sibling map graphics for multi-area maps.
Definition at line 575 of file map_refresh_coordinator.cc.
References ctx_, yaze::zelda3::kNumOverworldMaps, yaze::zelda3::LargeArea, LOG_DEBUG, yaze::editor::MapRefreshContext::maps_bmp, yaze::zelda3::Overworld::mutable_overworld_map(), yaze::editor::MapRefreshContext::overworld, RefreshChildMapOnDemand(), yaze::zelda3::SmallArea, yaze::zelda3::TallArea, and yaze::zelda3::WideArea.

| void yaze::editor::MapRefreshCoordinator::RefreshMapProperties | ( | int | map_id = -1 | ) |
Refresh map properties (copy parent properties to siblings)
Definition at line 632 of file map_refresh_coordinator.cc.
References ctx_, yaze::editor::MapRefreshContext::current_map, yaze::zelda3::OverworldVersionHelper::GetVersion(), yaze::zelda3::kNumOverworldMaps, yaze::zelda3::Overworld::mutable_overworld_map(), yaze::editor::MapRefreshContext::overworld, yaze::zelda3::Overworld::overworld_map(), yaze::editor::MapRefreshContext::rom, and yaze::zelda3::OverworldVersionHelper::SupportsAreaEnum().

| absl::Status yaze::editor::MapRefreshCoordinator::RefreshTile16Blockset | ( | ) |
Refresh the tile16 blockset after graphics/palette changes.
Definition at line 722 of file map_refresh_coordinator.cc.
References yaze::gfx::Tilemap::atlas, yaze::gfx::Arena::CREATE, ctx_, yaze::editor::MapRefreshContext::current_blockset, yaze::editor::MapRefreshContext::current_map, yaze::zelda3::Overworld::EnsureMapBuilt(), yaze::gfx::Arena::Get(), yaze::gfx::Bitmap::is_active(), LOG_DEBUG, yaze::zelda3::Overworld::mutable_overworld_map(), yaze::editor::MapRefreshContext::overworld, yaze::zelda3::Overworld::overworld_map(), yaze::editor::MapRefreshContext::palette, yaze::gfx::Arena::QueueTextureCommand(), yaze::editor::MapRefreshContext::renderer, RETURN_IF_ERROR, yaze::editor::Tile16Editor::set_palette(), yaze::gfx::Bitmap::SetPalette(), yaze::gfx::Bitmap::texture(), yaze::editor::MapRefreshContext::tile16_blockset, yaze::editor::MapRefreshContext::tile16_editor, yaze::gfx::Arena::UPDATE, and yaze::gfx::UpdateTilemap().
Referenced by RefreshMapPalette(), and RefreshPaletteUsers().
| void yaze::editor::MapRefreshCoordinator::UpdateBlocksetWithPendingTileChanges | ( | ) |
Update blockset atlas with pending tile16 editor changes.
Definition at line 766 of file map_refresh_coordinator.cc.
References yaze::gfx::Tilemap::atlas, ctx_, yaze::gfx::Arena::Get(), yaze::editor::Tile16Editor::GetPendingTileBitmap(), yaze::editor::Tile16Editor::has_pending_changes(), yaze::gfx::Bitmap::height(), yaze::gfx::Bitmap::is_active(), yaze::editor::Tile16Editor::is_tile_modified(), yaze::zelda3::kNumTile16Individual, yaze::editor::MapRefreshContext::map_blockset_loaded, yaze::gfx::Bitmap::mutable_data(), yaze::gfx::Arena::QueueTextureCommand(), yaze::gfx::Bitmap::set_modified(), yaze::gfx::Bitmap::texture(), yaze::editor::MapRefreshContext::tile16_blockset, yaze::editor::MapRefreshContext::tile16_editor, yaze::gfx::Arena::UPDATE, yaze::gfx::Bitmap::vector(), and yaze::gfx::Bitmap::width().
|
private |
Definition at line 120 of file map_refresh_coordinator.h.
Referenced by ForceRefreshGraphics(), InvalidateGraphicsCache(), InvalidateTile16Definitions(), RefreshChildMap(), RefreshChildMapOnDemand(), RefreshMapPalette(), RefreshMapProperties(), RefreshMultiAreaMapsSafely(), RefreshOverworldMap(), RefreshOverworldMapOnDemand(), RefreshPaletteUsers(), RefreshSiblingMapGraphics(), RefreshTile16Blockset(), and UpdateBlocksetWithPendingTileChanges().