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

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

#include <room.h>

Public Member Functions

std::pair< int, int > GetTileCoords () const
 Get tile coordinates for this door.
 
std::pair< int, int > GetPixelCoords () const
 Get pixel coordinates for this door.
 
DoorDimensions GetDimensions () const
 Get door dimensions in tiles.
 
std::tuple< int, int, int, int > GetBounds () const
 Get bounding rectangle (x, y, width, height in pixels)
 
std::string_view GetTypeName () const
 Get human-readable type name.
 
std::string_view GetDirectionName () const
 Get human-readable direction name.
 
std::pair< uint8_t, uint8_t > EncodeBytes () const
 Encode door data for ROM storage.
 

Static Public Member Functions

static Door FromRomBytes (uint8_t b1, uint8_t b2)
 

Public Attributes

uint8_t position
 Encoded position (5-bit, 0-31)
 
DoorType type
 Door type (determines appearance/behavior)
 
DoorDirection direction
 Which wall the door is on.
 
uint8_t byte1
 Original ROM byte 1 (position data)
 
uint8_t byte2
 Original ROM byte 2 (type + direction)
 

Detailed Description

Represents a door in a dungeon room.

Doors connect rooms and can have various types (locked, bombable, etc.) They are placed at fixed positions along room walls.

Definition at line 263 of file room.h.

Member Function Documentation

◆ GetTileCoords()

std::pair< int, int > yaze::zelda3::Room::Door::GetTileCoords ( ) const
inline

Get tile coordinates for this door.

Definition at line 272 of file room.h.

References direction, position, and yaze::zelda3::DoorPositionManager::PositionToTileCoords().

Here is the call graph for this function:

◆ GetPixelCoords()

std::pair< int, int > yaze::zelda3::Room::Door::GetPixelCoords ( ) const
inline

Get pixel coordinates for this door.

Definition at line 277 of file room.h.

References direction, position, and yaze::zelda3::DoorPositionManager::PositionToPixelCoords().

Here is the call graph for this function:

◆ GetDimensions()

DoorDimensions yaze::zelda3::Room::Door::GetDimensions ( ) const
inline

Get door dimensions in tiles.

Definition at line 282 of file room.h.

References direction, and yaze::zelda3::GetDoorDimensions().

Here is the call graph for this function:

◆ GetBounds()

std::tuple< int, int, int, int > yaze::zelda3::Room::Door::GetBounds ( ) const
inline

Get bounding rectangle (x, y, width, height in pixels)

Definition at line 287 of file room.h.

References direction, yaze::zelda3::DoorPositionManager::GetDoorBounds(), and position.

Here is the call graph for this function:

◆ GetTypeName()

std::string_view yaze::zelda3::Room::Door::GetTypeName ( ) const
inline

Get human-readable type name.

Definition at line 292 of file room.h.

References yaze::zelda3::GetDoorTypeName(), and type.

Here is the call graph for this function:

◆ GetDirectionName()

std::string_view yaze::zelda3::Room::Door::GetDirectionName ( ) const
inline

Get human-readable direction name.

Definition at line 297 of file room.h.

References direction, and yaze::zelda3::GetDoorDirectionName().

Here is the call graph for this function:

◆ EncodeBytes()

std::pair< uint8_t, uint8_t > yaze::zelda3::Room::Door::EncodeBytes ( ) const
inline

Encode door data for ROM storage.

Definition at line 302 of file room.h.

References direction, yaze::zelda3::DoorPositionManager::EncodeDoorBytes(), position, and type.

Referenced by yaze::editor::DungeonObjectInteraction::PlaceDoorAtPosition(), and yaze::editor::DoorInteractionHandler::PlaceDoorAtSnappedPosition().

Here is the call graph for this function:

◆ FromRomBytes()

static Door yaze::zelda3::Room::Door::FromRomBytes ( uint8_t b1,
uint8_t b2 )
inlinestatic

Create a door from raw ROM bytes Format (from ASM RoomDraw_DoorObject): b1: bits 4-7 = position index, bits 0-1 = direction b2: door type (full byte, values 0x00, 0x02, 0x04, etc.)

Definition at line 310 of file room.h.

References byte1, byte2, direction, yaze::zelda3::DoorDirectionFromRaw(), yaze::zelda3::DoorTypeFromRaw(), position, and type.

Referenced by yaze::zelda3::Room::ParseObjectsFromLocation().

Here is the call graph for this function:

Member Data Documentation

◆ position

uint8_t yaze::zelda3::Room::Door::position

◆ type

DoorType yaze::zelda3::Room::Door::type

◆ direction

◆ byte1

uint8_t yaze::zelda3::Room::Door::byte1

◆ byte2

uint8_t yaze::zelda3::Room::Door::byte2

The documentation for this struct was generated from the following file: