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

#include <room.h>

Inheritance diagram for yaze::app::zelda3::dungeon::Room:
Collaboration diagram for yaze::app::zelda3::dungeon::Room:

Public Member Functions

 Room ()=default
 
 Room (int room_id)
 
 ~Room ()=default
 
void LoadHeader ()
 
void LoadRoomFromROM ()
 
void LoadRoomGraphics (uchar entrance_blockset=0xFF)
 
void CopyRoomGraphicsToBuffer ()
 
void LoadAnimatedGraphics ()
 
void LoadObjects ()
 
void LoadSprites ()
 
void LoadChests ()
 
auto blocks () const
 
auto & mutable_blocks ()
 
auto layer1 () const
 
auto layer2 () const
 
auto layer3 () const
 
auto room_size () const
 
auto room_size_ptr () const
 
auto set_room_size (uint64_t size)
 
RoomObject AddObject (short oid, uint8_t x, uint8_t y, uint8_t size, uint8_t layer)
 
- Public Member Functions inherited from yaze::app::SharedRom
 SharedRom ()=default
 
virtual ~SharedRom ()=default
 
std::shared_ptr< Romshared_rom ()
 
auto rom ()
 

Public Attributes

uint8_t blockset = 0
 
uint8_t spriteset = 0
 
uint8_t palette = 0
 
uint8_t layout = 0
 
uint8_t holewarp = 0
 
uint8_t floor1 = 0
 
uint8_t floor2 = 0
 
uint16_t message_id_ = 0
 
gfx::Bitmap current_graphics_
 
std::vector< uint8_t > bg1_buffer_
 
std::vector< uint8_t > bg2_buffer_
 
std::vector< uint8_t > current_gfx16_
 

Private Attributes

bool is_light_
 
bool is_loaded_
 
bool is_dark_
 
bool is_floor_
 
int room_id_
 
int animated_frame_
 
uchar tag1_
 
uchar tag2_
 
uint8_t staircase_plane_ [4]
 
uint8_t staircase_rooms_ [4]
 
uint8_t background_tileset_
 
uint8_t sprite_tileset_
 
uint8_t layer2_behavior_
 
uint8_t palette_
 
uint8_t floor1_graphics_
 
uint8_t floor2_graphics_
 
uint8_t layer2_mode_
 
uint64_t room_size_
 
int64_t room_size_pointer_
 
std::array< uint8_t, 16 > blocks_
 
std::array< uchar, 16 > chest_list_
 
std::array< gfx::Bitmap, 3 > background_bmps_
 
std::vector< zelda3::Spritesprites_
 
std::vector< StaircaseRoomsstaircase_rooms_vec_
 
Background2 bg2_
 
DungeonDestination pits_
 
DungeonDestination stair1_
 
DungeonDestination stair2_
 
DungeonDestination stair3_
 
DungeonDestination stair4_
 
std::vector< ChestDatachests_in_room_
 
std::vector< RoomObjecttile_objects_
 
std::vector< int > room_addresses_
 

Additional Inherited Members

- Static Public Attributes inherited from yaze::app::SharedRom
static std::shared_ptr< Romshared_rom_ = nullptr
 

Detailed Description

Definition at line 130 of file room.h.

Constructor & Destructor Documentation

◆ Room() [1/2]

yaze::app::zelda3::dungeon::Room::Room ( )
default

◆ Room() [2/2]

yaze::app::zelda3::dungeon::Room::Room ( int room_id)
inline

Definition at line 133 of file room.h.

◆ ~Room()

yaze::app::zelda3::dungeon::Room::~Room ( )
default

Member Function Documentation

◆ LoadHeader()

◆ LoadRoomFromROM()

◆ LoadRoomGraphics()

void yaze::app::zelda3::dungeon::Room::LoadRoomGraphics ( uchar entrance_blockset = 0xFF)

Definition at line 196 of file room.cc.

References blocks_, blockset, current_gfx16_, yaze::app::SharedRom::rom(), and spriteset.

Here is the call graph for this function:

◆ CopyRoomGraphicsToBuffer()

void yaze::app::zelda3::dungeon::Room::CopyRoomGraphicsToBuffer ( )

◆ LoadAnimatedGraphics()

