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

Represents a single Overworld map screen. More...

#include <overworld_map.h>

Inheritance diagram for yaze::app::zelda3::overworld::OverworldMap:
Collaboration diagram for yaze::app::zelda3::overworld::OverworldMap:

Public Member Functions

 OverworldMap ()=default
 
 OverworldMap (int index, Rom &rom, bool load_custom_data=false)
 
absl::Status BuildMap (int count, int game_state, int world, std::vector< gfx::Tile16 > &tiles16, OWBlockset &world_blockset)
 
void LoadAreaGraphics ()
 
absl::Status LoadPalette ()
 
absl::Status BuildTileset ()
 
absl::Status BuildTiles16Gfx (std::vector< gfx::Tile16 > &tiles16, int count)
 
absl::Status BuildBitmap (OWBlockset &world_blockset)
 
void DrawAnimatedTiles ()
 
auto current_tile16_blockset () const
 
auto current_graphics () const
 
auto current_palette () const
 
auto bitmap_data () const
 
auto is_large_map () const
 
auto is_initialized () const
 
auto parent () const
 
auto mutable_mosaic ()
 
auto mutable_current_palette ()
 
auto area_graphics () 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 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_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 Destroy ()
 

Private Member Functions

void LoadAreaInfo ()
 
void LoadCustomOverworldData ()
 
void SetupCustomTileset (uint8_t asm_version)
 
void LoadMainBlocksetId ()
 
void LoadSpritesBlocksets ()
 
void LoadMainBlocksets ()
 
void LoadAreaGraphicsBlocksets ()
 
void LoadDeathMountainGFX ()
 
void ProcessGraphicsBuffer (int index, int static_graphics_offset, int size)
 
absl::StatusOr< gfx::SnesPaletteGetPalette (const gfx::PaletteGroup &group, int index, int previous_index, int limit)
 

Private Attributes

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
 
uint16_t message_id_ = 0
 
uint8_t area_graphics_ = 0
 
uint8_t area_palette_ = 0
 
uint8_t animated_gfx_ = 0
 
uint16_t subscreen_overlay_ = 0
 
uint8_t custom_gfx_ids_ [8]
 
uchar sprite_graphics_ [3]
 
uchar sprite_palette_ [3]
 
uchar area_music_ [4]
 
uchar static_graphics_ [16]
 
Rom rom_
 
std::vector< uint8_t > all_gfx_
 
std::vector< uint8_t > current_blockset_
 
std::vector< uint8_t > current_gfx_
 
std::vector< uint8_t > bitmap_data_
 
OWMapTiles map_tiles_
 
gfx::SnesPalette current_palette_
 

Additional Inherited Members

- Static Protected Attributes inherited from yaze::app::GfxContext
static std::unordered_map< uint8_t, gfx::Palettesetpalettesets_
 

Detailed Description

Represents a single Overworld map screen.

Definition at line 62 of file overworld_map.h.

Constructor & Destructor Documentation

◆ OverworldMap() [1/2]

yaze::app::zelda3::overworld::OverworldMap::OverworldMap ( )
default

◆ OverworldMap() [2/2]

yaze::app::zelda3::overworld::OverworldMap::OverworldMap ( int index,
Rom & rom,
bool load_custom_data = false )

Definition at line 17 of file overworld_map.cc.

References LoadAreaInfo(), LoadCustomOverworldData(), yaze::app::zelda3::overworld::OverworldCustomASMHasBeenApplied, rom_, and SetupCustomTileset().

Here is the call graph for this function:

Member Function Documentation

◆ BuildMap()

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

◆ LoadAreaGraphics()

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

Definition at line 422 of file overworld_map.cc.

References LoadAreaGraphicsBlocksets(), LoadDeathMountainGFX(), LoadMainBlocksetId(), LoadMainBlocksets(), and LoadSpritesBlocksets().

Referenced by BuildMap().

Here is the call graph for this function:

◆ LoadPalette()

◆ BuildTileset()

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

Definition at line 666 of file overworld_map.cc.

References all_gfx_, current_gfx_, yaze::app::Rom::graphics_buffer(), ProcessGraphicsBuffer(), rom_, and static_graphics_.

Referenced by BuildMap().

Here is the call graph for this function:

◆ BuildTiles16Gfx()

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

◆ BuildBitmap()

absl::Status yaze::app::zelda3::overworld::OverworldMap::BuildBitmap ( OWBlockset & world_blockset)

Definition at line 723 of file overworld_map.cc.

References bitmap_data_, yaze::app::gfx::CopyTile8bpp16(), current_blockset_, index_, and world_.

Referenced by BuildMap().

Here is the call graph for this function:

◆ DrawAnimatedTiles()

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

Definition at line 381 of file overworld_map.cc.

References static_graphics_, and yaze::app::core::UppercaseHexByte().

Here is the call graph for this function:

◆ current_tile16_blockset()

auto yaze::app::zelda3::overworld::OverworldMap::current_tile16_blockset ( ) const
inline

