Inventory manages the inventory screen graphics and layout. More...
#include <inventory.h>

Public Member Functions | |
| absl::Status | Create (Rom *rom, GameData *game_data=nullptr) |
| Initialize and load inventory screen data from ROM. | |
| void | ResetForReload () |
| auto & | bitmap () |
| auto & | tilesheet () |
| auto & | palette () |
| auto & | item_icons () |
Private Member Functions | |
| absl::Status | BuildTileset (Rom *rom) |
| Build the tileset from 2BPP graphics. | |
| absl::Status | LoadItemIcons (Rom *rom) |
| Load individual item icons from ROM. | |
Private Attributes | |
| std::vector< uint8_t > | data_ |
| gfx::Bitmap | bitmap_ |
| std::vector< uint8_t > | tilesheets_ |
| std::vector< uint8_t > | test_ |
| gfx::Bitmap | tilesheets_bmp_ |
| gfx::SnesPalette | palette_ |
| gui::Canvas | canvas_ |
| std::vector< gfx::TileInfo > | tiles_ |
| std::vector< ItemIcon > | item_icons_ |
| GameData * | game_data_ = nullptr |
Inventory manages the inventory screen graphics and layout.
The inventory screen consists of a 256x256 bitmap displaying equipment, items, and UI elements using 2BPP graphics and HUD palette.
Definition at line 36 of file inventory.h.
Initialize and load inventory screen data from ROM.
| rom | ROM instance to read data from |
| game_data | GameData instance for palette access |
Definition at line 14 of file inventory.cc.
References bitmap_, BuildTileset(), yaze::gfx::Bitmap::Create(), yaze::gfx::Arena::CREATE, data_, game_data_, yaze::gfx::Arena::Get(), yaze::Rom::is_loaded(), LoadItemIcons(), palette_, yaze::gfx::Arena::QueueTextureCommand(), ResetForReload(), RETURN_IF_ERROR, and yaze::gfx::Bitmap::SetPalette().
| void yaze::zelda3::Inventory::ResetForReload | ( | ) |
Definition at line 44 of file inventory.cc.
References canvas_, yaze::gfx::SnesPalette::clear(), yaze::gui::Canvas::ClearSelection(), data_, game_data_, item_icons_, palette_, test_, tiles_, and tilesheets_.
Referenced by Create().

|
inline |
Definition at line 48 of file inventory.h.
References bitmap_.
|
inline |
Definition at line 49 of file inventory.h.
References tilesheets_bmp_.
|
inline |
Definition at line 50 of file inventory.h.
References palette_.
|
inline |
Definition at line 51 of file inventory.h.
References item_icons_.
|
private |
Build the tileset from 2BPP graphics.
| rom | ROM instance to read graphics from |
Definition at line 55 of file inventory.cc.
References ASSIGN_OR_RETURN, yaze::gfx::Bitmap::Create(), yaze::gfx::Arena::CREATE, game_data_, yaze::gfx::Arena::Get(), yaze::gfx::PaletteGroupMap::hud, yaze::zelda3::Load2BppGraphics(), palette_, yaze::zelda3::GameData::palette_groups, yaze::gfx::Arena::QueueTextureCommand(), yaze::gfx::Bitmap::SetPalette(), test_, tilesheets_, and tilesheets_bmp_.
Referenced by Create().
|
private |
Load individual item icons from ROM.
| rom | ROM instance to read icon data from |
Definition at line 82 of file inventory.cc.
References ASSIGN_OR_RETURN, item_icons_, yaze::zelda3::kItemIconsPtr, yaze::zelda3::ItemIcon::name, yaze::Rom::ReadWord(), RETURN_IF_ERROR, yaze::SnesToPc(), yaze::zelda3::ItemIcon::tile_bl, yaze::zelda3::ItemIcon::tile_br, yaze::zelda3::ItemIcon::tile_tl, and yaze::zelda3::ItemIcon::tile_tr.
Referenced by Create().

|
private |
Definition at line 66 of file inventory.h.
Referenced by Create(), and ResetForReload().
|
private |
Definition at line 67 of file inventory.h.
|
private |
Definition at line 69 of file inventory.h.
Referenced by BuildTileset(), and ResetForReload().
|
private |
Definition at line 70 of file inventory.h.
Referenced by BuildTileset(), and ResetForReload().
|
private |
Definition at line 71 of file inventory.h.
Referenced by BuildTileset(), and tilesheet().
|
private |
Definition at line 72 of file inventory.h.
Referenced by BuildTileset(), Create(), palette(), and ResetForReload().
|
private |
Definition at line 74 of file inventory.h.
Referenced by ResetForReload().
|
private |
Definition at line 75 of file inventory.h.
Referenced by ResetForReload().
|
private |
Definition at line 76 of file inventory.h.
Referenced by item_icons(), LoadItemIcons(), and ResetForReload().
|
private |
Definition at line 77 of file inventory.h.
Referenced by BuildTileset(), Create(), and ResetForReload().