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

#include <room.h>

Classes

struct  Door
 Represents a door in a dungeon room. More...
 

Public Member Functions

 Room ()
 
 Room (int room_id, Rom *rom, GameData *game_data=nullptr)
 
 ~Room ()
 
 Room (Room &&)
 
Roomoperator= (Room &&)
 
 Room (const Room &)=delete
 
Roomoperator= (const Room &)=delete
 
void LoadRoomGraphics (uint8_t entrance_blockset=0xFF)
 
void CopyRoomGraphicsToBuffer ()
 
void RenderRoomGraphics ()
 
void RenderObjectsToBackground ()
 
void LoadAnimatedGraphics ()
 
void LoadObjects ()
 
void LoadSprites ()
 
void LoadChests ()
 
void LoadPotItems ()
 
void LoadDoors ()
 
void LoadTorches ()
 
void LoadBlocks ()
 
void LoadPits ()
 
void LoadLayoutTilesToBuffer ()
 
void ReloadGraphics (uint8_t entrance_blockset=0xFF)
 
const std::vector< zelda3::Sprite > & GetSprites () const
 
std::vector< zelda3::Sprite > & GetSprites ()
 
const std::vector< chest_data > & GetChests () const
 
std::vector< chest_data > & GetChests ()
 
const std::vector< staircase > & GetStairs () const
 
std::vector< staircase > & GetStairs ()
 
const std::vector< Door > & GetDoors () const
 
std::vector< Door > & GetDoors ()
 
void AddDoor (const Door &door)
 
void RemoveDoor (size_t index)
 
const std::vector< PotItem > & GetPotItems () const
 
std::vector< PotItem > & GetPotItems ()
 
const RoomLayoutGetLayout () const
 
const std::vector< RoomObject > & GetTileObjects () const
 
std::vector< RoomObject > & GetTileObjects ()
 
void ClearTileObjects ()
 
void AddTileObject (const RoomObject &object)
 
absl::Status AddObject (const RoomObject &object)
 
absl::Status RemoveObject (size_t index)
 
absl::Status UpdateObject (size_t index, const RoomObject &object)
 
absl::StatusOr< size_t > FindObjectAt (int x, int y, int layer) const
 
bool ValidateObject (const RoomObject &object) const
 
void MarkObjectsDirty ()
 
void MarkGraphicsDirty ()
 
void MarkLayoutDirty ()
 
void RemoveTileObject (size_t index)
 
size_t GetTileObjectCount () const
 
RoomObjectGetTileObject (size_t index)
 
const RoomObjectGetTileObject (size_t index) const
 
void SetTileObjects (const std::vector< RoomObject > &objects)
 
void SetBg2 (background2 bg2)
 
void SetCollision (CollisionKey collision)
 
void SetIsLight (bool is_light)
 
void SetPalette (uint8_t palette)
 
void SetBlockset (uint8_t blockset)
 
void SetSpriteset (uint8_t spriteset)
 
void SetEffect (EffectKey effect)
 
void SetTag1 (TagKey tag1)
 
void SetTag2 (TagKey tag2)
 
void SetStaircasePlane (int index, uint8_t plane)
 
void SetHolewarp (uint8_t holewarp)
 
void SetStaircaseRoom (int index, uint8_t room)
 
void SetMessageId (uint16_t message_id)
 
bool IsLight () const
 
void SetMessageIdDirect (uint16_t message_id)
 
void SetLayer2Mode (uint8_t mode)
 
void SetLayerMerging (LayerMergeType merging)
 
void SetIsDark (bool is_dark)
 
void SetPaletteDirect (uint8_t palette)
 
void SetBackgroundTileset (uint8_t tileset)
 
void SetSpriteTileset (uint8_t tileset)
 
void SetLayer2Behavior (uint8_t behavior)
 
void SetTag1Direct (TagKey tag1)
 
void SetTag2Direct (TagKey tag2)
 
void SetPitsTargetLayer (uint8_t layer)
 
void SetStair1TargetLayer (uint8_t layer)
 
void SetStair2TargetLayer (uint8_t layer)
 
void SetStair3TargetLayer (uint8_t layer)
 
void SetStair4TargetLayer (uint8_t layer)
 
void SetPitsTarget (uint8_t target)
 
void SetStair1Target (uint8_t target)
 
void SetStair2Target (uint8_t target)
 
void SetStair3Target (uint8_t target)
 
void SetStair4Target (uint8_t target)
 
bool IsLoaded () const
 
void SetLoaded (bool loaded)
 
EffectKey effect () const
 
TagKey tag1 () const
 
TagKey tag2 () const
 
CollisionKey collision () const
 
const LayerMergeTypelayer_merging () const
 
int id () const
 
uint8_t floor1 () const
 
uint8_t floor2 () const
 
void set_floor1 (uint8_t value)
 
void set_floor2 (uint8_t value)
 
void ParseObjectsFromLocation (int objects_location)
 
void HandleSpecialObjects (short oid, uint8_t posX, uint8_t posY, int &nbr_of_staircase)
 
absl::Status SaveObjects ()
 
std::vector< uint8_t > EncodeObjects () const
 
absl::Status SaveSprites ()
 
std::vector< uint8_t > EncodeSprites () const
 
auto blocks () const
 
auto & mutable_blocks ()
 
auto rom ()
 
auto mutable_rom ()
 
void SetRom (Rom *rom)
 
auto game_data ()
 
void SetGameData (GameData *data)
 
zelda3_version_pointers version_constants () const
 
const std::array< uint8_t, 0x10000 > & get_gfx_buffer () const
 
auto & bg1_buffer ()
 
auto & bg2_buffer ()
 
const auto & bg1_buffer () const
 
const auto & bg2_buffer () const
 
