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

Represents a single Overworld map screen. More...

#include <overworld_map.h>

Inheritance diagram for yaze::zelda3::OverworldMap:

Public Member Functions

 OverworldMap ()=default
 
 OverworldMap (int index, Rom *rom, GameData *game_data=nullptr)
 
void SetGraphicsPreview (const AreaGraphicsPreview &preview)
 
bool HasGraphicsPreview () const
 
const GameData * game_data () const
 
void SetGameData (GameData *game_data)
 
void SetGraphicsSheetOverrides (std::map< uint16_t, std::vector< uint8_t > > overrides)
 
bool SourceSheetsChanged () const
 
absl::Status BuildMap (int count, int game_state, int world, std::vector< gfx::Tile16 > &tiles16, OverworldBlockset &world_blockset)
 
absl::Status BuildMapWithCache (int count, int game_state, int world, std::vector< gfx::Tile16 > &tiles16, OverworldBlockset &world_blockset, const std::vector< uint8_t > *cached_tileset, const std::vector< uint8_t > *cached_tile16_blockset=nullptr)
 Build map with optional cached tileset for performance.
 
void LoadAreaGraphics ()
 
absl::Status LoadPalette ()
 
absl::Status LoadOverlay ()
 
absl::Status LoadVanillaOverlayData ()
 
absl::Status BuildTileset ()
 
absl::Status BuildTiles16Gfx (std::vector< gfx::Tile16 > &tiles16, int count)
 
absl::Status BuildBitmap (OverworldBlockset &world_blockset)
 
absl::Status BuildSubscreenOverlayLayer (const OverworldBlockset &overlay_world_blockset, int overlay_screen, bool background, std::vector< uint8_t > *out) const
 Build this area's subscreen overlay layer (512x512, 8bpp).
 
uint64_t bitmap_serial () const
 
void UseCachedTileset (const std::vector< uint8_t > &cached_gfx)
 Use a pre-computed tileset from cache instead of rebuilding.
 
void DrawAnimatedTiles ()
 
const std::vector< uint8_t > & current_tile16_blockset () const
 
const std::vector< uint8_t > & current_graphics () const
 
const gfx::SnesPalette & current_palette () const
 
const std::vector< uint8_t > & bitmap_data () const
 
auto is_large_map () const
 
auto is_initialized () const
 
auto is_built () const
 
auto parent () const
 
int index () const
 
auto mutable_mosaic ()
 
auto mutable_current_palette ()
 
const PaletteAddressMap & palette_addresses () const
 
void SetNotBuilt ()
 
auto area_graphics () const
 
OverworldRoomsetSource roomset_source () const
 
OverworldMainSlotProvenance MainSlotProvenance (int slot) const
 
auto area_palette () const
 
auto sprite_graphics (int i) const
 
auto sprite_palette (int i) const
 
auto message_id () const
 
auto area_music (int i) const
 
auto static_graphics (int i) const
 
auto large_index () const
 
auto area_size () const
 
auto main_gfx_id () const
 
auto main_palette () const
 
void set_main_palette (uint8_t palette)
 
auto area_specific_bg_color () const
 
void set_area_specific_bg_color (uint16_t color)
 
uint8_t area_graphics_for_save () const
 
uint8_t area_palette_for_save () const
 
uint8_t sprite_graphics_for_save (int state) const
 
uint8_t sprite_palette_for_save (int state) const
 
auto subscreen_overlay () const
 
void set_subscreen_overlay (uint16_t overlay)
 
auto animated_gfx () const
 
void set_animated_gfx (uint8_t gfx)
 
auto game_state () const
 
void set_game_state (int state)
 
auto custom_tileset (int index) const
 
AreaRenderProperties area_render_properties () const
 
void InheritAreaProperties (const OverworldMap &area_parent)
 
void ClearInheritedAreaProperties ()
 
bool has_inherited_area_properties () const
 
uint8_t render_main_palette () const
 
uint16_t render_subscreen_overlay () const
 
uint8_t animated_sheet () const
 
OverworldTilesetKey tileset_key () const
 
auto overlay_id () const
 
auto has_overlay () const
 
const auto & overlay_data () const
 
const std::array< bool, 4 > & mosaic_expanded () const
 
void set_mosaic_expanded (int index, bool value)
 
void set_custom_tileset (int index, uint8_t value)
 
auto mutable_current_graphics ()
 
auto mutable_area_graphics ()
 
auto mutable_area_palette ()
 
auto mutable_sprite_graphics (int i)
 
auto mutable_sprite_palette (int i)
 
auto mutable_message_id ()
 
auto mutable_main_palette ()
 
auto mutable_animated_gfx ()
 
auto mutable_subscreen_overlay ()
 
auto mutable_area_music (int i)
 
auto mutable_static_graphics (int i)
 
auto set_area_graphics (uint8_t value)
 
auto set_area_palette (uint8_t value)
 
auto set_sprite_graphics (int i, uint8_t value)
 
auto set_sprite_palette (int i, uint8_t value)
 
auto set_message_id (uint16_t value)
 
uint8_t * mutable_custom_tileset (int index)
 
void SetAsLargeMap (int parent_index, int quadrant)
 
void SetAsSmallMap (int index=-1)
 
void SetAreaSize (AreaSizeEnum size)
 
void SetParent (int parent_index)
 
void Destroy ()
 Free memory-heavy data while preserving map identity.
 

Static Public Member Functions

static absl::StatusOr< OverworldMap > CreateLyraPreview (int index, Rom *rom, GameData *game_data, const rom::LyraLayoutInspection *layout)
 

Private Member Functions

 OverworldMap (int index, Rom *rom, GameData *game_data, bool seed_area_parent, bool skip_legacy_data=false)
 
absl::Status LoadLyraPreviewProperties ()
 
void CopyAnimatedSheetIntoSlot7 ()
 
void LoadAreaInfo ()
 
void CaptureAreaInfoBaseline ()
 
uint8_t AreaInfoForSave (size_t field, uint8_t value) const
 