void yaze::app::zelda3::dungeon::Room::LoadAnimatedGraphics ( )

Definition at line 256 of file room.cc.

References animated_frame_, background_tileset_, current_gfx16_, yaze::app::SharedRom::rom(), and yaze::app::core::SnesToPc().

Referenced by CopyRoomGraphicsToBuffer().

Here is the call graph for this function:

◆ LoadObjects()

void yaze::app::zelda3::dungeon::Room::LoadObjects ( )

if (oid == 0xF99) { if (chests_in_room.size() > 0) { tilesObjects.back().options |= ObjectOption::Chest; chest_list.push_back( Chest(posX, posY, chests_in_room.front().itemIn, false)); chests_in_room.erase(chests_in_room.begin()); } } else if (oid == 0xFB1) { if (chests_in_room.size() > 0) { tilesObjects.back().options |= ObjectOption::Chest; chest_list.push_back( Chest(posX + 1, posY, chests_in_room.front().itemIn, true)); chests_in_room.erase(chests_in_room.begin()); } } } else { tilesObjects.push_back(object_door(static_cast<short>((b2 << 8) + b1), 0, 0, 0, static_cast<uint8_t>(layer))); }

Definition at line 276 of file room.cc.

References floor1_graphics_, floor2_graphics_, is_floor_, layout, LoadChests(), yaze::app::SharedRom::rom(), room_id_, yaze::app::zelda3::dungeon::room_object_pointer, yaze::app::core::SnesToPc(), staircase_rooms_, staircase_rooms_vec_, yaze::app::zelda3::dungeon::Stairs, yaze::app::zelda3::dungeon::stairsObjects, and tile_objects_.

Here is the call graph for this function:

◆ LoadSprites()

void yaze::app::zelda3::dungeon::Room::LoadSprites ( )

TODO: Implement Sprite constructor for Dungeons (b3, (b2 & 0x1F), (b1 & 0x1F), ((b2 & 0xE0) >> 5) + ((b1 & 0x60) >> 2), (b1 & 0x80) >> 7);

Definition at line 415 of file room.cc.

References yaze::app::zelda3::Sprite::id(), yaze::app::zelda3::Sprite::layer(), yaze::app::SharedRom::rom(), room_id_, yaze::app::zelda3::dungeon::rooms_sprite_pointer, yaze::app::core::SnesToPc(), sprites_, yaze::app::zelda3::Sprite::subtype(), yaze::app::zelda3::Sprite::x(), and yaze::app::zelda3::Sprite::y().

Here is the call graph for this function:

◆ LoadChests()

void yaze::app::zelda3::dungeon::Room::LoadChests ( )

◆ blocks()

auto yaze::app::zelda3::dungeon::Room::blocks ( ) const
inline

Definition at line 146 of file room.h.

References blocks_.

◆ mutable_blocks()

auto & yaze::app::zelda3::dungeon::Room::mutable_blocks ( )
inline

Definition at line 147 of file room.h.

References blocks_.

◆ layer1()

auto yaze::app::zelda3::dungeon::Room::layer1 ( ) const
inline

Definition at line 148 of file room.h.

References background_bmps_.

◆ layer2()

auto yaze::app::zelda3::dungeon::Room::layer2 ( ) const
inline

Definition at line 149 of file room.h.

References background_bmps_.

◆ layer3()

auto yaze::app::zelda3::dungeon::Room::layer3 ( ) const
inline

Definition at line 150 of file room.h.

References background_bmps_.

◆ room_size()

auto yaze::app::zelda3::dungeon::Room::room_size ( ) const
inline

Definition at line 151 of file room.h.

References room_size_.

Referenced by LoadHeader().

◆ room_size_ptr()

auto yaze::app::zelda3::dungeon::Room::room_size_ptr ( ) const
inline

Definition at line 152 of file room.h.

References room_size_pointer_.

◆ set_room_size()

auto yaze::app::zelda3::dungeon::Room::set_room_size ( uint64_t size)
inline

Definition at line 153 of file room.h.

References room_size_.

◆ AddObject()

RoomObject yaze::app::zelda3::dungeon::Room::AddObject ( short oid,
uint8_t x,
uint8_t y,
uint8_t size,
uint8_t layer )
inline

Definition at line 155 of file room.h.