auto & object_bg1_buffer ()
 
const auto & object_bg1_buffer () const
 
auto & object_bg2_buffer ()
 
const auto & object_bg2_buffer () const
 
gfx::BitmapGetCompositeBitmap (RoomLayerManager &layer_mgr)
 Get a composite bitmap of all layers merged.
 
const gfx::Bitmapcomposite_bitmap () const
 
void MarkCompositeDirty ()
 Mark composite bitmap as needing regeneration.
 
bool IsCompositeDirty () const
 
DungeonStateGetDungeonState ()
 

Public Attributes

uint8_t blockset = 0
 
uint8_t spriteset = 0
 
uint8_t palette = 0
 
uint8_t layout = 0
 
uint8_t holewarp = 0
 
uint16_t message_id_ = 0
 

Private Attributes

Romrom_
 
GameDatagame_data_ = nullptr
 
std::array< uint8_t, 0x10000 > current_gfx16_
 
gfx::BackgroundBuffer bg1_buffer_ {512, 512}
 
gfx::BackgroundBuffer bg2_buffer_ {512, 512}
 
gfx::BackgroundBuffer object_bg1_buffer_ {512, 512}
 
gfx::BackgroundBuffer object_bg2_buffer_ {512, 512}
 
gfx::Bitmap composite_bitmap_
 
bool composite_dirty_ = true
 
bool is_light_
 
bool is_loaded_ = false
 
bool is_dark_
 
bool is_floor_ = true
 
uint8_t cached_blockset_ = 0xFF
 
uint8_t cached_spriteset_ = 0xFF
 
uint8_t cached_palette_ = 0xFF
 
uint8_t cached_layout_ = 0xFF
 
uint8_t cached_floor1_graphics_ = 0xFF
 
uint8_t cached_floor2_graphics_ = 0xFF
 
uint8_t cached_effect_ = 0xFF
 
TagKey cached_tag1_ = TagKey::Nothing
 
TagKey cached_tag2_ = TagKey::Nothing
 
bool graphics_dirty_ = true
 
bool objects_dirty_ = true
 
bool layout_dirty_ = true
 
bool textures_dirty_ = true
 
int room_id_
 
int animated_frame_
 
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_
 
std::array< uint8_t, 16 > blocks_
 
std::array< chest, 16 > chest_list_
 
std::vector< RoomObjecttile_objects_
 
std::vector< zelda3::Spritesprites_
 
std::vector< staircasez3_staircases_
 
std::vector< chest_datachests_in_room_
 
std::vector< Doordoors_
 
std::vector< PotItempot_items_
 
RoomLayout layout_
 
LayerMergeType layer_merging_
 
CollisionKey collision_
 
EffectKey effect_
 
TagKey tag1_
 
TagKey tag2_
 
background2 bg2_
 
destination pits_
 
destination stair1_
 
destination stair2_
 
destination stair3_
 
destination stair4_
 
std::unique_ptr< DungeonStatedungeon_state_
 

Detailed Description

Definition at line 216 of file room.h.

Constructor & Destructor Documentation

◆ Room() [1/4]

yaze::zelda3::Room::Room ( )
default

◆ Room() [2/4]

yaze::zelda3::Room::Room ( int room_id,
Rom * rom,
GameData * game_data = nullptr )

Definition at line 359 of file room.cc.

◆ ~Room()

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

◆ Room() [3/4]

yaze::zelda3::Room::Room ( Room && )
default

◆ Room() [4/4]

yaze::zelda3::Room::Room ( const Room & )
delete

Member Function Documentation

◆ operator=() [1/2]

Room & yaze::zelda3::Room::operator= ( Room && )
default

◆ operator=() [2/2]

Room & yaze::zelda3::Room::operator= ( const Room & )
delete

◆ LoadRoomGraphics()

◆ CopyRoomGraphicsToBuffer()

◆ RenderRoomGraphics()

void yaze::zelda3::Room::RenderRoomGraphics ( )

Definition at line 518 of file room.cc.

References bg1_buffer_, bg2_buffer_, yaze::gfx::BackgroundBuffer::bitmap(), blocks_, blockset, cached_blockset_, cached_effect_, cached_floor1_graphics_, cached_floor2_graphics_, cached_layout_, cached_palette_, cached_spriteset_, cached_tag1_, cached_tag2_, composite_dirty_, CopyRoomGraphicsToBuffer(), yaze::gfx::Arena::CREATE, current_gfx16_, yaze::gfx::BackgroundBuffer::DrawBackground(), yaze::gfx::BackgroundBuffer::DrawFloor(), yaze::gfx::PaletteGroupMap::dungeon_main, effect_, floor1_graphics_, floor2_graphics_, game_data_, yaze::gfx::Arena::Get(), yaze::zelda3::PaletteDebugger::Get(), yaze::platform::GetSurfacePalette(), graphics_dirty_, yaze::zelda3::LayerMergeType::ID, yaze::zelda3::kDungeonPalettePointerTable, yaze::zelda3::LayerMergeType::Layer2Translucent, layer_merging_, layout, layout_dirty_, LoadLayoutTilesToBuffer(), LoadRoomGraphics(), LOG_DEBUG, yaze::zelda3::PaletteDebugger::LogPaletteApplication(), yaze::zelda3::PaletteDebugger::LogPaletteLoad(), yaze::zelda3::PaletteDebugger::LogSurfaceState(), yaze::zelda3::name, object_bg1_buffer_, object_bg2_buffer_, objects_dirty_, palette, yaze::zelda3::GameData::palette_groups, yaze::zelda3::GameData::paletteset_ids, yaze::gfx::Arena::QueueTextureCommand(), RenderObjectsToBackground(), rom(), room_id_, yaze::zelda3::PaletteDebugger::SetCurrentBitmap(), yaze::zelda3::PaletteDebugger::SetCurrentPalette(), yaze::gfx::Bitmap::SetPalette(), yaze::gfx::PaletteGroup::size(), spriteset, yaze::gfx::Bitmap::surface(), tag1_, tag2_, yaze::gfx::Bitmap::texture(), textures_dirty_, yaze::zelda3::tile_address, yaze::zelda3::tile_address_floor, and yaze::gfx::Arena::UPDATE.

