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

#include <room_object.h>

Collaboration diagram for yaze::zelda3::RoomObject:

Classes

struct  ObjectBytes
 

Public Types

enum  LayerType { BG1 = 0 , BG2 = 1 , BG3 = 2 }
 

Public Member Functions

 RoomObject (int16_t id, uint8_t x, uint8_t y, uint8_t size, uint8_t layer=0)
 
void set_rom (Rom *rom)
 
auto rom ()
 
auto mutable_rom ()
 
void set_x (uint8_t x)
 
void set_y (uint8_t y)
 
void set_size (uint8_t size)
 
uint8_t x () const
 
uint8_t y () const
 
uint8_t size () const
 
void EnsureTilesLoaded ()
 
absl::Status LoadTilesWithParser ()
 
const std::vector< gfx::TileInfo > & tiles () const
 
std::vector< gfx::TileInfo > & mutable_tiles ()
 
absl::StatusOr< std::span< const gfx::TileInfo > > GetTiles () const
 
absl::StatusOr< const gfx::TileInfo * > GetTile (int index) const
 
int GetTileCount () const
 
ObjectBytes EncodeObjectToBytes () const
 
uint8_t GetLayerValue () const
 
auto options () const
 
void set_options (ObjectOption options)
 

Static Public Member Functions

static RoomObject DecodeObjectFromBytes (uint8_t b1, uint8_t b2, uint8_t b3, uint8_t layer)
 
static int DetermineObjectType (uint8_t b1, uint8_t b3)
 

Public Attributes

bool all_bgs_ = false
 
bool lit_ = false
 
int16_t id_
 
uint8_t x_
 
uint8_t y_
 
uint8_t size_
 
uint8_t nx_
 
uint8_t ny_
 
uint8_t ox_
 
uint8_t oy_
 
uint8_t z_ = 0
 
uint8_t previous_size_ = 0
 
uint8_t size_x_bits_ = 0
 
uint8_t size_y_bits_ = 0
 
int width_
 
int height_
 
int offset_x_ = 0
 
int offset_y_ = 0
 
std::string name_
 
std::vector< uint8_t > preview_object_data_
 
std::vector< gfx::TileInfotiles_
 
bool tiles_loaded_ = false
 
int tile_count_ = 0
 
int tile_data_ptr_ = -1
 
LayerType layer_
 
ObjectOption options_ = ObjectOption::Nothing
 
Romrom_
 

Detailed Description

Definition at line 49 of file room_object.h.

Member Enumeration Documentation

◆ LayerType

Enumerator
BG1 
BG2 
BG3 

Definition at line 51 of file room_object.h.

Constructor & Destructor Documentation

◆ RoomObject()

yaze::zelda3::RoomObject::RoomObject ( int16_t  id,
uint8_t  x,
uint8_t  y,
uint8_t  size,
uint8_t  layer = 0 
)
inline

Definition at line 53 of file room_object.h.

Member Function Documentation

◆ set_rom()

◆ rom()

auto yaze::zelda3::RoomObject::rom ( )
inline

Definition at line 68 of file room_object.h.

References rom_.

Referenced by set_rom().

◆ mutable_rom()

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

Definition at line 69 of file room_object.h.

References rom_.

◆ set_x()

void yaze::zelda3::RoomObject::set_x ( uint8_t  x)
inline

◆ set_y()

void yaze::zelda3::RoomObject::set_y ( uint8_t  y)
inline

Definition at line 73 of file room_object.h.

References y(), and y_.

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

Here is the call graph for this function:

◆ set_size()

void yaze::zelda3::RoomObject::set_size ( uint8_t  size)
inline

Definition at line 74 of file room_object.h.

References size(), and size_.

Here is the call graph for this function:

◆ x()

◆ y()

◆ size()

◆ EnsureTilesLoaded()

◆ LoadTilesWithParser()

