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

Inventory manages the inventory screen graphics and layout. More...

#include <inventory.h>

Collaboration diagram for yaze::zelda3::Inventory:

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::TileInfotiles_
 
std::vector< ItemIconitem_icons_
 
GameDatagame_data_ = nullptr
 

Detailed Description

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.

Member Function Documentation

◆ Create()

absl::Status yaze::zelda3::Inventory::Create ( Rom * rom,
GameData * game_data = nullptr )

Initialize and load inventory screen data from ROM.

Parameters
romROM instance to read data from
game_dataGameData 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().

◆ ResetForReload()

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

Here is the call graph for this function:

◆ bitmap()

auto & yaze::zelda3::Inventory::bitmap ( )
inline

Definition at line 48 of file inventory.h.

References bitmap_.

◆ tilesheet()

auto & yaze::zelda3::Inventory::tilesheet ( )
inline

Definition at line 49 of file inventory.h.

References tilesheets_bmp_.

◆ palette()

auto & yaze::zelda3::Inventory::palette ( )
inline

Definition at line 50 of file inventory.h.

References palette_.

◆ item_icons()

auto & yaze::zelda3::Inventory::item_icons ( )
inline

Definition at line 51 of file inventory.h.

References item_icons_.

◆ BuildTileset()

absl::Status yaze::zelda3::Inventory::BuildTileset ( Rom * rom)
private

◆ LoadItemIcons()

absl::Status yaze::zelda3::Inventory::LoadItemIcons ( Rom * rom)
private

Load individual item icons from ROM.

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

Here is the call graph for this function:

Member Data Documentation

◆ data_

std::vector<uint8_t> yaze::zelda3::Inventory::data_
private

Definition at line 66 of file inventory.h.

Referenced by Create(), and ResetForReload().

◆ bitmap_

gfx::Bitmap yaze::zelda3::Inventory::bitmap_
private

Definition at line 67 of file inventory.h.

Referenced by bitmap(), and Create().

◆ tilesheets_

std::vector<uint8_t> yaze::zelda3::Inventory::tilesheets_
private

Definition at line 69 of file inventory.h.

Referenced by BuildTileset(), and ResetForReload().

◆ test_

std::vector<uint8_t> yaze::zelda3::Inventory::test_
private

Definition at line 70 of file inventory.h.

Referenced by BuildTileset(), and ResetForReload().

◆ tilesheets_bmp_

gfx::Bitmap yaze::zelda3::Inventory::tilesheets_bmp_
private

Definition at line 71 of file inventory.h.

Referenced by BuildTileset(), and tilesheet().

◆ palette_

gfx::SnesPalette yaze::zelda3::Inventory::palette_
private

Definition at line 72 of file inventory.h.

Referenced by BuildTileset(), Create(), palette(), and ResetForReload().

◆ canvas_

gui::Canvas yaze::zelda3::Inventory::canvas_
private

Definition at line 74 of file inventory.h.

Referenced by ResetForReload().

◆ tiles_

std::vector<gfx::TileInfo> yaze::zelda3::Inventory::tiles_
private

Definition at line 75 of file inventory.h.

Referenced by ResetForReload().

◆ item_icons_

std::vector<ItemIcon> yaze::zelda3::Inventory::item_icons_
private

Definition at line 76 of file inventory.h.

Referenced by item_icons(), LoadItemIcons(), and ResetForReload().

◆ game_data_

GameData* yaze::zelda3::Inventory::game_data_ = nullptr
private

Definition at line 77 of file inventory.h.

Referenced by BuildTileset(), Create(), and ResetForReload().


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