Member Data Documentation

◆ blockset

uint8_t yaze::app::zelda3::dungeon::Room::blockset = 0

Definition at line 160 of file room.h.

Referenced by LoadHeader(), and LoadRoomGraphics().

◆ spriteset

uint8_t yaze::app::zelda3::dungeon::Room::spriteset = 0

Definition at line 161 of file room.h.

Referenced by LoadHeader(), and LoadRoomGraphics().

◆ palette

uint8_t yaze::app::zelda3::dungeon::Room::palette = 0

Definition at line 162 of file room.h.

Referenced by LoadHeader().

◆ layout

uint8_t yaze::app::zelda3::dungeon::Room::layout = 0

Definition at line 163 of file room.h.

Referenced by LoadObjects().

◆ holewarp

uint8_t yaze::app::zelda3::dungeon::Room::holewarp = 0

Definition at line 164 of file room.h.

Referenced by LoadHeader().

◆ floor1

uint8_t yaze::app::zelda3::dungeon::Room::floor1 = 0

Definition at line 165 of file room.h.

◆ floor2

uint8_t yaze::app::zelda3::dungeon::Room::floor2 = 0

Definition at line 166 of file room.h.

◆ message_id_

uint16_t yaze::app::zelda3::dungeon::Room::message_id_ = 0

Definition at line 168 of file room.h.

Referenced by LoadRoomFromROM().

◆ current_graphics_

gfx::Bitmap yaze::app::zelda3::dungeon::Room::current_graphics_

Definition at line 170 of file room.h.

◆ bg1_buffer_

std::vector<uint8_t> yaze::app::zelda3::dungeon::Room::bg1_buffer_

Definition at line 171 of file room.h.

◆ bg2_buffer_

std::vector<uint8_t> yaze::app::zelda3::dungeon::Room::bg2_buffer_

Definition at line 172 of file room.h.

◆ current_gfx16_

std::vector<uint8_t> yaze::app::zelda3::dungeon::Room::current_gfx16_

Definition at line 173 of file room.h.

Referenced by CopyRoomGraphicsToBuffer(), LoadAnimatedGraphics(), and LoadRoomGraphics().

◆ is_light_

bool yaze::app::zelda3::dungeon::Room::is_light_
private

Definition at line 176 of file room.h.

Referenced by LoadHeader().

◆ is_loaded_

bool yaze::app::zelda3::dungeon::Room::is_loaded_
private

Definition at line 177 of file room.h.

◆ is_dark_

bool yaze::app::zelda3::dungeon::Room::is_dark_
private

Definition at line 178 of file room.h.

Referenced by LoadRoomFromROM().

◆ is_floor_

bool yaze::app::zelda3::dungeon::Room::is_floor_
private

Definition at line 179 of file room.h.

Referenced by LoadObjects().

◆ room_id_

int yaze::app::zelda3::dungeon::Room::room_id_
private

Definition at line 181 of file room.h.

Referenced by LoadChests(), LoadHeader(), LoadObjects(), LoadRoomFromROM(), and LoadSprites().

◆ animated_frame_

int yaze::app::zelda3::dungeon::Room::animated_frame_
private

Definition at line 182 of file room.h.

Referenced by LoadAnimatedGraphics().

◆ tag1_

uchar yaze::app::zelda3::dungeon::Room::tag1_
private

Definition at line 184 of file room.h.

Referenced by LoadRoomFromROM().

◆ tag2_

uchar yaze::app::zelda3::dungeon::Room::tag2_
private

Definition at line 185 of file room.h.

Referenced by LoadRoomFromROM().

◆ staircase_plane_

uint8_t yaze::app::zelda3::dungeon::Room::staircase_plane_[4]
private

Definition at line 187 of file room.h.

Referenced by LoadHeader().

◆ staircase_rooms_

uint8_t yaze::app::zelda3::dungeon::Room::staircase_rooms_[4]
private

Definition at line 188 of file room.h.

Referenced by LoadHeader(), and LoadObjects().

◆ background_tileset_

uint8_t yaze::app::zelda3::dungeon::Room::background_tileset_
private

Definition at line 190 of file room.h.

Referenced by LoadAnimatedGraphics(), and LoadRoomFromROM().

◆ sprite_tileset_