absl::Status yaze::zelda3::RoomObject::LoadTilesWithParser ( )

Definition at line 107 of file room_object.cc.

References id_, yaze::zelda3::ObjectParser::ParseObject(), rom_, tile_count_, and tiles_.

Referenced by EnsureTilesLoaded().

Here is the call graph for this function:

◆ tiles()

const std::vector< gfx::TileInfo > & yaze::zelda3::RoomObject::tiles ( ) const
inline

Definition at line 87 of file room_object.h.

References tiles_.

Referenced by yaze::zelda3::ObjectDrawer::DrawObject().

◆ mutable_tiles()

std::vector< gfx::TileInfo > & yaze::zelda3::RoomObject::mutable_tiles ( )
inline

Definition at line 88 of file room_object.h.

References tiles_.

◆ GetTiles()

absl::StatusOr< std::span< const gfx::TileInfo > > yaze::zelda3::RoomObject::GetTiles ( ) const

Definition at line 123 of file room_object.cc.

References EnsureTilesLoaded(), tiles_, and tiles_loaded_.

Here is the call graph for this function:

◆ GetTile()

absl::StatusOr< const gfx::TileInfo * > yaze::zelda3::RoomObject::GetTile ( int  index) const

Definition at line 135 of file room_object.cc.

References EnsureTilesLoaded(), tiles_, and tiles_loaded_.

Here is the call graph for this function:

◆ GetTileCount()

int yaze::zelda3::RoomObject::GetTileCount ( ) const

Definition at line 148 of file room_object.cc.

References EnsureTilesLoaded(), tile_count_, and tiles_loaded_.

Here is the call graph for this function:

◆ DecodeObjectFromBytes()

RoomObject yaze::zelda3::RoomObject::DecodeObjectFromBytes ( uint8_t  b1,
uint8_t  b2,
uint8_t  b3,
uint8_t  layer 
)
static

◆ EncodeObjectToBytes()

◆ DetermineObjectType()

◆ GetLayerValue()

uint8_t yaze::zelda3::RoomObject::GetLayerValue ( ) const
inline

◆ options()

auto yaze::zelda3::RoomObject::options ( ) const
inline

Definition at line 132 of file room_object.h.

References options_.

Referenced by set_options().

◆ set_options()

void yaze::zelda3::RoomObject::set_options ( ObjectOption  options)
inline

Definition at line 133 of file room_object.h.

References options(), and options_.

Referenced by yaze::zelda3::Room::LoadBlocks(), and yaze::zelda3::Room::LoadTorches().

Here is the call graph for this function:

Member Data Documentation

◆ all_bgs_

bool yaze::zelda3::RoomObject::all_bgs_ = false

Definition at line 135 of file room_object.h.

◆ lit_

bool yaze::zelda3::RoomObject::lit_ = false

Definition at line 136 of file room_object.h.

◆ id_

◆ x_

uint8_t yaze::zelda3::RoomObject::x_

Definition at line 139 of file room_object.h.