void LoadCustomOverworldData ()
 
void SetupCustomTileset (uint8_t asm_version)
 
void LoadMainBlocksetId ()
 
int ComputeMainBlocksetId () const
 
bool UsesSessionMainGraphicsGroup () const
 
bool UsesSessionAreaGraphicsGroup () const
 
bool UsesSessionSpriteGraphicsGroup () const
 
std::array< uint8_t, 8 > ResolveMainGraphicsGroup () const
 
std::array< uint8_t, 4 > ResolveAreaGraphicsGroup () const
 
std::array< uint8_t, 4 > ResolveSpriteGraphicsGroup () const
 
std::array< uint8_t, 16 > ResolveStaticGraphics () const
 
void LoadDeathMountainGFX ()
 
uint8_t ComputeWorldBasedMainPalette () const
 
void ProcessGraphicsBuffer (int index, int static_graphics_offset, int size, const uint8_t *all_gfx)
 
absl::StatusOr< gfx::SnesPalette > GetPalette (const gfx::PaletteGroup &group, int index, int previous_index, int limit, int *resolved_index=nullptr)
 
zelda3_version_pointers version_constants () const
 
uint16_t SourceSheetForRevision (int i) const
 
void RecordSourceSheetRevisions ()
 

Private Attributes

Rom * rom_ = nullptr
 
GameData * game_data_ = nullptr
 
const rom::LyraLayoutInspection * descriptor_layout_ = nullptr
 
bool built_ = false
 
bool large_map_ = false
 
bool initialized_ = false
 
bool mosaic_ = false
 
int index_ = 0
 
int parent_ = 0
 
int large_index_ = 0
 
int world_ = 0
 
int game_state_ = 0
 
int main_gfx_id_ = 0
 
AreaSizeEnum area_size_ = AreaSizeEnum::SmallArea
 
uint16_t message_id_ = 0
 
uint8_t area_graphics_ = 0
 
uint8_t area_palette_ = 0
 
uint8_t main_palette_ = 0
 
uint8_t animated_gfx_ = 0
 
uint16_t subscreen_overlay_ = 0
 
uint16_t area_specific_bg_color_
 
uint8_t animated_sheet_ = 0
 
uint64_t bitmap_serial_ = 0
 
std::optional< AreaRenderProperties > inherited_area_
 
std::array< uint8_t, 8 > loaded_area_info_ {}
 
std::array< uint8_t, 8 > raw_area_info_ {}
 
int loaded_area_info_parent_ = -1
 
bool area_info_baseline_valid_ = false
 
std::array< uint8_t, 8 > custom_gfx_ids_ = {}
 
std::array< uint8_t, 3 > sprite_graphics_
 
std::array< uint8_t, 3 > sprite_palette_
 
std::array< uint8_t, 4 > area_music_
 
std::array< uint8_t, 16 > static_graphics_
 
std::array< bool, 4 > mosaic_expanded_
 
uint16_t overlay_id_ = 0
 
bool has_overlay_ = false
 
std::vector< uint8_t > overlay_data_
 
std::vector< uint8_t > current_blockset_
 
std::vector< uint8_t > current_gfx_
 
std::vector< uint8_t > bitmap_data_
 
OverworldMapTiles map_tiles_
 
gfx::SnesPalette current_palette_
 
PaletteAddressMap palette_addresses_ {}
 
std::map< uint16_t, std::vector< uint8_t > > graphics_sheet_overrides_
 
AreaGraphicsPreview graphics_preview_
 
std::array< uint64_t, kNumSourceSheets > source_sheet_revisions_ {}
 
bool source_assignments_recorded_ = false
 

Static Private Attributes

static constexpr int kNumSourceSheets = 17
 

Friends

ResolvedGraphicsContext DescribeOverworldGraphicsContext (const OverworldMap &map, const GraphicsContextIdentity &identity)
 

Additional Inherited Members

- Static Protected Attributes inherited from yaze::gfx::GfxContext
static std::unordered_map< uint8_t, gfx::Paletteset > palettesets_
 

Detailed Description

Represents a single Overworld map screen.

Definition at line 235 of file overworld_map.h.

Constructor & Destructor Documentation

◆ OverworldMap() [1/3]

yaze::zelda3::OverworldMap::OverworldMap ( )
default

◆ OverworldMap() [2/3]

yaze::zelda3::OverworldMap::OverworldMap ( int index,
Rom * rom,
GameData * game_data = nullptr )

Definition at line 81 of file overworld_map.cc.

◆ OverworldMap() [3/3]

Member Function Documentation

◆ CreateLyraPreview()

absl::StatusOr< OverworldMap > yaze::zelda3::OverworldMap::CreateLyraPreview ( int index,
Rom * rom,
GameData * game_data,
const rom::LyraLayoutInspection * layout )
static

◆ SetGraphicsPreview()

void yaze::zelda3::OverworldMap::SetGraphicsPreview ( const AreaGraphicsPreview & preview)
inline

Definition at line 243 of file overworld_map.h.

References built_, and graphics_preview_.

◆ HasGraphicsPreview()

bool yaze::zelda3::OverworldMap::HasGraphicsPreview ( ) const
inline

Definition at line 249 of file overworld_map.h.

References graphics_preview_.

Referenced by BuildMapWithCache().

◆ game_data()

const GameData * yaze::zelda3::OverworldMap::game_data ( ) const
inline

◆ SetGameData()

void yaze::zelda3::OverworldMap::SetGameData ( GameData * game_data)
inline

Definition at line 252 of file overworld_map.h.

References game_data(), game_data_, and palette_addresses_.

Here is the call graph for this function:

◆ SetGraphicsSheetOverrides()

void yaze::zelda3::OverworldMap::SetGraphicsSheetOverrides ( std::map< uint16_t, std::vector< uint8_t > > overrides)
inline

Sheet pixels to use instead of GameData::graphics_buffer when BuildTileset() runs (8bpp, 4096 bytes per sheet). Lets a preview show unsaved graphics edits without writing the ROM or the shared GameData. Entries of the wrong size are ignored.