Referenced by yaze::editor::DungeonRoomPanel::Draw(), yaze::editor::DungeonRoomLoader::LoadAndRenderRoomGraphics(), and yaze::editor::DungeonRoomPanel::OnResourceModified().

◆ RenderObjectsToBackground()

◆ LoadAnimatedGraphics()

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

◆ LoadObjects()

◆ LoadSprites()

◆ LoadChests()

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

Definition at line 1666 of file room.cc.

References yaze::zelda3::chests_data_pointer1, chests_in_room_, yaze::zelda3::chests_length_pointer, rom(), room_id_, and yaze::SnesToPc().

Referenced by LoadObjects().

Here is the call graph for this function:

◆ LoadPotItems()

void yaze::zelda3::Room::LoadPotItems ( )

◆ LoadDoors()

void yaze::zelda3::Room::LoadDoors ( )

Definition at line 1690 of file room.cc.

References LOG_DEBUG, rom(), and room_id_.

Referenced by yaze::zelda3::LoadRoomFromRom().

Here is the call graph for this function:

◆ LoadTorches()

void yaze::zelda3::Room::LoadTorches ( )

◆ LoadBlocks()

◆ LoadPits()

void yaze::zelda3::Room::LoadPits ( )

Definition at line 1899 of file room.cc.

References LOG_DEBUG, yaze::zelda3::pit_count, yaze::zelda3::pit_pointer, pits_, rom(), room_id_, yaze::SnesToPc(), destination::target, and destination::target_layer.

Referenced by yaze::zelda3::LoadRoomFromRom().

Here is the call graph for this function:

◆ LoadLayoutTilesToBuffer()

◆ ReloadGraphics()

void yaze::zelda3::Room::ReloadGraphics ( uint8_t entrance_blockset = 0xFF)

◆ GetSprites() [1/2]

◆ GetSprites() [2/2]

std::vector< zelda3::Sprite > & yaze::zelda3::Room::GetSprites ( )
inline

Definition at line 247 of file room.h.

References sprites_.

◆ GetChests() [1/2]

const std::vector< chest_data > & yaze::zelda3::Room::GetChests ( ) const
inline

Definition at line 250 of file room.h.

References chests_in_room_.

Referenced by yaze::zelda3::DungeonEditorSystem::LoadRoomData().

◆ GetChests() [2/2]

std::vector< chest_data > & yaze::zelda3::Room::GetChests ( )
inline

Definition at line 251 of file room.h.

References chests_in_room_.

◆ GetStairs() [1/2]

const std::vector< staircase > & yaze::zelda3::Room::GetStairs ( ) const
inline

Definition at line 254 of file room.h.

References z3_staircases_.

◆ GetStairs() [2/2]

std::vector< staircase > & yaze::zelda3::Room::GetStairs ( )
inline

Definition at line 255 of file room.h.

References z3_staircases_.

◆ GetDoors() [1/2]

const std::vector< Door > & yaze::zelda3::Room::GetDoors ( ) const
inline

Definition at line 326 of file room.h.

References doors_.

◆ GetDoors() [2/2]

std::vector< Door > & yaze::zelda3::Room::GetDoors ( )
inline

Definition at line 327 of file room.h.

References doors_.

◆ AddDoor()

void yaze::zelda3::Room::AddDoor ( const Door & door)
inline

Definition at line 328 of file room.h.

References doors_, and MarkObjectsDirty().

Here is the call graph for this function:

◆ RemoveDoor()

void yaze::zelda3::Room::RemoveDoor ( size_t index)
inline

Definition at line 332 of file room.h.

References doors_, and MarkObjectsDirty().

Here is the call graph for this function:

◆ GetPotItems() [1/2]

const std::vector< PotItem > & yaze::zelda3::Room::GetPotItems ( ) const
inline

Definition at line 340 of file room.h.

References pot_items_.

Referenced by yaze::editor::DungeonCanvasViewer::RenderPotItems().

◆ GetPotItems() [2/2]

std::vector< PotItem > & yaze::zelda3::Room::GetPotItems ( )
inline

Definition at line 341 of file room.h.

References pot_items_.

◆ GetLayout()

const RoomLayout & yaze::zelda3::Room::GetLayout ( ) const
inline

Definition at line 343 of file room.h.

References layout_.

◆ GetTileObjects() [1/2]

◆ GetTileObjects() [2/2]

std::vector< RoomObject > & yaze::zelda3::Room::GetTileObjects ( )
inline

Definition at line 349 of file room.h.

References tile_objects_.

◆ ClearTileObjects()

void yaze::zelda3::Room::ClearTileObjects ( )
inline

◆ AddTileObject()

void yaze::zelda3::Room::AddTileObject ( const RoomObject & object)
inline

Definition at line 353 of file room.h.

References MarkObjectsDirty(), and tile_objects_.

Here is the call graph for this function:

◆ AddObject()

◆ RemoveObject()

absl::Status yaze::zelda3::Room::RemoveObject ( size_t index)

Definition at line 1522 of file room.cc.

References MarkObjectsDirty(), and tile_objects_.

Referenced by yaze::zelda3::DungeonObjectEditor::DeleteObject().

Here is the call graph for this function:

◆ UpdateObject()

absl::Status yaze::zelda3::Room::UpdateObject ( size_t index,
const RoomObject & object )