Referenced by yaze::zelda3::ObjectDrawer::CustomDraw(), yaze::zelda3::ObjectDrawer::DrawDiagonalAcute_1to16(), yaze::zelda3::ObjectDrawer::DrawDiagonalGrave_1to16(), yaze::zelda3::ObjectDrawer::DrawDoorSwitcherer(), yaze::zelda3::ObjectDrawer::DrawDownwards2x2_1to15or32(), yaze::zelda3::ObjectDrawer::DrawDownwards2x2_1to16(), yaze::zelda3::ObjectDrawer::DrawDownwards4x2_1to15or26(), yaze::zelda3::ObjectDrawer::DrawDownwardsDecor4x2spaced4_1to16(), yaze::zelda3::ObjectDrawer::DrawDownwardsEdge1x1_1to16(), yaze::zelda3::ObjectDrawer::DrawDownwardsHasEdge1x1_1to16_plus3(), yaze::zelda3::ObjectDrawer::DrawDownwardsLeftCorners2x1_1to16_plus12(), yaze::zelda3::ObjectDrawer::DrawDownwardsRightCorners2x1_1to16_plus12(), yaze::editor::DungeonObjectSelector::DrawObjectRenderer(), yaze::zelda3::ObjectDrawer::DrawRightwards1x1Solid_1to16_plus3(), yaze::zelda3::ObjectDrawer::DrawRightwards1x2_1to16_plus2(), yaze::zelda3::ObjectDrawer::DrawRightwards2x2_1to15or32(), yaze::zelda3::ObjectDrawer::DrawRightwards2x2_1to16(), yaze::zelda3::ObjectDrawer::DrawRightwards2x4_1to15or26(), yaze::zelda3::ObjectDrawer::DrawRightwards2x4spaced4_1to16(), yaze::zelda3::ObjectDrawer::DrawRightwards4x4_1to16(), yaze::zelda3::ObjectDrawer::DrawRightwardsBottomCorners1x2_1to16_plus13(), yaze::zelda3::ObjectDrawer::DrawRightwardsDecor2x2spaced12_1to16(), yaze::zelda3::ObjectDrawer::DrawRightwardsDecor4x3spaced4_1to16(), yaze::zelda3::ObjectDrawer::DrawRightwardsDecor4x4spaced2_1to16(), yaze::zelda3::ObjectDrawer::DrawRightwardsDoubled2x2spaced2_1to16(), yaze::zelda3::ObjectDrawer::DrawRightwardsHasEdge1x1_1to16_plus2(), yaze::zelda3::ObjectDrawer::DrawRightwardsHasEdge1x1_1to16_plus3(), yaze::zelda3::ObjectDrawer::DrawRightwardsPillar2x4spaced4_1to16(), yaze::zelda3::ObjectDrawer::DrawRightwardsStatue2x3spaced2_1to16(), yaze::zelda3::ObjectDrawer::DrawRightwardsTopCorners1x2_1to16_plus13(), EncodeObjectToBytes(), yaze::zelda3::DungeonObjectEditor::ObjectsCollide(), yaze::editor::DungeonObjectInteraction::PlaceObjectAtPosition(), set_x(), yaze::test::TEST_F(), and x().

◆ y_

uint8_t yaze::zelda3::RoomObject::y_

Definition at line 140 of file room_object.h.