Definition at line 262 of file overworld_map.h.

References graphics_sheet_overrides_.

◆ SourceSheetsChanged()

bool yaze::zelda3::OverworldMap::SourceSheetsChanged ( ) const

True when resolved sheet assignments or source pixel revisions changed since BuildTileset(). Maps never built from the store report false.

Definition at line 1577 of file overworld_map.cc.

References game_data_, yaze::zelda3::GameData::gfx_groups_loaded, graphics_sheet_overrides_, kNumSourceSheets, ResolveStaticGraphics(), yaze::zelda3::GraphicsSheetStore::Revision(), rom_, yaze::zelda3::GraphicsSheetStoreHolder::sheet_store, source_assignments_recorded_, source_sheet_revisions_, SourceSheetForRevision(), and static_graphics_.

Here is the call graph for this function:

◆ BuildMap()

absl::Status yaze::zelda3::OverworldMap::BuildMap ( int count,
int game_state,
int world,
std::vector< gfx::Tile16 > & tiles16,
OverworldBlockset & world_blockset )

Definition at line 250 of file overworld_map.cc.

References BuildMapWithCache(), and game_state().

Here is the call graph for this function:

◆ BuildMapWithCache()

absl::Status yaze::zelda3::OverworldMap::BuildMapWithCache ( int count,
int game_state,
int world,
std::vector< gfx::Tile16 > & tiles16,
OverworldBlockset & world_blockset,
const std::vector< uint8_t > * cached_tileset,
const std::vector< uint8_t > * cached_tile16_blockset = nullptr )

◆ LoadAreaGraphics()

void yaze::zelda3::OverworldMap::LoadAreaGraphics ( )

◆ LoadPalette()

absl::Status yaze::zelda3::OverworldMap::LoadPalette ( )

Definition at line 1256 of file overworld_map.cc.

References area_palette_, area_render_properties(), area_specific_bg_color(), ASSIGN_OR_RETURN, yaze::gfx::SnesPalette::clear(), ComputeWorldBasedMainPalette(), current_palette_, yaze::Rom::data(), descriptor_layout_, game_data_, game_state_, yaze::zelda3::OverworldVersionHelper::GetAsmVersion(), GetPalette(), yaze::zelda3::OverworldVersionHelper::GetVersion(), yaze::gfx::PaletteGroupMap::grass, yaze::gfx::PaletteGroupMap::hud, index_, yaze::zelda3::kDarkWorldMapIdStart, yaze::zelda3::kNumOverworldMaps, zelda3_version_pointers::kOverworldMapPaletteGroup, yaze::zelda3::kOverworldMapPaletteIds, yaze::zelda3::kOverworldPalettesScreenToSetNew, yaze::zelda3::kOverworldSpritePaletteGroup, yaze::zelda3::kOverworldSpritePaletteIds, yaze::zelda3::kSpecialWorldMapIdStart, yaze::zelda3::kVanilla, yaze::rom::LyraLayoutRecord(), main(), yaze::zelda3::AreaRenderProperties::main_palette, main_palette_, yaze::gfx::PaletteGroupMap::overworld_animated, yaze::gfx::PaletteGroupMap::overworld_aux, yaze::gfx::PaletteGroupMap::overworld_main, yaze::zelda3::OverworldCustomAreaSpecificBGEnabled, palette_addresses_, yaze::zelda3::GameData::palette_groups, parent_, RETURN_IF_ERROR, rom_, yaze::zelda3::palette_internal::SetColorsPalette(), yaze::Rom::size(), sprite_palette_, yaze::gfx::PaletteGroupMap::sprites_aux3, yaze::zelda3::OverworldVersionHelper::SupportsAreaEnum(), yaze::zelda3::OverworldVersionHelper::SupportsCustomBGColors(), and version_constants().

Referenced by BuildMapWithCache(), and yaze::cli::GraphicsContextCommandHandler::Execute().

◆ LoadOverlay()

absl::Status yaze::zelda3::OverworldMap::LoadOverlay ( )

◆ LoadVanillaOverlayData()

absl::Status yaze::zelda3::OverworldMap::LoadVanillaOverlayData ( )

◆ BuildTileset()

absl::Status yaze::zelda3::OverworldMap::BuildTileset ( )

◆ BuildTiles16Gfx()

absl::Status yaze::zelda3::OverworldMap::BuildTiles16Gfx ( std::vector< gfx::Tile16 > & tiles16,
int count )

◆ BuildBitmap()

absl::Status yaze::zelda3::OverworldMap::BuildBitmap ( OverworldBlockset & world_blockset)

◆ BuildSubscreenOverlayLayer()

absl::Status yaze::zelda3::OverworldMap::BuildSubscreenOverlayLayer ( const OverworldBlockset & overlay_world_blockset,
int overlay_screen,
bool background,
std::vector< uint8_t > * out ) const

Build this area's subscreen overlay layer (512x512, 8bpp).

The game draws the overlay screen's tilemap as BG1 with the current area's graphics and palette, so the layer uses this map's tile16 blockset and indexes this map's palette. Pixels the overlay leaves transparent are 0. For background overlays (sky, pyramid, lava) only pixels where this map shows the backdrop are kept, so the layer can be drawn on top of the map. Requires a built map.

Definition at line 1777 of file overworld_map.cc.

References bitmap_data_, yaze::gfx::CopyTile8bpp16(), current_blockset_, and yaze::zelda3::IsOverworldBackdropPixel().

Here is the call graph for this function:

◆ bitmap_serial()

uint64_t yaze::zelda3::OverworldMap::bitmap_serial ( ) const
inline

Changes every time BuildBitmap() produces new pixels (unique across maps), so views can tell when derived layers are stale.

Definition at line 311 of file overworld_map.h.

References bitmap_serial_.

◆ UseCachedTileset()

void yaze::zelda3::OverworldMap::UseCachedTileset ( const std::vector< uint8_t > & cached_gfx)
inline