Definition at line 1533 of file room.cc.

References MarkObjectsDirty(), tile_objects_, and ValidateObject().

Here is the call graph for this function:

◆ FindObjectAt()

absl::StatusOr< size_t > yaze::zelda3::Room::FindObjectAt ( int x,
int y,
int layer ) const

Definition at line 1548 of file room.cc.

References tile_objects_.

◆ ValidateObject()

bool yaze::zelda3::Room::ValidateObject ( const RoomObject & object) const

Definition at line 1558 of file room.cc.

Referenced by AddObject(), and UpdateObject().

◆ MarkObjectsDirty()

void yaze::zelda3::Room::MarkObjectsDirty ( )
inline

◆ MarkGraphicsDirty()

void yaze::zelda3::Room::MarkGraphicsDirty ( )
inline

Definition at line 371 of file room.h.

References composite_dirty_, graphics_dirty_, and textures_dirty_.

Referenced by set_floor1(), set_floor2(), SetBlockset(), SetPalette(), and SetSpriteset().

◆ MarkLayoutDirty()

void yaze::zelda3::Room::MarkLayoutDirty ( )
inline

Definition at line 376 of file room.h.

References composite_dirty_, layout_dirty_, and textures_dirty_.

◆ RemoveTileObject()

void yaze::zelda3::Room::RemoveTileObject ( size_t index)
inline

Definition at line 381 of file room.h.

References MarkObjectsDirty(), and tile_objects_.

Referenced by yaze::zelda3::DungeonObjectEditor::DeleteSelectedObjects().

Here is the call graph for this function:

◆ GetTileObjectCount()

◆ GetTileObject() [1/2]

◆ GetTileObject() [2/2]

const RoomObject & yaze::zelda3::Room::GetTileObject ( size_t index) const
inline

Definition at line 389 of file room.h.

References tile_objects_.

◆ SetTileObjects()

void yaze::zelda3::Room::SetTileObjects ( const std::vector< RoomObject > & objects)
inline

Definition at line 394 of file room.h.

References MarkObjectsDirty(), and tile_objects_.

Referenced by yaze::zelda3::DungeonObjectEditor::ApplyUndoPoint().

Here is the call graph for this function:

◆ SetBg2()

void yaze::zelda3::Room::SetBg2 ( background2 bg2)
inline

Definition at line 400 of file room.h.

References bg2_.

Referenced by yaze::zelda3::LoadRoomHeaderFromRom().

◆ SetCollision()

void yaze::zelda3::Room::SetCollision ( CollisionKey collision)
inline

Definition at line 401 of file room.h.

References collision(), and collision_.

Referenced by yaze::zelda3::LoadRoomHeaderFromRom().

Here is the call graph for this function:

◆ SetIsLight()

void yaze::zelda3::Room::SetIsLight ( bool is_light)
inline

Definition at line 402 of file room.h.

References is_light_.

Referenced by yaze::zelda3::LoadRoomHeaderFromRom().

◆ SetPalette()

void yaze::zelda3::Room::SetPalette ( uint8_t palette)
inline

Definition at line 403 of file room.h.

References MarkGraphicsDirty(), and palette.

Referenced by yaze::zelda3::LoadRoomHeaderFromRom().

Here is the call graph for this function:

◆ SetBlockset()

void yaze::zelda3::Room::SetBlockset ( uint8_t blockset)
inline

Definition at line 409 of file room.h.

References blockset, and MarkGraphicsDirty().

Referenced by yaze::zelda3::LoadRoomHeaderFromRom().

Here is the call graph for this function:

◆ SetSpriteset()

void yaze::zelda3::Room::SetSpriteset ( uint8_t spriteset)
inline

Definition at line 415 of file room.h.

References MarkGraphicsDirty(), and spriteset.

Referenced by yaze::zelda3::LoadRoomHeaderFromRom().

Here is the call graph for this function:

◆ SetEffect()

void yaze::zelda3::Room::SetEffect ( EffectKey effect)
inline

Definition at line 421 of file room.h.

References effect(), effect_, and MarkObjectsDirty().

Referenced by yaze::zelda3::LoadRoomHeaderFromRom().

Here is the call graph for this function:

◆ SetTag1()

void yaze::zelda3::Room::SetTag1 ( TagKey tag1)
inline

Definition at line 427 of file room.h.

References MarkObjectsDirty(), tag1(), and tag1_.

Referenced by yaze::zelda3::LoadRoomHeaderFromRom().

Here is the call graph for this function:

◆ SetTag2()

void yaze::zelda3::Room::SetTag2 ( TagKey tag2)
inline

Definition at line 433 of file room.h.

References MarkObjectsDirty(), tag2(), and tag2_.

Referenced by yaze::zelda3::LoadRoomHeaderFromRom().

Here is the call graph for this function:

◆ SetStaircasePlane()

void yaze::zelda3::Room::SetStaircasePlane ( int index,
uint8_t plane )
inline

Definition at line 439 of file room.h.

References staircase_plane_.

Referenced by yaze::zelda3::LoadRoomHeaderFromRom().

◆ SetHolewarp()

void yaze::zelda3::Room::SetHolewarp ( uint8_t holewarp)
inline

Definition at line 443 of file room.h.

References holewarp.

Referenced by yaze::zelda3::LoadRoomHeaderFromRom().

◆ SetStaircaseRoom()

void yaze::zelda3::Room::SetStaircaseRoom ( int index,
uint8_t room )
inline

Definition at line 444 of file room.h.

References staircase_rooms_.

Referenced by yaze::zelda3::LoadRoomHeaderFromRom().

◆ SetMessageId()

void yaze::zelda3::Room::SetMessageId ( uint16_t message_id)
inline