Definition at line 79 of file overworld_map.h.

References current_blockset_.

◆ current_graphics()

auto yaze::app::zelda3::overworld::OverworldMap::current_graphics ( ) const
inline

Definition at line 80 of file overworld_map.h.

References current_gfx_.

◆ current_palette()

auto yaze::app::zelda3::overworld::OverworldMap::current_palette ( ) const
inline

Definition at line 81 of file overworld_map.h.

References current_palette_.

◆ bitmap_data()

auto yaze::app::zelda3::overworld::OverworldMap::bitmap_data ( ) const
inline

Definition at line 82 of file overworld_map.h.

References bitmap_data_.

◆ is_large_map()

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

Definition at line 83 of file overworld_map.h.

References large_map_.

◆ is_initialized()

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

Definition at line 84 of file overworld_map.h.

References initialized_.

◆ parent()

auto yaze::app::zelda3::overworld::OverworldMap::parent ( ) const
inline

Definition at line 85 of file overworld_map.h.

References parent_.

◆ mutable_mosaic()

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

Definition at line 86 of file overworld_map.h.

References mosaic_.

◆ mutable_current_palette()

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

Definition at line 87 of file overworld_map.h.

References current_palette_.

◆ area_graphics()

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

Definition at line 89 of file overworld_map.h.

References area_graphics_.

◆ area_palette()

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

Definition at line 90 of file overworld_map.h.

References area_palette_.

◆ sprite_graphics()

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

Definition at line 91 of file overworld_map.h.

References sprite_graphics_.

◆ sprite_palette()

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

Definition at line 92 of file overworld_map.h.

References sprite_palette_.

◆ message_id()

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

Definition at line 93 of file overworld_map.h.

References message_id_.

◆ area_music()

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

Definition at line 94 of file overworld_map.h.

References area_music_.

◆ static_graphics()

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

Definition at line 95 of file overworld_map.h.

References static_graphics_.

◆ large_index()

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

Definition at line 96 of file overworld_map.h.

References large_index_.

◆ mutable_area_graphics()

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

Definition at line 98 of file overworld_map.h.

References area_graphics_.

◆ mutable_area_palette()

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

Definition at line 99 of file overworld_map.h.

References area_palette_.

◆ mutable_sprite_graphics()

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

Definition at line 100 of file overworld_map.h.

References sprite_graphics_.

◆ mutable_sprite_palette()

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

Definition at line 101 of file overworld_map.h.

References sprite_palette_.

◆ mutable_message_id()

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

Definition at line 102 of file overworld_map.h.

References message_id_.

◆ mutable_area_music()

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

Definition at line 103 of file overworld_map.h.

References area_music_.

◆ mutable_static_graphics()

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

Definition at line 104 of file overworld_map.h.

References static_graphics_.

◆ set_area_graphics()

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

Definition at line 106 of file overworld_map.h.

References area_graphics_.

◆ set_area_palette()

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

Definition at line 107 of file overworld_map.h.

References area_palette_.

◆ set_sprite_graphics()

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

Definition at line 108 of file overworld_map.h.

References sprite_graphics_.

◆ set_sprite_palette()

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

Definition at line 111 of file overworld_map.h.

References sprite_palette_.

◆ set_message_id()

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

Definition at line 112 of file overworld_map.h.

References message_id_.

◆ mutable_custom_tileset()

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

Definition at line 114 of file overworld_map.h.

References custom_gfx_ids_.

◆ SetAsLargeMap()

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

Definition at line 116 of file overworld_map.h.

References large_index_, large_map_, and parent_.

◆ SetAsSmallMap()

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

Definition at line 122 of file overworld_map.h.

References index_, large_index_, large_map_, and parent_.

◆ Destroy()

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

Definition at line 131 of file overworld_map.h.

References bitmap_data_, current_blockset_, and current_gfx_.

◆ LoadAreaInfo()

◆ LoadCustomOverworldData()

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

◆ SetupCustomTileset()

◆ LoadMainBlocksetId()

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

Definition at line 343 of file overworld_map.cc.

References main_gfx_id_, and parent_.

Referenced by LoadAreaGraphics().

◆ LoadSpritesBlocksets()

void yaze::app::zelda3::overworld::OverworldMap::LoadSpritesBlocksets ( )
private

Definition at line 353 of file overworld_map.cc.

References game_state_, rom_, sprite_graphics_, static_graphics_, and yaze::app::Rom::version_constants().

Referenced by LoadAreaGraphics().

Here is the call graph for this function:

◆ LoadMainBlocksets()

void yaze::app::zelda3::overworld::OverworldMap::LoadMainBlocksets ( )
private

Definition at line 368 of file overworld_map.cc.

References yaze::app::VersionConstants::kOverworldGfxGroups2, main_gfx_id_, rom_, static_graphics_, and yaze::app::Rom::version_constants().

Referenced by LoadAreaGraphics().

Here is the call graph for this function:

◆ LoadAreaGraphicsBlocksets()