Use a pre-computed tileset from cache instead of rebuilding.

Parameters
cached_gfxThe cached current_gfx_ data (64KB)

Definition at line 317 of file overworld_map.h.

References yaze::zelda3::ApplyGraphicsPreview(), current_gfx_, graphics_preview_, and RecordSourceSheetRevisions().

Referenced by BuildMapWithCache().

Here is the call graph for this function:

◆ DrawAnimatedTiles()

void yaze::zelda3::OverworldMap::DrawAnimatedTiles ( )

Definition at line 1067 of file overworld_map.cc.

References static_graphics_.

◆ current_tile16_blockset()

const std::vector< uint8_t > & yaze::zelda3::OverworldMap::current_tile16_blockset ( ) const
inline

Definition at line 327 of file overworld_map.h.

References current_blockset_.

◆ current_graphics()

const std::vector< uint8_t > & yaze::zelda3::OverworldMap::current_graphics ( ) const
inline

◆ current_palette()

const gfx::SnesPalette & yaze::zelda3::OverworldMap::current_palette ( ) const
inline

Definition at line 331 of file overworld_map.h.

References current_palette_.

Referenced by yaze::editor::ResolveOverworldQuadrantTarget().

◆ bitmap_data()

const std::vector< uint8_t > & yaze::zelda3::OverworldMap::bitmap_data ( ) const
inline

Definition at line 332 of file overworld_map.h.

References bitmap_data_.

◆ is_large_map()

auto yaze::zelda3::OverworldMap::is_large_map ( ) const
inline

Definition at line 333 of file overworld_map.h.

References large_map_.

Referenced by yaze::cli::overworld::AreaScreenSpan().

◆ is_initialized()

auto yaze::zelda3::OverworldMap::is_initialized ( ) const
inline

Definition at line 334 of file overworld_map.h.

References initialized_.

◆ is_built()

auto yaze::zelda3::OverworldMap::is_built ( ) const
inline

Definition at line 335 of file overworld_map.h.

References built_.

◆ parent()

◆ index()

◆ mutable_mosaic()

auto yaze::zelda3::OverworldMap::mutable_mosaic ( )
inline

Definition at line 338 of file overworld_map.h.

References mosaic_.

◆ mutable_current_palette()

auto yaze::zelda3::OverworldMap::mutable_current_palette ( )
inline

Definition at line 339 of file overworld_map.h.

References current_palette_, and palette_addresses_.

◆ palette_addresses()

const PaletteAddressMap & yaze::zelda3::OverworldMap::palette_addresses ( ) const
inline

Definition at line 344 of file overworld_map.h.

References palette_addresses_.

Referenced by yaze::editor::ResolveOverworldQuadrantTarget().

◆ SetNotBuilt()

void yaze::zelda3::OverworldMap::SetNotBuilt ( )
inline

Definition at line 348 of file overworld_map.h.

References built_.

◆ area_graphics()

auto yaze::zelda3::OverworldMap::area_graphics ( ) const
inline

◆ roomset_source()

◆ MainSlotProvenance()

◆ area_palette()

auto yaze::zelda3::OverworldMap::area_palette ( ) const
inline

Definition at line 353 of file overworld_map.h.

References area_palette_.

Referenced by yaze::editor::BuildOverworldMapMetadata().

◆ sprite_graphics()

auto yaze::zelda3::OverworldMap::sprite_graphics ( int i) const
inline

◆ sprite_palette()

auto yaze::zelda3::OverworldMap::sprite_palette ( int i) const
inline

◆ message_id()

auto yaze::zelda3::OverworldMap::message_id ( ) const
inline

Definition at line 356 of file overworld_map.h.

References message_id_.

Referenced by yaze::editor::BuildOverworldMapMetadata().

◆ area_music()

auto yaze::zelda3::OverworldMap::area_music ( int i) const
inline

◆ static_graphics()

auto yaze::zelda3::OverworldMap::static_graphics ( int i) const
inline

◆ large_index()

auto yaze::zelda3::OverworldMap::large_index ( ) const
inline

Definition at line 359 of file overworld_map.h.

References large_index_.

◆ area_size()

auto yaze::zelda3::OverworldMap::area_size ( ) const
inline

◆ main_gfx_id()

auto yaze::zelda3::OverworldMap::main_gfx_id ( ) const
inline

Definition at line 361 of file overworld_map.h.

References main_gfx_id_.

◆ main_palette()

auto yaze::zelda3::OverworldMap::main_palette ( ) const
inline

Definition at line 363 of file overworld_map.h.

References main_palette_.

Referenced by yaze::editor::BuildOverworldMapMetadata().

◆ set_main_palette()

void yaze::zelda3::OverworldMap::set_main_palette ( uint8_t palette)
inline

Definition at line 364 of file overworld_map.h.

References main_palette_.

◆ area_specific_bg_color()

auto yaze::zelda3::OverworldMap::area_specific_bg_color ( ) const
inline

Definition at line 366 of file overworld_map.h.

References area_specific_bg_color_.

Referenced by LoadPalette().

◆ set_area_specific_bg_color()

void yaze::zelda3::OverworldMap::set_area_specific_bg_color ( uint16_t color)
inline

Definition at line 367 of file overworld_map.h.

References area_specific_bg_color_.

◆ area_graphics_for_save()

uint8_t yaze::zelda3::OverworldMap::area_graphics_for_save ( ) const
inline

Definition at line 374 of file overworld_map.h.

References area_graphics_, and AreaInfoForSave().

Here is the call graph for this function:

◆ area_palette_for_save()

uint8_t yaze::zelda3::OverworldMap::area_palette_for_save ( ) const
inline

Definition at line 377 of file overworld_map.h.

References area_palette_, and AreaInfoForSave().

Here is the call graph for this function:

◆ sprite_graphics_for_save()

uint8_t yaze::zelda3::OverworldMap::sprite_graphics_for_save ( int state) const
inline

Definition at line 380 of file overworld_map.h.

References AreaInfoForSave(), and sprite_graphics_.