uint8_t yaze::app::zelda3::dungeon::Room::sprite_tileset_
private

Definition at line 191 of file room.h.

Referenced by LoadRoomFromROM().

◆ layer2_behavior_

uint8_t yaze::app::zelda3::dungeon::Room::layer2_behavior_
private

Definition at line 192 of file room.h.

Referenced by LoadRoomFromROM().

◆ palette_

uint8_t yaze::app::zelda3::dungeon::Room::palette_
private

Definition at line 193 of file room.h.

Referenced by LoadRoomFromROM().

◆ floor1_graphics_

uint8_t yaze::app::zelda3::dungeon::Room::floor1_graphics_
private

Definition at line 194 of file room.h.

Referenced by LoadObjects().

◆ floor2_graphics_

uint8_t yaze::app::zelda3::dungeon::Room::floor2_graphics_
private

Definition at line 195 of file room.h.

Referenced by LoadObjects().

◆ layer2_mode_

uint8_t yaze::app::zelda3::dungeon::Room::layer2_mode_
private

Definition at line 196 of file room.h.

Referenced by LoadRoomFromROM().

◆ room_size_

uint64_t yaze::app::zelda3::dungeon::Room::room_size_
private

Definition at line 198 of file room.h.

Referenced by LoadHeader(), room_size(), and set_room_size().

◆ room_size_pointer_

int64_t yaze::app::zelda3::dungeon::Room::room_size_pointer_
private

Definition at line 199 of file room.h.

Referenced by LoadHeader(), and room_size_ptr().

◆ blocks_

std::array<uint8_t, 16> yaze::app::zelda3::dungeon::Room::blocks_
private

Definition at line 201 of file room.h.

Referenced by blocks(), CopyRoomGraphicsToBuffer(), LoadRoomGraphics(), and mutable_blocks().

◆ chest_list_

std::array<uchar, 16> yaze::app::zelda3::dungeon::Room::chest_list_
private

Definition at line 202 of file room.h.

◆ background_bmps_

std::array<gfx::Bitmap, 3> yaze::app::zelda3::dungeon::Room::background_bmps_
private

Definition at line 204 of file room.h.

Referenced by layer1(), layer2(), and layer3().

◆ sprites_

std::vector<zelda3::Sprite> yaze::app::zelda3::dungeon::Room::sprites_
private

Definition at line 205 of file room.h.

Referenced by LoadSprites().

◆ staircase_rooms_vec_

std::vector<StaircaseRooms> yaze::app::zelda3::dungeon::Room::staircase_rooms_vec_
private

Definition at line 206 of file room.h.

Referenced by LoadObjects().

◆ bg2_

Background2 yaze::app::zelda3::dungeon::Room::bg2_
private

Definition at line 208 of file room.h.

Referenced by LoadHeader().

◆ pits_

DungeonDestination yaze::app::zelda3::dungeon::Room::pits_
private

Definition at line 209 of file room.h.

Referenced by LoadRoomFromROM().

◆ stair1_

DungeonDestination yaze::app::zelda3::dungeon::Room::stair1_
private

Definition at line 210 of file room.h.

Referenced by LoadRoomFromROM().

◆ stair2_

DungeonDestination yaze::app::zelda3::dungeon::Room::stair2_
private

Definition at line 211 of file room.h.

Referenced by LoadRoomFromROM().

◆ stair3_

DungeonDestination yaze::app::zelda3::dungeon::Room::stair3_
private

Definition at line 212 of file room.h.

Referenced by LoadRoomFromROM().

◆ stair4_

DungeonDestination yaze::app::zelda3::dungeon::Room::stair4_
private

Definition at line 213 of file room.h.

Referenced by LoadRoomFromROM().

◆ chests_in_room_

std::vector<ChestData> yaze::app::zelda3::dungeon::Room::chests_in_room_
private

Definition at line 215 of file room.h.

Referenced by LoadChests().

◆ tile_objects_

std::vector<RoomObject> yaze::app::zelda3::dungeon::Room::tile_objects_
private

Definition at line 216 of file room.h.

Referenced by LoadObjects().

◆ room_addresses_

std::vector<int> yaze::app::zelda3::dungeon::Room::room_addresses_
private

Definition at line 218 of file room.h.


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