void yaze::app::zelda3::overworld::OverworldMap::LoadAreaGraphicsBlocksets ( )
private

Definition at line 398 of file overworld_map.cc.

References area_graphics_, yaze::app::VersionConstants::kOverworldGfxGroups1, rom_, static_graphics_, and yaze::app::Rom::version_constants().

Referenced by LoadAreaGraphics().

Here is the call graph for this function:

◆ LoadDeathMountainGFX()

void yaze::app::zelda3::overworld::OverworldMap::LoadDeathMountainGFX ( )
private
Todo
Change the conditions for death mountain gfx

Definition at line 413 of file overworld_map.cc.

References parent_, and static_graphics_.

Referenced by LoadAreaGraphics().

◆ ProcessGraphicsBuffer()

void yaze::app::zelda3::overworld::OverworldMap::ProcessGraphicsBuffer ( int index,
int static_graphics_offset,
int size )
private

Definition at line 650 of file overworld_map.cc.

References all_gfx_, and current_gfx_.

Referenced by BuildTileset().

◆ GetPalette()

absl::StatusOr< gfx::SnesPalette > yaze::app::zelda3::overworld::OverworldMap::GetPalette ( const gfx::PaletteGroup & group,
int index,
int previous_index,
int limit )
private

Definition at line 556 of file overworld_map.cc.

References yaze::app::VersionConstants::overworldMapPaletteGroup, rom_, and yaze::app::Rom::version_constants().

Referenced by LoadPalette().

Here is the call graph for this function:

Member Data Documentation

◆ built_

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

Definition at line 153 of file overworld_map.h.

Referenced by BuildMap().

◆ large_map_

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

Definition at line 154 of file overworld_map.h.

Referenced by BuildMap(), is_large_map(), LoadAreaInfo(), SetAsLargeMap(), and SetAsSmallMap().

◆ initialized_

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

Definition at line 155 of file overworld_map.h.

Referenced by BuildMap(), and is_initialized().

◆ mosaic_

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

Definition at line 157 of file overworld_map.h.

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

◆ index_

int yaze::app::zelda3::overworld::OverworldMap::index_ = 0
private

◆ parent_

int yaze::app::zelda3::overworld::OverworldMap::parent_ = 0
private

◆ large_index_

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

Definition at line 161 of file overworld_map.h.

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

◆ world_

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

Definition at line 162 of file overworld_map.h.

Referenced by BuildBitmap(), and BuildMap().

◆ game_state_

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

Definition at line 163 of file overworld_map.h.

Referenced by BuildMap(), LoadPalette(), and LoadSpritesBlocksets().

◆ main_gfx_id_

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

Definition at line 164 of file overworld_map.h.

Referenced by LoadMainBlocksetId(), and LoadMainBlocksets().

◆ message_id_

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

Definition at line 166 of file overworld_map.h.

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

◆ area_graphics_

uint8_t yaze::app::zelda3::overworld::OverworldMap::area_graphics_ = 0
private

◆ area_palette_

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

◆ animated_gfx_

uint8_t yaze::app::zelda3::overworld::OverworldMap::animated_gfx_ = 0
private

Definition at line 169 of file overworld_map.h.

Referenced by LoadCustomOverworldData(), and SetupCustomTileset().

◆ subscreen_overlay_

uint16_t yaze::app::zelda3::overworld::OverworldMap::subscreen_overlay_ = 0
private

Definition at line 170 of file overworld_map.h.

Referenced by LoadCustomOverworldData(), and SetupCustomTileset().

◆ custom_gfx_ids_

uint8_t yaze::app::zelda3::overworld::OverworldMap::custom_gfx_ids_[8]
private

◆ sprite_graphics_

uchar yaze::app::zelda3::overworld::OverworldMap::sprite_graphics_[3]
private

◆ sprite_palette_

uchar yaze::app::zelda3::overworld::OverworldMap::sprite_palette_[3]
private

◆ area_music_

uchar yaze::app::zelda3::overworld::OverworldMap::area_music_[4]
private

Definition at line 175 of file overworld_map.h.

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

◆ static_graphics_

uchar yaze::app::zelda3::overworld::OverworldMap::static_graphics_[16]
private

◆ rom_

◆ all_gfx_

std::vector<uint8_t> yaze::app::zelda3::overworld::OverworldMap::all_gfx_
private

Definition at line 179 of file overworld_map.h.

Referenced by BuildTileset(), and ProcessGraphicsBuffer().

◆ current_blockset_

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

Definition at line 180 of file overworld_map.h.

Referenced by BuildBitmap(), BuildTiles16Gfx(), current_tile16_blockset(), and Destroy().

◆ current_gfx_

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

◆ bitmap_data_

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

Definition at line 182 of file overworld_map.h.

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

◆ map_tiles_

OWMapTiles yaze::app::zelda3::overworld::OverworldMap::map_tiles_
private

Definition at line 183 of file overworld_map.h.

◆ current_palette_

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

Definition at line 185 of file overworld_map.h.

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


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