Here is the call graph for this function:

◆ sprite_palette_for_save()

uint8_t yaze::zelda3::OverworldMap::sprite_palette_for_save ( int state) const
inline

Definition at line 383 of file overworld_map.h.

References AreaInfoForSave(), and sprite_palette_.

Here is the call graph for this function:

◆ subscreen_overlay()

auto yaze::zelda3::OverworldMap::subscreen_overlay ( ) const
inline

Definition at line 387 of file overworld_map.h.

References subscreen_overlay_.

◆ set_subscreen_overlay()

void yaze::zelda3::OverworldMap::set_subscreen_overlay ( uint16_t overlay)
inline

Definition at line 388 of file overworld_map.h.

References subscreen_overlay_.

◆ animated_gfx()

auto yaze::zelda3::OverworldMap::animated_gfx ( ) const
inline

Definition at line 390 of file overworld_map.h.

References animated_gfx_.

Referenced by yaze::editor::BuildOverworldMapMetadata().

◆ set_animated_gfx()

void yaze::zelda3::OverworldMap::set_animated_gfx ( uint8_t gfx)
inline

Definition at line 391 of file overworld_map.h.

References animated_gfx_.

◆ game_state()

auto yaze::zelda3::OverworldMap::game_state ( ) const
inline

Definition at line 393 of file overworld_map.h.

References game_state_.

Referenced by BuildMap(), and BuildMapWithCache().

◆ set_game_state()

void yaze::zelda3::OverworldMap::set_game_state ( int state)
inline

◆ custom_tileset()

auto yaze::zelda3::OverworldMap::custom_tileset ( int index) const
inline

Definition at line 396 of file overworld_map.h.

References custom_gfx_ids_, and index().

Here is the call graph for this function:

◆ area_render_properties()

◆ InheritAreaProperties()

◆ ClearInheritedAreaProperties()

void yaze::zelda3::OverworldMap::ClearInheritedAreaProperties ( )
inline

Definition at line 402 of file overworld_map.h.

References inherited_area_.

◆ has_inherited_area_properties()

bool yaze::zelda3::OverworldMap::has_inherited_area_properties ( ) const
inline

Definition at line 403 of file overworld_map.h.

References inherited_area_.

◆ render_main_palette()

uint8_t yaze::zelda3::OverworldMap::render_main_palette ( ) const
inline

Definition at line 406 of file overworld_map.h.

References area_render_properties(), and yaze::zelda3::AreaRenderProperties::main_palette.

Referenced by yaze::editor::MakeOverworldGraphicsEditContext().

Here is the call graph for this function:

◆ render_subscreen_overlay()

uint16_t yaze::zelda3::OverworldMap::render_subscreen_overlay ( ) const
inline

Definition at line 409 of file overworld_map.h.

References area_render_properties(), and yaze::zelda3::AreaRenderProperties::subscreen_overlay.

Here is the call graph for this function:

◆ animated_sheet()

uint8_t yaze::zelda3::OverworldMap::animated_sheet ( ) const
inline

Sheet whose top half is shown in graphics slot 7 (animated water/lava frame 0). Resolved by LoadAreaGraphics().

Definition at line 415 of file overworld_map.h.

References animated_sheet_.

◆ tileset_key()

OverworldTilesetKey yaze::zelda3::OverworldMap::tileset_key ( ) const

Definition at line 241 of file overworld_map.cc.

References animated_sheet_, and static_graphics_.

◆ overlay_id()

auto yaze::zelda3::OverworldMap::overlay_id ( ) const
inline

Definition at line 419 of file overworld_map.h.

References overlay_id_.

◆ has_overlay()

auto yaze::zelda3::OverworldMap::has_overlay ( ) const
inline

Definition at line 420 of file overworld_map.h.

References has_overlay_.

◆ overlay_data()

const auto & yaze::zelda3::OverworldMap::overlay_data ( ) const
inline

Definition at line 421 of file overworld_map.h.

References overlay_data_.

◆ mosaic_expanded()

const std::array< bool, 4 > & yaze::zelda3::OverworldMap::mosaic_expanded ( ) const
inline

Definition at line 424 of file overworld_map.h.

References mosaic_expanded_.

Referenced by yaze::editor::MapPropertiesSystem::ReadPropertyValue().

◆ set_mosaic_expanded()

void yaze::zelda3::OverworldMap::set_mosaic_expanded ( int index,
bool value )
inline

Definition at line 427 of file overworld_map.h.

References index(), and mosaic_expanded_.

Here is the call graph for this function:

◆ set_custom_tileset()

void yaze::zelda3::OverworldMap::set_custom_tileset ( int index,
uint8_t value )
inline

Definition at line 430 of file overworld_map.h.

References custom_gfx_ids_, and index().

Here is the call graph for this function:

◆ mutable_current_graphics()

auto yaze::zelda3::OverworldMap::mutable_current_graphics ( )
inline

Definition at line 434 of file overworld_map.h.

References current_gfx_.

◆ mutable_area_graphics()

auto yaze::zelda3::OverworldMap::mutable_area_graphics ( )
inline

Definition at line 435 of file overworld_map.h.

References area_graphics_.

◆ mutable_area_palette()

auto yaze::zelda3::OverworldMap::mutable_area_palette ( )
inline

Definition at line 436 of file overworld_map.h.

References area_palette_.

◆ mutable_sprite_graphics()

auto yaze::zelda3::OverworldMap::mutable_sprite_graphics ( int i)
inline

Definition at line 437 of file overworld_map.h.

References sprite_graphics_.

◆ mutable_sprite_palette()

auto yaze::zelda3::OverworldMap::mutable_sprite_palette ( int i)
inline

Definition at line 438 of file overworld_map.h.

References sprite_palette_.

◆ mutable_message_id()

auto yaze::zelda3::OverworldMap::mutable_message_id ( )
inline

Definition at line 439 of file overworld_map.h.

References message_id_.

◆ mutable_main_palette()

auto yaze::zelda3::OverworldMap::mutable_main_palette ( )
inline