Definition at line 450 of file room.h.

References message_id_.

◆ IsLight()

bool yaze::zelda3::Room::IsLight ( ) const
inline

Definition at line 453 of file room.h.

References is_light_.

Referenced by yaze::zelda3::LoadRoomHeaderFromRom().

◆ SetMessageIdDirect()

void yaze::zelda3::Room::SetMessageIdDirect ( uint16_t message_id)
inline

Definition at line 456 of file room.h.

References message_id_.

Referenced by yaze::zelda3::LoadRoomHeaderFromRom().

◆ SetLayer2Mode()

void yaze::zelda3::Room::SetLayer2Mode ( uint8_t mode)
inline

Definition at line 457 of file room.h.

References layer2_mode_.

Referenced by yaze::zelda3::LoadRoomHeaderFromRom().

◆ SetLayerMerging()

void yaze::zelda3::Room::SetLayerMerging ( LayerMergeType merging)
inline

Definition at line 458 of file room.h.

References layer_merging_.

Referenced by yaze::zelda3::LoadRoomHeaderFromRom().

◆ SetIsDark()

void yaze::zelda3::Room::SetIsDark ( bool is_dark)
inline

Definition at line 459 of file room.h.

References is_dark_.

Referenced by yaze::zelda3::LoadRoomHeaderFromRom().

◆ SetPaletteDirect()

void yaze::zelda3::Room::SetPaletteDirect ( uint8_t palette)
inline

Definition at line 460 of file room.h.

References palette, and palette_.

Referenced by yaze::zelda3::LoadRoomHeaderFromRom().

◆ SetBackgroundTileset()

void yaze::zelda3::Room::SetBackgroundTileset ( uint8_t tileset)
inline

Definition at line 461 of file room.h.

References background_tileset_.

Referenced by yaze::zelda3::LoadRoomHeaderFromRom().

◆ SetSpriteTileset()

void yaze::zelda3::Room::SetSpriteTileset ( uint8_t tileset)
inline

Definition at line 462 of file room.h.

References sprite_tileset_.

Referenced by yaze::zelda3::LoadRoomHeaderFromRom().

◆ SetLayer2Behavior()

void yaze::zelda3::Room::SetLayer2Behavior ( uint8_t behavior)
inline

Definition at line 463 of file room.h.

References layer2_behavior_.

Referenced by yaze::zelda3::LoadRoomHeaderFromRom().

◆ SetTag1Direct()

void yaze::zelda3::Room::SetTag1Direct ( TagKey tag1)
inline

Definition at line 464 of file room.h.

References tag1(), and tag1_.

Referenced by yaze::zelda3::LoadRoomHeaderFromRom().

Here is the call graph for this function:

◆ SetTag2Direct()

void yaze::zelda3::Room::SetTag2Direct ( TagKey tag2)
inline

Definition at line 465 of file room.h.

References tag2(), and tag2_.

Referenced by yaze::zelda3::LoadRoomHeaderFromRom().

Here is the call graph for this function:

◆ SetPitsTargetLayer()

void yaze::zelda3::Room::SetPitsTargetLayer ( uint8_t layer)
inline

Definition at line 466 of file room.h.

References pits_, and destination::target_layer.

Referenced by yaze::zelda3::LoadRoomHeaderFromRom().

◆ SetStair1TargetLayer()

void yaze::zelda3::Room::SetStair1TargetLayer ( uint8_t layer)
inline

Definition at line 467 of file room.h.

References stair1_, and destination::target_layer.

Referenced by yaze::zelda3::LoadRoomHeaderFromRom().

◆ SetStair2TargetLayer()

void yaze::zelda3::Room::SetStair2TargetLayer ( uint8_t layer)
inline

Definition at line 468 of file room.h.

References stair2_, and destination::target_layer.

Referenced by yaze::zelda3::LoadRoomHeaderFromRom().

◆ SetStair3TargetLayer()

void yaze::zelda3::Room::SetStair3TargetLayer ( uint8_t layer)
inline

Definition at line 469 of file room.h.

References stair3_, and destination::target_layer.

Referenced by yaze::zelda3::LoadRoomHeaderFromRom().

◆ SetStair4TargetLayer()

void yaze::zelda3::Room::SetStair4TargetLayer ( uint8_t layer)
inline

Definition at line 470 of file room.h.

References stair4_, and destination::target_layer.

Referenced by yaze::zelda3::LoadRoomHeaderFromRom().

◆ SetPitsTarget()

void yaze::zelda3::Room::SetPitsTarget ( uint8_t target)
inline

Definition at line 471 of file room.h.

References pits_, and destination::target.

Referenced by yaze::zelda3::LoadRoomHeaderFromRom().

◆ SetStair1Target()

void yaze::zelda3::Room::SetStair1Target ( uint8_t target)
inline

Definition at line 472 of file room.h.

References stair1_, and destination::target.

Referenced by yaze::zelda3::LoadRoomHeaderFromRom().

◆ SetStair2Target()

void yaze::zelda3::Room::SetStair2Target ( uint8_t target)
inline

Definition at line 473 of file room.h.

References stair2_, and destination::target.

Referenced by yaze::zelda3::LoadRoomHeaderFromRom().

◆ SetStair3Target()

void yaze::zelda3::Room::SetStair3Target ( uint8_t target)
inline

Definition at line 474 of file room.h.

References stair3_, and destination::target.

Referenced by yaze::zelda3::LoadRoomHeaderFromRom().

◆ SetStair4Target()

void yaze::zelda3::Room::SetStair4Target ( uint8_t target)
inline

Definition at line 475 of file room.h.

References stair4_, and destination::target.

Referenced by yaze::zelda3::LoadRoomHeaderFromRom().

◆ IsLoaded()

