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

Public Member Functions | |
| absl::Status | Create (Rom *rom) |
| Initialize and load inventory screen data from ROM. | |
| 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_ |
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 35 of file inventory.h.
| absl::Status yaze::zelda3::Inventory::Create | ( | Rom * | rom | ) |
Initialize and load inventory screen data from ROM.
| rom | ROM instance to read data from |
Definition at line 14 of file inventory.cc.
References bitmap_, BuildTileset(), yaze::gfx::Bitmap::Create(), yaze::gfx::Arena::CREATE, data_, yaze::gfx::Arena::Get(), yaze::Rom::is_loaded(), LoadItemIcons(), palette_, yaze::gfx::Arena::QueueTextureCommand(), RETURN_IF_ERROR, and yaze::gfx::Bitmap::SetPalette().
Referenced by yaze::editor::ScreenEditor::DrawInventoryMenuEditor().
|
inline |
Definition at line 43 of file inventory.h.
References bitmap_.
Referenced by yaze::editor::ScreenEditor::DrawInventoryMenuEditor().
|
inline |
Definition at line 44 of file inventory.h.
References tilesheets_bmp_.
Referenced by yaze::editor::ScreenEditor::DrawInventoryMenuEditor().
|
inline |
Definition at line 45 of file inventory.h.
References palette_.
Referenced by yaze::editor::ScreenEditor::DrawInventoryMenuEditor().
|
inline |
Definition at line 46 of file inventory.h.
References item_icons_.
Referenced by yaze::editor::ScreenEditor::DrawInventoryItemIcons().
|
private |
Build the tileset from 2BPP graphics.
| rom | ROM instance to read graphics from |
Definition at line 42 of file inventory.cc.
References ASSIGN_OR_RETURN, yaze::gfx::Bitmap::Create(), yaze::gfx::Arena::CREATE, yaze::gfx::Arena::Get(), yaze::Load2BppGraphics(), palette_, yaze::Rom::palette_group(), 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 65 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 61 of file inventory.h.
Referenced by Create().
|
private |
Definition at line 62 of file inventory.h.
|
private |
Definition at line 64 of file inventory.h.
Referenced by BuildTileset().
|
private |
Definition at line 65 of file inventory.h.
Referenced by BuildTileset().
|
private |
Definition at line 66 of file inventory.h.
Referenced by BuildTileset(), and tilesheet().
|
private |
Definition at line 67 of file inventory.h.
Referenced by BuildTileset(), Create(), and palette().
|
private |
Definition at line 69 of file inventory.h.
|
private |
Definition at line 70 of file inventory.h.
|
private |
Definition at line 71 of file inventory.h.
Referenced by item_icons(), and LoadItemIcons().