#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 | 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 () |
| 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 () |
| 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 65 of file map_refresh_coordinator.h.
|
inlineexplicit |
Definition at line 67 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 20 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.

| void yaze::editor::MapRefreshCoordinator::RefreshChildMap | ( | int | map_index | ) |
Refresh a child map's graphics pipeline (legacy full rebuild)
Definition at line 33 of file map_refresh_coordinator.cc.
References ctx_, yaze::editor::MapRefreshContext::current_world, yaze::zelda3::Overworld::GetMapTiles(), 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 50 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 62 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 86 of file map_refresh_coordinator.cc.
References yaze::gfx::Arena::CREATE, ctx_, yaze::editor::MapRefreshContext::current_world, yaze::gfx::Arena::Get(), yaze::zelda3::Overworld::GetMapTiles(), 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 179 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::Overworld::GetMapTiles(), 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 | ( | ) |
Refresh map palette after palette property changes.
Definition at line 328 of file map_refresh_coordinator.cc.
References ctx_, yaze::zelda3::Overworld::current_area_palette(), yaze::editor::MapRefreshContext::current_gfx_bmp, yaze::editor::MapRefreshContext::current_map, yaze::gfx::Arena::Get(), yaze::zelda3::OverworldVersionHelper::GetVersion(), yaze::gfx::Bitmap::is_active(), yaze::zelda3::kNumOverworldMaps, yaze::editor::MapRefreshContext::maps_bmp, yaze::zelda3::Overworld::mutable_overworld_map(), yaze::editor::MapRefreshContext::overworld, yaze::editor::MapRefreshContext::palette, yaze::gfx::Arena::QueueTextureCommand(), RETURN_IF_ERROR, yaze::editor::MapRefreshContext::rom, yaze::gfx::Bitmap::set_modified(), yaze::editor::Tile16Editor::set_palette(), yaze::gfx::Bitmap::SetPalette(), yaze::zelda3::OverworldVersionHelper::SupportsAreaEnum(), yaze::editor::MapRefreshContext::tile16_editor, and yaze::gfx::Arena::UPDATE.
| void yaze::editor::MapRefreshCoordinator::ForceRefreshGraphics | ( | int | map_index | ) |
Force refresh graphics for a specific map.
Definition at line 433 of file map_refresh_coordinator.cc.
References ctx_, yaze::editor::MapRefreshContext::current_blockset, yaze::zelda3::Overworld::InvalidateSiblingMapCaches(), 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 450 of file map_refresh_coordinator.cc.
References ctx_, 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 | ( | ) |
Refresh map properties (copy parent properties to siblings)
Definition at line 502 of file map_refresh_coordinator.cc.
References ctx_, yaze::editor::MapRefreshContext::current_map, yaze::editor::MapRefreshContext::game_state, yaze::zelda3::OverworldVersionHelper::GetVersion(), yaze::zelda3::kNumOverworldMaps, yaze::zelda3::Overworld::mutable_overworld_map(), yaze::editor::MapRefreshContext::overworld, 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 581 of file map_refresh_coordinator.cc.
References yaze::gfx::Tilemap::atlas, yaze::gfx::Arena::CREATE, ctx_, yaze::zelda3::Overworld::current_area_palette(), yaze::editor::MapRefreshContext::current_blockset, yaze::editor::MapRefreshContext::current_gfx_bmp, yaze::editor::MapRefreshContext::current_map, yaze::gfx::Arena::Get(), yaze::gfx::Bitmap::is_active(), LOG_DEBUG, yaze::editor::MapRefreshContext::overworld, yaze::zelda3::Overworld::overworld_map(), yaze::editor::MapRefreshContext::palette, yaze::gfx::Arena::QueueTextureCommand(), yaze::editor::MapRefreshContext::renderer, yaze::zelda3::Overworld::set_current_map(), yaze::gfx::Bitmap::set_modified(), yaze::editor::Tile16Editor::set_palette(), yaze::gfx::Bitmap::SetPalette(), yaze::gfx::Bitmap::texture(), yaze::editor::MapRefreshContext::tile16_blockset, yaze::zelda3::Overworld::tile16_blockset_data(), yaze::editor::MapRefreshContext::tile16_editor, yaze::gfx::Arena::UPDATE, and yaze::gfx::UpdateTilemap().
| void yaze::editor::MapRefreshCoordinator::UpdateBlocksetWithPendingTileChanges | ( | ) |
Update blockset atlas with pending tile16 editor changes.
Definition at line 620 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 111 of file map_refresh_coordinator.h.
Referenced by ForceRefreshGraphics(), InvalidateGraphicsCache(), RefreshChildMap(), RefreshChildMapOnDemand(), RefreshMapPalette(), RefreshMapProperties(), RefreshMultiAreaMapsSafely(), RefreshOverworldMap(), RefreshOverworldMapOnDemand(), RefreshSiblingMapGraphics(), RefreshTile16Blockset(), and UpdateBlocksetWithPendingTileChanges().