bool yaze::zelda3::Room::IsLoaded ( ) const
inline

◆ SetLoaded()

void yaze::zelda3::Room::SetLoaded ( bool loaded)
inline

Definition at line 479 of file room.h.

References is_loaded_.

Referenced by yaze::zelda3::LoadRoomFromRom().

◆ effect()

EffectKey yaze::zelda3::Room::effect ( ) const
inline

Definition at line 482 of file room.h.

References effect_.

Referenced by SetEffect().

◆ tag1()

TagKey yaze::zelda3::Room::tag1 ( ) const
inline

Definition at line 483 of file room.h.

References tag1_.

Referenced by SetTag1(), and SetTag1Direct().

◆ tag2()

TagKey yaze::zelda3::Room::tag2 ( ) const
inline

Definition at line 484 of file room.h.

References tag2_.

Referenced by SetTag2(), and SetTag2Direct().

◆ collision()

CollisionKey yaze::zelda3::Room::collision ( ) const
inline

Definition at line 485 of file room.h.

References collision_.

Referenced by SetCollision().

◆ layer_merging()

const LayerMergeType & yaze::zelda3::Room::layer_merging ( ) const
inline

Definition at line 486 of file room.h.

References layer_merging_.

◆ id()

int yaze::zelda3::Room::id ( ) const
inline

◆ floor1()

uint8_t yaze::zelda3::Room::floor1 ( ) const
inline

Definition at line 500 of file room.h.

References floor1_graphics_.

Referenced by yaze::editor::DungeonRoomPanel::Draw().

◆ floor2()

uint8_t yaze::zelda3::Room::floor2 ( ) const
inline

Definition at line 501 of file room.h.

References floor2_graphics_.

Referenced by yaze::editor::DungeonRoomPanel::Draw().

◆ set_floor1()

void yaze::zelda3::Room::set_floor1 ( uint8_t value)
inline

Definition at line 502 of file room.h.

References floor1_graphics_, and MarkGraphicsDirty().

Referenced by yaze::editor::DungeonRoomPanel::Draw().

Here is the call graph for this function:

◆ set_floor2()

void yaze::zelda3::Room::set_floor2 ( uint8_t value)
inline

Definition at line 508 of file room.h.

References floor2_graphics_, and MarkGraphicsDirty().

Referenced by yaze::editor::DungeonRoomPanel::Draw().

Here is the call graph for this function:

◆ ParseObjectsFromLocation()

◆ HandleSpecialObjects()

void yaze::zelda3::Room::HandleSpecialObjects ( short oid,
uint8_t posX,
uint8_t posY,
int & nbr_of_staircase )

◆ SaveObjects()

◆ EncodeObjects()

std::vector< uint8_t > yaze::zelda3::Room::EncodeObjects ( ) const

Definition at line 1289 of file room.cc.

References tile_objects_.

Referenced by SaveObjects().

◆ SaveSprites()

◆ EncodeSprites()

std::vector< uint8_t > yaze::zelda3::Room::EncodeSprites ( ) const

Definition at line 1346 of file room.cc.

References sprites_.

Referenced by SaveSprites().

◆ blocks()

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

Definition at line 525 of file room.h.

References blocks_.

Referenced by yaze::editor::DungeonRoomPanel::Draw().

◆ mutable_blocks()

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

Definition at line 526 of file room.h.

References blocks_.

◆ rom()

◆ mutable_rom()

auto yaze::zelda3::Room::mutable_rom ( )
inline

Definition at line 528 of file room.h.

References rom_.

◆ SetRom()

void yaze::zelda3::Room::SetRom ( Rom * rom)
inline

Definition at line 529 of file room.h.

References rom(), and rom_.

Here is the call graph for this function:

◆ game_data()

auto yaze::zelda3::Room::game_data ( )
inline

Definition at line 530 of file room.h.

References game_data_.

◆ SetGameData()

◆ version_constants()

zelda3_version_pointers yaze::zelda3::Room::version_constants ( ) const
inline

Definition at line 534 of file room.h.

References game_data_, and yaze::zelda3::GameData::version.

Referenced by LoadAnimatedGraphics().

◆ get_gfx_buffer()

◆ bg1_buffer() [1/2]

◆ bg2_buffer() [1/2]

auto & yaze::zelda3::Room::bg2_buffer ( )
inline

◆ bg1_buffer() [2/2]

const auto & yaze::zelda3::Room::bg1_buffer ( ) const
inline

Definition at line 544 of file room.h.

References bg1_buffer_.

◆ bg2_buffer() [2/2]

const auto & yaze::zelda3::Room::bg2_buffer ( ) const
inline

Definition at line 545 of file room.h.

References bg2_buffer_.

◆ object_bg1_buffer() [1/2]

auto & yaze::zelda3::Room::object_bg1_buffer ( )
inline

◆ object_bg1_buffer() [2/2]

const auto & yaze::zelda3::Room::object_bg1_buffer ( ) const
inline

Definition at line 547 of file room.h.

References object_bg1_buffer_.

◆ object_bg2_buffer() [1/2]

auto & yaze::zelda3::Room::object_bg2_buffer ( )
inline

◆ object_bg2_buffer() [2/2]

const auto & yaze::zelda3::Room::object_bg2_buffer ( ) const
inline

Definition at line 549 of file room.h.

References object_bg2_buffer_.

◆ GetCompositeBitmap()

gfx::Bitmap & yaze::zelda3::Room::GetCompositeBitmap ( RoomLayerManager & layer_mgr)

Get a composite bitmap of all layers merged.

Definition at line 510 of file room.cc.

References composite_bitmap_, composite_dirty_, and yaze::zelda3::RoomLayerManager::CompositeToOutput().

Here is the call graph for this function:

◆ composite_bitmap()