Referenced by yaze::zelda3::ObjectDrawer::CustomDraw(), yaze::zelda3::ObjectDrawer::DrawDiagonalAcute_1to16(), yaze::zelda3::ObjectDrawer::DrawDiagonalGrave_1to16(), yaze::zelda3::ObjectDrawer::DrawDoorSwitcherer(), yaze::zelda3::ObjectDrawer::DrawDownwards2x2_1to15or32(), yaze::zelda3::ObjectDrawer::DrawDownwards2x2_1to16(), yaze::zelda3::ObjectDrawer::DrawDownwards4x2_1to15or26(), yaze::zelda3::ObjectDrawer::DrawDownwardsDecor4x2spaced4_1to16(), yaze::zelda3::ObjectDrawer::DrawDownwardsEdge1x1_1to16(), yaze::zelda3::ObjectDrawer::DrawDownwardsHasEdge1x1_1to16_plus3(), yaze::zelda3::ObjectDrawer::DrawDownwardsLeftCorners2x1_1to16_plus12(), yaze::zelda3::ObjectDrawer::DrawDownwardsRightCorners2x1_1to16_plus12(), yaze::editor::DungeonObjectSelector::DrawObjectRenderer(), yaze::zelda3::ObjectDrawer::DrawRightwards1x1Solid_1to16_plus3(), yaze::zelda3::ObjectDrawer::DrawRightwards1x2_1to16_plus2(), yaze::zelda3::ObjectDrawer::DrawRightwards2x2_1to15or32(), yaze::zelda3::ObjectDrawer::DrawRightwards2x2_1to16(), yaze::zelda3::ObjectDrawer::DrawRightwards2x4_1to15or26(), yaze::zelda3::ObjectDrawer::DrawRightwards2x4spaced4_1to16(), yaze::zelda3::ObjectDrawer::DrawRightwards4x4_1to16(), yaze::zelda3::ObjectDrawer::DrawRightwardsBottomCorners1x2_1to16_plus13(), yaze::zelda3::ObjectDrawer::DrawRightwardsDecor2x2spaced12_1to16(), yaze::zelda3::ObjectDrawer::DrawRightwardsDecor4x3spaced4_1to16(), yaze::zelda3::ObjectDrawer::DrawRightwardsDecor4x4spaced2_1to16(), yaze::zelda3::ObjectDrawer::DrawRightwardsDoubled2x2spaced2_1to16(), yaze::zelda3::ObjectDrawer::DrawRightwardsHasEdge1x1_1to16_plus2(), yaze::zelda3::ObjectDrawer::DrawRightwardsHasEdge1x1_1to16_plus3(), yaze::zelda3::ObjectDrawer::DrawRightwardsPillar2x4spaced4_1to16(), yaze::zelda3::ObjectDrawer::DrawRightwardsStatue2x3spaced2_1to16(), yaze::zelda3::ObjectDrawer::DrawRightwardsTopCorners1x2_1to16_plus13(), EncodeObjectToBytes(), yaze::zelda3::DungeonObjectEditor::ObjectsCollide(), set_y(), yaze::test::TEST_F(), and y().

◆ size_

uint8_t yaze::zelda3::RoomObject::size_

Definition at line 141 of file room_object.h.

Referenced by yaze::zelda3::ObjectDrawer::DrawDiagonalAcute_1to16(), yaze::zelda3::ObjectDrawer::DrawDiagonalGrave_1to16(), yaze::zelda3::ObjectDrawer::DrawDownwards2x2_1to15or32(), yaze::zelda3::ObjectDrawer::DrawDownwards2x2_1to16(), yaze::zelda3::ObjectDrawer::DrawDownwards4x2_1to15or26(), yaze::zelda3::ObjectDrawer::DrawDownwardsDecor4x2spaced4_1to16(), yaze::zelda3::ObjectDrawer::DrawDownwardsEdge1x1_1to16(), yaze::zelda3::ObjectDrawer::DrawDownwardsHasEdge1x1_1to16_plus3(), yaze::zelda3::ObjectDrawer::DrawDownwardsLeftCorners2x1_1to16_plus12(), yaze::zelda3::ObjectDrawer::DrawDownwardsRightCorners2x1_1to16_plus12(), yaze::editor::DungeonObjectSelector::DrawObjectBrowser(), yaze::editor::DungeonObjectSelector::DrawObjectRenderer(), yaze::zelda3::ObjectDrawer::DrawRightwards1x1Solid_1to16_plus3(), yaze::zelda3::ObjectDrawer::DrawRightwards1x2_1to16_plus2(), yaze::zelda3::ObjectDrawer::DrawRightwards2x2_1to15or32(), yaze::zelda3::ObjectDrawer::DrawRightwards2x2_1to16(), yaze::zelda3::ObjectDrawer::DrawRightwards2x4_1to15or26(), yaze::zelda3::ObjectDrawer::DrawRightwards2x4spaced4_1to16(), yaze::zelda3::ObjectDrawer::DrawRightwards4x4_1to16(), yaze::zelda3::ObjectDrawer::DrawRightwardsBottomCorners1x2_1to16_plus13(), yaze::zelda3::ObjectDrawer::DrawRightwardsDecor2x2spaced12_1to16(), yaze::zelda3::ObjectDrawer::DrawRightwardsDecor4x3spaced4_1to16(), yaze::zelda3::ObjectDrawer::DrawRightwardsDecor4x4spaced2_1to16(), yaze::zelda3::ObjectDrawer::DrawRightwardsDoubled2x2spaced2_1to16(), yaze::zelda3::ObjectDrawer::DrawRightwardsHasEdge1x1_1to16_plus2(), yaze::zelda3::ObjectDrawer::DrawRightwardsHasEdge1x1_1to16_plus3(), yaze::zelda3::ObjectDrawer::DrawRightwardsPillar2x4spaced4_1to16(), yaze::zelda3::ObjectDrawer::DrawRightwardsStatue2x3spaced2_1to16(), yaze::zelda3::ObjectDrawer::DrawRightwardsTopCorners1x2_1to16_plus13(), EncodeObjectToBytes(), yaze::zelda3::DungeonObjectEditor::ObjectsCollide(), set_size(), and size().