Definition at line 440 of file overworld_map.h.

References main_palette_.

◆ mutable_animated_gfx()

auto yaze::zelda3::OverworldMap::mutable_animated_gfx ( )
inline

Definition at line 441 of file overworld_map.h.

References animated_gfx_.

◆ mutable_subscreen_overlay()

auto yaze::zelda3::OverworldMap::mutable_subscreen_overlay ( )
inline

Definition at line 442 of file overworld_map.h.

References subscreen_overlay_.

◆ mutable_area_music()

auto yaze::zelda3::OverworldMap::mutable_area_music ( int i)
inline

Definition at line 443 of file overworld_map.h.

References area_music_.

◆ mutable_static_graphics()

auto yaze::zelda3::OverworldMap::mutable_static_graphics ( int i)
inline

Definition at line 444 of file overworld_map.h.

References static_graphics_.

◆ set_area_graphics()

auto yaze::zelda3::OverworldMap::set_area_graphics ( uint8_t value)
inline

Definition at line 446 of file overworld_map.h.

References area_graphics_.

◆ set_area_palette()

auto yaze::zelda3::OverworldMap::set_area_palette ( uint8_t value)
inline

Definition at line 447 of file overworld_map.h.

References area_palette_.

◆ set_sprite_graphics()

auto yaze::zelda3::OverworldMap::set_sprite_graphics ( int i,
uint8_t value )
inline

Definition at line 448 of file overworld_map.h.

References sprite_graphics_.

◆ set_sprite_palette()

auto yaze::zelda3::OverworldMap::set_sprite_palette ( int i,
uint8_t value )
inline

Definition at line 451 of file overworld_map.h.

References sprite_palette_.

◆ set_message_id()

auto yaze::zelda3::OverworldMap::set_message_id ( uint16_t value)
inline

Definition at line 452 of file overworld_map.h.

References message_id_.

◆ mutable_custom_tileset()

uint8_t * yaze::zelda3::OverworldMap::mutable_custom_tileset ( int index)
inline

Definition at line 454 of file overworld_map.h.

References custom_gfx_ids_, and index().

Here is the call graph for this function:

◆ SetAsLargeMap()

void yaze::zelda3::OverworldMap::SetAsLargeMap ( int parent_index,
int quadrant )
inline

Definition at line 456 of file overworld_map.h.

References area_size_, large_index_, large_map_, yaze::zelda3::LargeArea, and parent_.

◆ SetAsSmallMap()

void yaze::zelda3::OverworldMap::SetAsSmallMap ( int index = -1)
inline

Definition at line 463 of file overworld_map.h.

References area_size_, index(), index_, large_index_, large_map_, parent_, and yaze::zelda3::SmallArea.

Here is the call graph for this function:

◆ SetAreaSize()

void yaze::zelda3::OverworldMap::SetAreaSize ( AreaSizeEnum size)
inline

Definition at line 473 of file overworld_map.h.

References area_size_, large_map_, and yaze::zelda3::LargeArea.

◆ SetParent()

void yaze::zelda3::OverworldMap::SetParent ( int parent_index)
inline

Definition at line 478 of file overworld_map.h.

References parent_.

◆ Destroy()

void yaze::zelda3::OverworldMap::Destroy ( )
inline

Free memory-heavy data while preserving map identity.

This method is called by LRU eviction to free memory. IMPORTANT: Do NOT reset index_, parent_, rom_, or other identity fields! The map must be rebuildable using EnsureMapBuilt() after eviction.

Definition at line 487 of file overworld_map.h.

References bitmap_data_, built_, current_blockset_, current_gfx_, yaze::zelda3::OverworldMapTiles::dark_world, game_state_, initialized_, yaze::zelda3::OverworldMapTiles::light_world, main_gfx_id_, map_tiles_, yaze::zelda3::OverworldMapTiles::special_world, and world_.

◆ LoadLyraPreviewProperties()

◆ CopyAnimatedSheetIntoSlot7()

void yaze::zelda3::OverworldMap::CopyAnimatedSheetIntoSlot7 ( )
private

◆ LoadAreaInfo()

void yaze::zelda3::OverworldMap::LoadAreaInfo ( )
private

Definition at line 323 of file overworld_map.cc.

References area_graphics_, area_music_, area_palette_, area_size_, area_specific_bg_color_, yaze::zelda3::GetOverworldMessagesExpanded(), yaze::zelda3::OverworldVersionHelper::GetVersion(), index_, yaze::zelda3::kAreaGfxIdPtr, yaze::zelda3::kDarkWorldMapIdStart, yaze::zelda3::kOverworldMapPaletteIds, yaze::zelda3::kOverworldMessageIds, yaze::zelda3::kOverworldMusicAgahnim, yaze::zelda3::kOverworldMusicBeginning, yaze::zelda3::kOverworldMusicDarkWorld, yaze::zelda3::kOverworldMusicMasterSword, yaze::zelda3::kOverworldMusicZelda, yaze::zelda3::kOverworldPalettesScreenToSetNew, yaze::zelda3::kOverworldScreenSize, yaze::zelda3::kOverworldSpecialGfxGroup, yaze::zelda3::kOverworldSpecialPalGroup, yaze::zelda3::kOverworldSpecialSpriteGFXGroup, yaze::zelda3::kOverworldSpecialSpriteGfxGroupExpandedTemp, yaze::zelda3::kOverworldSpecialSpritePalette, yaze::zelda3::kOverworldSpecialSpritePaletteExpandedTemp, yaze::zelda3::kOverworldSpritePaletteIds, yaze::zelda3::kOverworldSpriteset, yaze::zelda3::kSpecialWorldMapIdStart, yaze::zelda3::kVanilla, yaze::zelda3::kZSCustomV2, yaze::zelda3::kZSCustomV3, large_map_, yaze::zelda3::LargeArea, yaze::zelda3::LegacyScreenSizeTableIndexForMap(), message_id_, yaze::zelda3::OverworldCustomAreaSpecificBGPalette, parent_, rom_, yaze::zelda3::SmallArea, sprite_graphics_, sprite_palette_, yaze::zelda3::OverworldVersionHelper::SupportsAreaEnum(), yaze::zelda3::OverworldVersionHelper::SupportsCustomBGColors(), yaze::zelda3::OverworldVersionHelper::SupportsExpandedSpace(), yaze::zelda3::TallArea, and yaze::zelda3::WideArea.