const gfx::Bitmap & yaze::zelda3::Room::composite_bitmap ( ) const
inline

Definition at line 553 of file room.h.

References composite_bitmap_.

◆ MarkCompositeDirty()

void yaze::zelda3::Room::MarkCompositeDirty ( )
inline

Mark composite bitmap as needing regeneration.

Definition at line 556 of file room.h.

References composite_dirty_.

◆ IsCompositeDirty()

bool yaze::zelda3::Room::IsCompositeDirty ( ) const
inline

Definition at line 557 of file room.h.

References composite_dirty_.

◆ GetDungeonState()

DungeonState * yaze::zelda3::Room::GetDungeonState ( )
inline

Definition at line 559 of file room.h.

References dungeon_state_.

Member Data Documentation

◆ blockset

◆ spriteset

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

Definition at line 491 of file room.h.

Referenced by LoadRoomGraphics(), RenderRoomGraphics(), and SetSpriteset().

◆ palette

◆ layout

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

Definition at line 493 of file room.h.

Referenced by LoadLayoutTilesToBuffer(), LoadObjects(), and RenderRoomGraphics().

◆ holewarp

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

Definition at line 494 of file room.h.

Referenced by SetHolewarp().

◆ message_id_

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

Definition at line 497 of file room.h.

Referenced by SetMessageId(), and SetMessageIdDirect().

◆ rom_

◆ game_data_

◆ current_gfx16_

std::array<uint8_t, 0x10000> yaze::zelda3::Room::current_gfx16_
private

◆ bg1_buffer_

gfx::BackgroundBuffer yaze::zelda3::Room::bg1_buffer_ {512, 512}
private

◆ bg2_buffer_

gfx::BackgroundBuffer yaze::zelda3::Room::bg2_buffer_ {512, 512}
private

◆ object_bg1_buffer_

gfx::BackgroundBuffer yaze::zelda3::Room::object_bg1_buffer_ {512, 512}
private

◆ object_bg2_buffer_

gfx::BackgroundBuffer yaze::zelda3::Room::object_bg2_buffer_ {512, 512}
private

◆ composite_bitmap_

gfx::Bitmap yaze::zelda3::Room::composite_bitmap_
mutableprivate

Definition at line 575 of file room.h.

Referenced by composite_bitmap(), and GetCompositeBitmap().

◆ composite_dirty_

bool yaze::zelda3::Room::composite_dirty_ = true
mutableprivate

◆ is_light_

bool yaze::zelda3::Room::is_light_
private

Definition at line 578 of file room.h.

Referenced by IsLight(), and SetIsLight().

◆ is_loaded_

bool yaze::zelda3::Room::is_loaded_ = false
private

Definition at line 579 of file room.h.

Referenced by IsLoaded(), and SetLoaded().

◆ is_dark_

bool yaze::zelda3::Room::is_dark_
private

Definition at line 580 of file room.h.

Referenced by SetIsDark().

◆ is_floor_

bool yaze::zelda3::Room::is_floor_ = true
private

Definition at line 581 of file room.h.

Referenced by LoadObjects().

◆ cached_blockset_

uint8_t yaze::zelda3::Room::cached_blockset_ = 0xFF
private

Definition at line 585 of file room.h.

Referenced by RenderRoomGraphics().

◆ cached_spriteset_

uint8_t yaze::zelda3::Room::cached_spriteset_ = 0xFF
private

Definition at line 586 of file room.h.

Referenced by RenderRoomGraphics().

◆ cached_palette_

uint8_t yaze::zelda3::Room::cached_palette_ = 0xFF
private

Definition at line 587 of file room.h.

Referenced by RenderRoomGraphics().

◆ cached_layout_

uint8_t yaze::zelda3::Room::cached_layout_ = 0xFF
private

Definition at line 588 of file room.h.

Referenced by RenderRoomGraphics().

◆ cached_floor1_graphics_

uint8_t yaze::zelda3::Room::cached_floor1_graphics_ = 0xFF
private

Definition at line 589 of file room.h.

Referenced by RenderRoomGraphics().

◆ cached_floor2_graphics_

uint8_t yaze::zelda3::Room::cached_floor2_graphics_ = 0xFF
private

Definition at line 590 of file room.h.

Referenced by RenderRoomGraphics().

◆ cached_effect_

uint8_t yaze::zelda3::Room::cached_effect_ = 0xFF
private

Definition at line 591 of file room.h.

Referenced by RenderRoomGraphics().

◆ cached_tag1_

TagKey yaze::zelda3::Room::cached_tag1_ = TagKey::Nothing
private

Definition at line 592 of file room.h.

Referenced by RenderRoomGraphics().

◆ cached_tag2_

TagKey yaze::zelda3::Room::cached_tag2_ = TagKey::Nothing
private

Definition at line 593 of file room.h.

Referenced by RenderRoomGraphics().

◆ graphics_dirty_

bool yaze::zelda3::Room::graphics_dirty_ = true
private

Definition at line 596 of file room.h.

Referenced by MarkGraphicsDirty(), RenderObjectsToBackground(), and RenderRoomGraphics().

◆ objects_dirty_

bool yaze::zelda3::Room::objects_dirty_ = true
private

Definition at line 597 of file room.h.

Referenced by MarkObjectsDirty(), RenderObjectsToBackground(), and RenderRoomGraphics().

◆ layout_dirty_

bool yaze::zelda3::Room::layout_dirty_ = true
private

Definition at line 598 of file room.h.

Referenced by MarkLayoutDirty(), and RenderRoomGraphics().

◆ textures_dirty_

bool yaze::zelda3::Room::textures_dirty_ = true
private

Definition at line 599 of file room.h.