◆ nx_

uint8_t yaze::zelda3::RoomObject::nx_

Definition at line 142 of file room_object.h.

◆ ny_

uint8_t yaze::zelda3::RoomObject::ny_

Definition at line 143 of file room_object.h.

◆ ox_

uint8_t yaze::zelda3::RoomObject::ox_

Definition at line 144 of file room_object.h.

◆ oy_

uint8_t yaze::zelda3::RoomObject::oy_

Definition at line 145 of file room_object.h.

◆ z_

uint8_t yaze::zelda3::RoomObject::z_ = 0

Definition at line 146 of file room_object.h.

◆ previous_size_

uint8_t yaze::zelda3::RoomObject::previous_size_ = 0

Definition at line 147 of file room_object.h.

◆ size_x_bits_

uint8_t yaze::zelda3::RoomObject::size_x_bits_ = 0

Definition at line 150 of file room_object.h.

◆ size_y_bits_

uint8_t yaze::zelda3::RoomObject::size_y_bits_ = 0

Definition at line 151 of file room_object.h.

◆ width_

int yaze::zelda3::RoomObject::width_

Definition at line 153 of file room_object.h.

◆ height_

int yaze::zelda3::RoomObject::height_

Definition at line 154 of file room_object.h.

◆ offset_x_

int yaze::zelda3::RoomObject::offset_x_ = 0

Definition at line 155 of file room_object.h.

◆ offset_y_

int yaze::zelda3::RoomObject::offset_y_ = 0

Definition at line 156 of file room_object.h.

◆ name_

std::string yaze::zelda3::RoomObject::name_

Definition at line 158 of file room_object.h.

◆ preview_object_data_

std::vector<uint8_t> yaze::zelda3::RoomObject::preview_object_data_

Definition at line 160 of file room_object.h.

◆ tiles_

std::vector<gfx::TileInfo> yaze::zelda3::RoomObject::tiles_
mutable

◆ tiles_loaded_

bool yaze::zelda3::RoomObject::tiles_loaded_ = false
mutable

Definition at line 165 of file room_object.h.

Referenced by EnsureTilesLoaded(), GetTile(), GetTileCount(), and GetTiles().

◆ tile_count_

int yaze::zelda3::RoomObject::tile_count_ = 0
mutable

Definition at line 166 of file room_object.h.

Referenced by EnsureTilesLoaded(), GetTileCount(), and LoadTilesWithParser().

◆ tile_data_ptr_

int yaze::zelda3::RoomObject::tile_data_ptr_ = -1
mutable

Definition at line 167 of file room_object.h.

Referenced by EnsureTilesLoaded().

◆ layer_

◆ options_

ObjectOption yaze::zelda3::RoomObject::options_ = ObjectOption::Nothing

Definition at line 170 of file room_object.h.

Referenced by options(), and set_options().

◆ rom_

Rom* yaze::zelda3::RoomObject::rom_

Definition at line 172 of file room_object.h.

Referenced by EnsureTilesLoaded(), LoadTilesWithParser(), mutable_rom(), rom(), and set_rom().


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