Referenced by OverworldMap().

◆ CaptureAreaInfoBaseline()

◆ AreaInfoForSave()

uint8_t yaze::zelda3::OverworldMap::AreaInfoForSave ( size_t field,
uint8_t value ) const
inlineprivate

◆ LoadCustomOverworldData()

void yaze::zelda3::OverworldMap::LoadCustomOverworldData ( )
private

◆ SetupCustomTileset()

◆ LoadMainBlocksetId()

void yaze::zelda3::OverworldMap::LoadMainBlocksetId ( )
private

Definition at line 910 of file overworld_map.cc.

References ComputeMainBlocksetId(), and main_gfx_id_.

Referenced by LoadAreaGraphics().

Here is the call graph for this function:

◆ ComputeMainBlocksetId()

int yaze::zelda3::OverworldMap::ComputeMainBlocksetId ( ) const
private

◆ UsesSessionMainGraphicsGroup()

bool yaze::zelda3::OverworldMap::UsesSessionMainGraphicsGroup ( ) const
private

◆ UsesSessionAreaGraphicsGroup()

bool yaze::zelda3::OverworldMap::UsesSessionAreaGraphicsGroup ( ) const
private

◆ UsesSessionSpriteGraphicsGroup()

bool yaze::zelda3::OverworldMap::UsesSessionSpriteGraphicsGroup ( ) const
private

◆ ResolveMainGraphicsGroup()

std::array< uint8_t, 8 > yaze::zelda3::OverworldMap::ResolveMainGraphicsGroup ( ) const
private

◆ ResolveAreaGraphicsGroup()

std::array< uint8_t, 4 > yaze::zelda3::OverworldMap::ResolveAreaGraphicsGroup ( ) const
private

◆ ResolveSpriteGraphicsGroup()

std::array< uint8_t, 4 > yaze::zelda3::OverworldMap::ResolveSpriteGraphicsGroup ( ) const
private

◆ ResolveStaticGraphics()

◆ LoadDeathMountainGFX()

◆ ComputeWorldBasedMainPalette()

uint8_t yaze::zelda3::OverworldMap::ComputeWorldBasedMainPalette ( ) const
private

Definition at line 722 of file overworld_map.cc.

References parent_.

Referenced by LoadPalette(), and SetupCustomTileset().

◆ ProcessGraphicsBuffer()

void yaze::zelda3::OverworldMap::ProcessGraphicsBuffer ( int index,
int static_graphics_offset,
int size,
const uint8_t * all_gfx )
private

Definition at line 1596 of file overworld_map.cc.

References current_gfx_, game_data_, yaze::zelda3::GraphicsSheetStoreHolder::graphics_buffer, graphics_sheet_overrides_, and index().

Referenced by BuildTileset().

Here is the call graph for this function:

◆ GetPalette()

absl::StatusOr< gfx::SnesPalette > yaze::zelda3::OverworldMap::GetPalette ( const gfx::PaletteGroup & group,
int index,
int previous_index,
int limit,
int * resolved_index = nullptr )
private

Definition at line 1241 of file overworld_map.cc.

References index(), zelda3_version_pointers::kOverworldMapPaletteGroup, and version_constants().

Referenced by LoadPalette().

Here is the call graph for this function:

◆ version_constants()

◆ SourceSheetForRevision()

uint16_t yaze::zelda3::OverworldMap::SourceSheetForRevision ( int i) const
private

Definition at line 1559 of file overworld_map.cc.

References animated_sheet_, and static_graphics_.

Referenced by RecordSourceSheetRevisions(), and SourceSheetsChanged().

◆ RecordSourceSheetRevisions()

void yaze::zelda3::OverworldMap::RecordSourceSheetRevisions ( )
private

Friends And Related Symbol Documentation

◆ DescribeOverworldGraphicsContext

ResolvedGraphicsContext DescribeOverworldGraphicsContext ( const OverworldMap & map,
const GraphicsContextIdentity & identity )
friend

Definition at line 207 of file resolved_graphics_context.cc.

Member Data Documentation

◆ rom_

◆ game_data_

◆ descriptor_layout_

const rom::LyraLayoutInspection* yaze::zelda3::OverworldMap::descriptor_layout_ = nullptr
private

◆ built_

bool yaze::zelda3::OverworldMap::built_ = false
private

◆ large_map_

bool yaze::zelda3::OverworldMap::large_map_ = false
private

◆ initialized_

bool yaze::zelda3::OverworldMap::initialized_ = false
private

Definition at line 560 of file overworld_map.h.

Referenced by BuildMapWithCache(), Destroy(), and is_initialized().

◆ mosaic_

bool yaze::zelda3::OverworldMap::mosaic_ = false
private

Definition at line 561 of file overworld_map.h.

Referenced by LoadLyraPreviewProperties(), mutable_mosaic(), and SetupCustomTileset().

◆ index_

◆ parent_

◆ large_index_

int yaze::zelda3::OverworldMap::large_index_ = 0
private

Definition at line 565 of file overworld_map.h.

Referenced by large_index(), SetAsLargeMap(), and SetAsSmallMap().

◆ world_

int yaze::zelda3::OverworldMap::world_ = 0
private

Definition at line 566 of file overworld_map.h.

Referenced by BuildBitmap(), BuildMapWithCache(), and Destroy().

◆ game_state_

int yaze::zelda3::OverworldMap::game_state_ = 0
private

◆ main_gfx_id_

int yaze::zelda3::OverworldMap::main_gfx_id_ = 0
private

Definition at line 568 of file overworld_map.h.

