Represents a single Overworld map screen. More...
#include <overworld_map.h>
Public Member Functions | |
OverworldMap ()=default | |
OverworldMap (int index, Rom &rom) | |
absl::Status | BuildMap (int count, int game_state, int world, std::vector< gfx::Tile16 > &tiles16, OverworldBlockset &world_blockset) |
void | LoadAreaGraphics () |
absl::Status | LoadPalette () |
absl::Status | BuildTileset () |
absl::Status | BuildTiles16Gfx (std::vector< gfx::Tile16 > &tiles16, int count) |
absl::Status | BuildBitmap (OverworldBlockset &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_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_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::SnesPalette > | GetPalette (const gfx::PaletteGroup &group, int index, int previous_index, int limit) |
Private Attributes | |
Rom | rom_ |
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 |
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::vector< uint8_t > | all_gfx_ |
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_ |
Additional Inherited Members | |
Static Protected Attributes inherited from yaze::gfx::GfxContext | |
static std::unordered_map< uint8_t, gfx::Paletteset > | palettesets_ |
Represents a single Overworld map screen.
Definition at line 77 of file overworld_map.h.
|
default |
yaze::zelda3::OverworldMap::OverworldMap | ( | int | index, |
Rom & | rom ) |
Definition at line 18 of file overworld_map.cc.
References yaze::core::FeatureFlags::get(), index_, LoadAreaInfo(), LoadCustomOverworldData(), yaze::zelda3::OverworldCustomASMHasBeenApplied, parent_, rom_, and SetupCustomTileset().
absl::Status yaze::zelda3::OverworldMap::BuildMap | ( | int | count, |
int | game_state, | ||
int | world, | ||
std::vector< gfx::Tile16 > & | tiles16, | ||
OverworldBlockset & | world_blockset ) |
Definition at line 34 of file overworld_map.cc.
References area_graphics_, area_palette_, BuildBitmap(), BuildTiles16Gfx(), BuildTileset(), built_, game_state_, index_, initialized_, yaze::zelda3::kAreaGfxIdPtr, yaze::zelda3::kOverworldMapPaletteIds, yaze::zelda3::kOverworldSpecialGfxGroup, yaze::zelda3::kOverworldSpecialPalGroup, yaze::zelda3::kSpecialWorldMapIdStart, large_map_, LoadAreaGraphics(), LoadPalette(), parent_, RETURN_IF_ERROR, rom_, and world_.
void yaze::zelda3::OverworldMap::LoadAreaGraphics | ( | ) |
Definition at line 451 of file overworld_map.cc.
References LoadAreaGraphicsBlocksets(), LoadDeathMountainGFX(), LoadMainBlocksetId(), LoadMainBlocksets(), and LoadSpritesBlocksets().
Referenced by BuildMap().
absl::Status yaze::zelda3::OverworldMap::LoadPalette | ( | ) |
Definition at line 593 of file overworld_map.cc.
References area_palette_, ASSIGN_OR_RETURN, current_palette_, game_state_, GetPalette(), index_, yaze::zelda3::kDarkWorldMapIdStart, yaze::zelda3::kNumOverworldMaps, yaze::zelda3::kOverworldMapPaletteIds, yaze::zelda3::kOverworldSpritePaletteGroup, yaze::zelda3::kOverworldSpritePaletteIds, yaze::zelda3::kSpecialWorldMapIdStart, main(), yaze::gfx::GfxContext::palettesets_, parent_, RETURN_IF_ERROR, rom_, yaze::zelda3::palette_internal::SetColorsPalette(), and sprite_palette_.
Referenced by BuildMap().
absl::Status yaze::zelda3::OverworldMap::BuildTileset | ( | ) |
Definition at line 690 of file overworld_map.cc.
References all_gfx_, current_gfx_, ProcessGraphicsBuffer(), rom_, and static_graphics_.
Referenced by BuildMap().
absl::Status yaze::zelda3::OverworldMap::BuildTiles16Gfx | ( | std::vector< gfx::Tile16 > & | tiles16, |
int | count ) |
Definition at line 701 of file overworld_map.cc.
References current_blockset_, current_gfx_, yaze::gfx::TileInfo::horizontal_mirror_, yaze::gfx::TileInfo::id_, yaze::gfx::TileInfo::palette_, and yaze::gfx::TileInfo::vertical_mirror_.
Referenced by BuildMap().
absl::Status yaze::zelda3::OverworldMap::BuildBitmap | ( | OverworldBlockset & | world_blockset | ) |
Definition at line 747 of file overworld_map.cc.
References bitmap_data_, yaze::gfx::CopyTile8bpp16(), current_blockset_, index_, and world_.
Referenced by BuildMap().
void yaze::zelda3::OverworldMap::DrawAnimatedTiles | ( | ) |
Definition at line 410 of file overworld_map.cc.
References yaze::util::HexByte(), and static_graphics_.
|
inline |
Definition at line 94 of file overworld_map.h.
References current_blockset_.
|
inline |
Definition at line 95 of file overworld_map.h.
References current_gfx_.
|
inline |
Definition at line 96 of file overworld_map.h.
References current_palette_.
|
inline |
Definition at line 97 of file overworld_map.h.
References bitmap_data_.
|
inline |
Definition at line 98 of file overworld_map.h.
References large_map_.
|
inline |
Definition at line 99 of file overworld_map.h.
References initialized_.
|
inline |
Definition at line 100 of file overworld_map.h.
References parent_.
|
inline |
Definition at line 101 of file overworld_map.h.
References mosaic_.
|
inline |
Definition at line 102 of file overworld_map.h.
References current_palette_.
|
inline |
Definition at line 104 of file overworld_map.h.
References area_graphics_.
|
inline |
Definition at line 105 of file overworld_map.h.
References area_palette_.
|
inline |
Definition at line 106 of file overworld_map.h.
References sprite_graphics_.
|
inline |
Definition at line 107 of file overworld_map.h.
References sprite_palette_.
|
inline |
Definition at line 108 of file overworld_map.h.
References message_id_.
Referenced by LoadAreaInfo().
|
inline |
Definition at line 109 of file overworld_map.h.
References area_music_.
|
inline |
Definition at line 110 of file overworld_map.h.
References static_graphics_.
|
inline |
Definition at line 111 of file overworld_map.h.
References large_index_.
|
inline |
Definition at line 113 of file overworld_map.h.
References current_gfx_.
|
inline |
Definition at line 114 of file overworld_map.h.
References area_graphics_.
|
inline |
Definition at line 115 of file overworld_map.h.
References area_palette_.
|
inline |
Definition at line 116 of file overworld_map.h.
References sprite_graphics_.
|
inline |
Definition at line 117 of file overworld_map.h.
References sprite_palette_.
|
inline |
Definition at line 118 of file overworld_map.h.
References message_id_.
|
inline |
Definition at line 119 of file overworld_map.h.
References area_music_.
|
inline |
Definition at line 120 of file overworld_map.h.
References static_graphics_.
|
inline |
Definition at line 122 of file overworld_map.h.
References area_graphics_.
|
inline |
Definition at line 123 of file overworld_map.h.
References area_palette_.
|
inline |
Definition at line 124 of file overworld_map.h.
References sprite_graphics_.
|
inline |
Definition at line 127 of file overworld_map.h.
References sprite_palette_.
|
inline |
Definition at line 128 of file overworld_map.h.
References message_id_.
|
inline |
Definition at line 130 of file overworld_map.h.
References custom_gfx_ids_.
|
inline |
Definition at line 132 of file overworld_map.h.
References large_index_, large_map_, and parent_.
|
inline |
Definition at line 138 of file overworld_map.h.
References index_, large_index_, large_map_, and parent_.
|
inline |
Definition at line 147 of file overworld_map.h.
References bitmap_data_, current_blockset_, and current_gfx_.
|
private |
Definition at line 67 of file overworld_map.cc.
References area_graphics_, area_music_, area_palette_, index_, yaze::zelda3::kAreaGfxIdPtr, yaze::zelda3::kDarkWorldMapIdStart, yaze::zelda3::kOverworldMapPaletteIds, yaze::zelda3::kOverworldMapSize, yaze::zelda3::kOverworldMessageIds, yaze::zelda3::kOverworldMusicAgahnim, yaze::zelda3::kOverworldMusicBeginning, yaze::zelda3::kOverworldMusicDarkWorld, yaze::zelda3::kOverworldMusicMasterSword, yaze::zelda3::kOverworldMusicZelda, yaze::zelda3::kOverworldSpecialGfxGroup, yaze::zelda3::kOverworldSpecialPalGroup, yaze::zelda3::kOverworldSpritePaletteIds, yaze::zelda3::kOverworldSpriteset, yaze::zelda3::kSpecialWorldMapIdStart, large_map_, message_id(), message_id_, parent_, rom_, sprite_graphics_, and sprite_palette_.
Referenced by OverworldMap().
|
private |
Definition at line 180 of file overworld_map.cc.
References animated_gfx_, area_graphics_, area_palette_, custom_gfx_ids_, index_, yaze::zelda3::kDarkWorldMapIdStart, yaze::zelda3::kSpecialWorldMapIdStart, mosaic_, parent_, rom_, and subscreen_overlay_.
Referenced by OverworldMap().
|
private |
Definition at line 292 of file overworld_map.cc.
References animated_gfx_, area_graphics_, area_palette_, custom_gfx_ids_, index_, yaze::zelda3::kDarkWorldMapIdStart, yaze::zelda3::kSpecialWorldMapIdStart, mosaic_, yaze::zelda3::OverworldCustomAnimatedGFXArray, yaze::zelda3::OverworldCustomMainPaletteArray, yaze::zelda3::OverworldCustomMosaicArray, yaze::zelda3::OverworldCustomSubscreenOverlayArray, yaze::zelda3::OverworldCustomTileGFXGroupArray, parent_, rom_, and subscreen_overlay_.
Referenced by OverworldMap().
|
private |
Definition at line 371 of file overworld_map.cc.
References yaze::zelda3::kDarkWorldMapIdStart, yaze::zelda3::kSpecialWorldMapIdStart, main_gfx_id_, and parent_.
Referenced by LoadAreaGraphics().
|
private |
Definition at line 382 of file overworld_map.cc.
References game_state_, rom_, sprite_graphics_, and static_graphics_.
Referenced by LoadAreaGraphics().
|
private |
Definition at line 397 of file overworld_map.cc.
References main_gfx_id_, rom_, and static_graphics_.
Referenced by LoadAreaGraphics().
|
private |
Definition at line 427 of file overworld_map.cc.
References area_graphics_, rom_, and static_graphics_.
Referenced by LoadAreaGraphics().
|
private |
Definition at line 442 of file overworld_map.cc.
References parent_, and static_graphics_.
Referenced by LoadAreaGraphics().
|
private |
Definition at line 674 of file overworld_map.cc.
References all_gfx_, and current_gfx_.
Referenced by BuildTileset().
|
private |
|
private |
Definition at line 169 of file overworld_map.h.
Referenced by BuildMap(), BuildTileset(), GetPalette(), LoadAreaGraphicsBlocksets(), LoadAreaInfo(), LoadCustomOverworldData(), LoadMainBlocksets(), LoadPalette(), LoadSpritesBlocksets(), OverworldMap(), and SetupCustomTileset().
|
private |
Definition at line 171 of file overworld_map.h.
Referenced by BuildMap().
|
private |
Definition at line 172 of file overworld_map.h.
Referenced by BuildMap(), is_large_map(), LoadAreaInfo(), SetAsLargeMap(), and SetAsSmallMap().
|
private |
Definition at line 173 of file overworld_map.h.
Referenced by BuildMap(), and is_initialized().
|
private |
Definition at line 174 of file overworld_map.h.
Referenced by LoadCustomOverworldData(), mutable_mosaic(), and SetupCustomTileset().
|
private |
Definition at line 176 of file overworld_map.h.
Referenced by BuildBitmap(), BuildMap(), LoadAreaInfo(), LoadCustomOverworldData(), LoadPalette(), OverworldMap(), SetAsSmallMap(), and SetupCustomTileset().
|
private |
Definition at line 177 of file overworld_map.h.
Referenced by BuildMap(), LoadAreaInfo(), LoadCustomOverworldData(), LoadDeathMountainGFX(), LoadMainBlocksetId(), LoadPalette(), OverworldMap(), parent(), SetAsLargeMap(), SetAsSmallMap(), and SetupCustomTileset().
|
private |
Definition at line 178 of file overworld_map.h.
Referenced by large_index(), SetAsLargeMap(), and SetAsSmallMap().
|
private |
Definition at line 179 of file overworld_map.h.
Referenced by BuildBitmap(), and BuildMap().
|
private |
Definition at line 180 of file overworld_map.h.
Referenced by BuildMap(), LoadPalette(), and LoadSpritesBlocksets().
|
private |
Definition at line 181 of file overworld_map.h.
Referenced by LoadMainBlocksetId(), and LoadMainBlocksets().
|
private |
Definition at line 183 of file overworld_map.h.
Referenced by LoadAreaInfo(), message_id(), mutable_message_id(), and set_message_id().
|
private |
Definition at line 184 of file overworld_map.h.
Referenced by area_graphics(), BuildMap(), LoadAreaGraphicsBlocksets(), LoadAreaInfo(), LoadCustomOverworldData(), mutable_area_graphics(), set_area_graphics(), and SetupCustomTileset().
|
private |
Definition at line 185 of file overworld_map.h.
Referenced by area_palette(), BuildMap(), LoadAreaInfo(), LoadCustomOverworldData(), LoadPalette(), mutable_area_palette(), set_area_palette(), and SetupCustomTileset().
|
private |
Definition at line 186 of file overworld_map.h.
Referenced by LoadCustomOverworldData(), and SetupCustomTileset().
|
private |
Definition at line 187 of file overworld_map.h.
Referenced by LoadCustomOverworldData(), and SetupCustomTileset().
|
private |
Definition at line 189 of file overworld_map.h.
Referenced by LoadCustomOverworldData(), mutable_custom_tileset(), and SetupCustomTileset().
|
private |
Definition at line 190 of file overworld_map.h.
Referenced by LoadAreaInfo(), LoadSpritesBlocksets(), mutable_sprite_graphics(), set_sprite_graphics(), and sprite_graphics().
|
private |
Definition at line 191 of file overworld_map.h.
Referenced by LoadAreaInfo(), LoadPalette(), mutable_sprite_palette(), set_sprite_palette(), and sprite_palette().
|
private |
Definition at line 192 of file overworld_map.h.
Referenced by area_music(), LoadAreaInfo(), and mutable_area_music().
|
private |
Definition at line 193 of file overworld_map.h.
Referenced by BuildTileset(), DrawAnimatedTiles(), LoadAreaGraphicsBlocksets(), LoadDeathMountainGFX(), LoadMainBlocksets(), LoadSpritesBlocksets(), mutable_static_graphics(), and static_graphics().
|
private |
Definition at line 195 of file overworld_map.h.
Referenced by BuildTileset(), and ProcessGraphicsBuffer().
|
private |
Definition at line 196 of file overworld_map.h.
Referenced by BuildBitmap(), BuildTiles16Gfx(), current_tile16_blockset(), and Destroy().
|
private |
Definition at line 197 of file overworld_map.h.
Referenced by BuildTiles16Gfx(), BuildTileset(), current_graphics(), Destroy(), mutable_current_graphics(), and ProcessGraphicsBuffer().
|
private |
Definition at line 198 of file overworld_map.h.
Referenced by bitmap_data(), BuildBitmap(), and Destroy().
|
private |
Definition at line 200 of file overworld_map.h.
|
private |
Definition at line 201 of file overworld_map.h.
Referenced by current_palette(), LoadPalette(), and mutable_current_palette().