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

#include <map_refresh_coordinator.h>

Collaboration diagram for yaze::editor::MapRefreshCoordinator:

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_
 

Detailed Description

Definition at line 65 of file map_refresh_coordinator.h.

Constructor & Destructor Documentation

◆ MapRefreshCoordinator()

yaze::editor::MapRefreshCoordinator::MapRefreshCoordinator ( const MapRefreshContext & ctx)
inlineexplicit

Definition at line 67 of file map_refresh_coordinator.h.

Member Function Documentation

◆ InvalidateGraphicsCache()

void yaze::editor::MapRefreshCoordinator::InvalidateGraphicsCache ( int map_id = -1)

Invalidate cached graphics for a specific map or all maps.

Parameters
map_idThe 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.

Here is the call graph for this function:

◆ RefreshChildMap()

◆ RefreshOverworldMap()

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().

Here is the call graph for this function:

◆ 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().

Here is the call graph for this function:

◆ RefreshChildMapOnDemand()

◆ RefreshMultiAreaMapsSafely()

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:

  • Uses parameter-based recursion guard instead of static set
  • Always works from parent perspective for consistent sibling coordination
  • Respects ZScream area size logic for v3+ ROMs
  • Falls back to large_map flag for vanilla/v2 ROMs

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().

◆ RefreshMapPalette()

◆ ForceRefreshGraphics()

void yaze::editor::MapRefreshCoordinator::ForceRefreshGraphics ( int map_index)

◆ RefreshSiblingMapGraphics()

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

◆ RefreshMapProperties()

◆ RefreshTile16Blockset()

◆ UpdateBlocksetWithPendingTileChanges()

Member Data Documentation

◆ ctx_


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