Referenced by Destroy(), LoadMainBlocksetId(), and main_gfx_id().

◆ area_size_

AreaSizeEnum yaze::zelda3::OverworldMap::area_size_ = AreaSizeEnum::SmallArea
private

◆ message_id_

uint16_t yaze::zelda3::OverworldMap::message_id_ = 0
private

Definition at line 571 of file overworld_map.h.

Referenced by LoadAreaInfo(), message_id(), mutable_message_id(), and set_message_id().

◆ area_graphics_

◆ area_palette_

uint8_t yaze::zelda3::OverworldMap::area_palette_ = 0
private

◆ main_palette_

◆ animated_gfx_

◆ subscreen_overlay_

◆ area_specific_bg_color_

uint16_t yaze::zelda3::OverworldMap::area_specific_bg_color_
private

◆ animated_sheet_

uint8_t yaze::zelda3::OverworldMap::animated_sheet_ = 0
private

◆ bitmap_serial_

uint64_t yaze::zelda3::OverworldMap::bitmap_serial_ = 0
private

Definition at line 580 of file overworld_map.h.

Referenced by bitmap_serial(), and BuildBitmap().

◆ inherited_area_

std::optional<AreaRenderProperties> yaze::zelda3::OverworldMap::inherited_area_
private

◆ loaded_area_info_

std::array<uint8_t, 8> yaze::zelda3::OverworldMap::loaded_area_info_ {}
private

Definition at line 582 of file overworld_map.h.

Referenced by AreaInfoForSave(), and CaptureAreaInfoBaseline().

◆ raw_area_info_

std::array<uint8_t, 8> yaze::zelda3::OverworldMap::raw_area_info_ {}
private

Definition at line 583 of file overworld_map.h.

Referenced by AreaInfoForSave(), and CaptureAreaInfoBaseline().

◆ loaded_area_info_parent_

int yaze::zelda3::OverworldMap::loaded_area_info_parent_ = -1
private

Definition at line 584 of file overworld_map.h.

Referenced by AreaInfoForSave(), and CaptureAreaInfoBaseline().

◆ area_info_baseline_valid_

bool yaze::zelda3::OverworldMap::area_info_baseline_valid_ = false
private

Definition at line 585 of file overworld_map.h.

Referenced by AreaInfoForSave(), and CaptureAreaInfoBaseline().

◆ custom_gfx_ids_

std::array<uint8_t, 8> yaze::zelda3::OverworldMap::custom_gfx_ids_ = {}
private

◆ sprite_graphics_

◆ sprite_palette_

std::array<uint8_t, 3> yaze::zelda3::OverworldMap::sprite_palette_
private

◆ area_music_

std::array<uint8_t, 4> yaze::zelda3::OverworldMap::area_music_
private

Definition at line 590 of file overworld_map.h.

Referenced by area_music(), LoadAreaInfo(), and mutable_area_music().

◆ static_graphics_

std::array<uint8_t, 16> yaze::zelda3::OverworldMap::static_graphics_
private

◆ mosaic_expanded_

std::array<bool, 4> yaze::zelda3::OverworldMap::mosaic_expanded_
private

◆ overlay_id_

uint16_t yaze::zelda3::OverworldMap::overlay_id_ = 0
private

Definition at line 596 of file overworld_map.h.

Referenced by LoadOverlay(), LoadVanillaOverlayData(), and overlay_id().

◆ has_overlay_

bool yaze::zelda3::OverworldMap::has_overlay_ = false
private

Definition at line 597 of file overworld_map.h.

Referenced by has_overlay(), LoadOverlay(), and LoadVanillaOverlayData().

◆ overlay_data_

std::vector<uint8_t> yaze::zelda3::OverworldMap::overlay_data_
private

Definition at line 598 of file overworld_map.h.

Referenced by LoadOverlay(), LoadVanillaOverlayData(), and overlay_data().

◆ current_blockset_

std::vector<uint8_t> yaze::zelda3::OverworldMap::current_blockset_
private

◆ current_gfx_

std::vector<uint8_t> yaze::zelda3::OverworldMap::current_gfx_
private

◆ bitmap_data_

std::vector<uint8_t> yaze::zelda3::OverworldMap::bitmap_data_
private

Definition at line 602 of file overworld_map.h.

Referenced by bitmap_data(), BuildBitmap(), BuildSubscreenOverlayLayer(), and Destroy().

◆ map_tiles_

OverworldMapTiles yaze::zelda3::OverworldMap::map_tiles_
private

Definition at line 604 of file overworld_map.h.

Referenced by Destroy().

◆ current_palette_

gfx::SnesPalette yaze::zelda3::OverworldMap::current_palette_
private

Definition at line 605 of file overworld_map.h.

Referenced by current_palette(), LoadPalette(), and mutable_current_palette().

◆ palette_addresses_

PaletteAddressMap yaze::zelda3::OverworldMap::palette_addresses_ {}
private

◆ graphics_sheet_overrides_

std::map<uint16_t, std::vector<uint8_t> > yaze::zelda3::OverworldMap::graphics_sheet_overrides_
private

◆ graphics_preview_

AreaGraphicsPreview yaze::zelda3::OverworldMap::graphics_preview_
private

◆ kNumSourceSheets

constexpr int yaze::zelda3::OverworldMap::kNumSourceSheets = 17
staticconstexprprivate

Definition at line 611 of file overworld_map.h.

Referenced by RecordSourceSheetRevisions(), and SourceSheetsChanged().

◆ source_sheet_revisions_

std::array<uint64_t, kNumSourceSheets> yaze::zelda3::OverworldMap::source_sheet_revisions_ {}
private

Definition at line 612 of file overworld_map.h.

Referenced by RecordSourceSheetRevisions(), and SourceSheetsChanged().

◆ source_assignments_recorded_

bool yaze::zelda3::OverworldMap::source_assignments_recorded_ = false
private

Definition at line 613 of file overworld_map.h.

Referenced by RecordSourceSheetRevisions(), and SourceSheetsChanged().


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