Referenced by MarkGraphicsDirty(), MarkLayoutDirty(), MarkObjectsDirty(), and RenderRoomGraphics().

◆ room_id_

◆ animated_frame_

int yaze::zelda3::Room::animated_frame_
private

Definition at line 602 of file room.h.

Referenced by LoadAnimatedGraphics().

◆ staircase_plane_

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

Definition at line 604 of file room.h.

Referenced by SetStaircasePlane().

◆ staircase_rooms_

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

Definition at line 605 of file room.h.

Referenced by HandleSpecialObjects(), and SetStaircaseRoom().

◆ background_tileset_

uint8_t yaze::zelda3::Room::background_tileset_
private

Definition at line 607 of file room.h.

Referenced by LoadAnimatedGraphics(), and SetBackgroundTileset().

◆ sprite_tileset_

uint8_t yaze::zelda3::Room::sprite_tileset_
private

Definition at line 608 of file room.h.

Referenced by SetSpriteTileset().

◆ layer2_behavior_

uint8_t yaze::zelda3::Room::layer2_behavior_
private

Definition at line 609 of file room.h.

Referenced by SetLayer2Behavior().

◆ palette_

uint8_t yaze::zelda3::Room::palette_
private

Definition at line 610 of file room.h.

Referenced by SetPaletteDirect().

◆ floor1_graphics_

uint8_t yaze::zelda3::Room::floor1_graphics_
private

Definition at line 611 of file room.h.

Referenced by floor1(), LoadObjects(), RenderRoomGraphics(), and set_floor1().

◆ floor2_graphics_

uint8_t yaze::zelda3::Room::floor2_graphics_
private

Definition at line 612 of file room.h.

Referenced by floor2(), LoadObjects(), RenderRoomGraphics(), and set_floor2().

◆ layer2_mode_

uint8_t yaze::zelda3::Room::layer2_mode_
private

Definition at line 613 of file room.h.

Referenced by SetLayer2Mode().

◆ blocks_

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

◆ chest_list_

std::array<chest, 16> yaze::zelda3::Room::chest_list_
private

Definition at line 616 of file room.h.

◆ tile_objects_

◆ sprites_

std::vector<zelda3::Sprite> yaze::zelda3::Room::sprites_
private
Todo
add separate door objects list when door section (F0 FF) is parsed

Definition at line 620 of file room.h.

Referenced by EncodeSprites(), GetSprites(), GetSprites(), LoadSprites(), and RenderObjectsToBackground().

◆ z3_staircases_

std::vector<staircase> yaze::zelda3::Room::z3_staircases_
private

Definition at line 621 of file room.h.

Referenced by GetStairs(), GetStairs(), HandleSpecialObjects(), and ParseObjectsFromLocation().

◆ chests_in_room_

std::vector<chest_data> yaze::zelda3::Room::chests_in_room_
private

Definition at line 622 of file room.h.

Referenced by GetChests(), GetChests(), HandleSpecialObjects(), and LoadChests().

◆ doors_

std::vector<Door> yaze::zelda3::Room::doors_
private

◆ pot_items_

std::vector<PotItem> yaze::zelda3::Room::pot_items_
private

Definition at line 624 of file room.h.

Referenced by GetPotItems(), GetPotItems(), LoadPotItems(), and RenderObjectsToBackground().

◆ layout_

RoomLayout yaze::zelda3::Room::layout_
private

Definition at line 625 of file room.h.

Referenced by GetLayout(), and LoadLayoutTilesToBuffer().

◆ layer_merging_

LayerMergeType yaze::zelda3::Room::layer_merging_
private

Definition at line 627 of file room.h.

Referenced by layer_merging(), RenderRoomGraphics(), and SetLayerMerging().

◆ collision_

CollisionKey yaze::zelda3::Room::collision_
private

Definition at line 628 of file room.h.

Referenced by collision(), and SetCollision().

◆ effect_

EffectKey yaze::zelda3::Room::effect_
private

Definition at line 629 of file room.h.

Referenced by effect(), RenderRoomGraphics(), and SetEffect().

◆ tag1_

TagKey yaze::zelda3::Room::tag1_
private

Definition at line 630 of file room.h.

Referenced by RenderRoomGraphics(), SetTag1(), SetTag1Direct(), and tag1().

◆ tag2_

TagKey yaze::zelda3::Room::tag2_
private

Definition at line 631 of file room.h.

Referenced by RenderRoomGraphics(), SetTag2(), SetTag2Direct(), and tag2().

◆ bg2_

background2 yaze::zelda3::Room::bg2_
private

Definition at line 633 of file room.h.

Referenced by SetBg2().

◆ pits_

destination yaze::zelda3::Room::pits_
private

Definition at line 634 of file room.h.

Referenced by LoadPits(), SetPitsTarget(), and SetPitsTargetLayer().

◆ stair1_

destination yaze::zelda3::Room::stair1_
private

Definition at line 635 of file room.h.

Referenced by SetStair1Target(), and SetStair1TargetLayer().

◆ stair2_

destination yaze::zelda3::Room::stair2_
private

Definition at line 636 of file room.h.

Referenced by SetStair2Target(), and SetStair2TargetLayer().

◆ stair3_

destination yaze::zelda3::Room::stair3_
private

Definition at line 637 of file room.h.

Referenced by SetStair3Target(), and SetStair3TargetLayer().

◆ stair4_

destination yaze::zelda3::Room::stair4_
private

Definition at line 638 of file room.h.

Referenced by SetStair4Target(), and SetStair4TargetLayer().

◆ dungeon_state_

std::unique_ptr<DungeonState> yaze::zelda3::Room::dungeon_state_
private

Definition at line 640 of file room.h.

Referenced by GetDungeonState(), LoadLayoutTilesToBuffer(), and RenderObjectsToBackground().


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