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

Draws dungeon objects to background buffers using game patterns. More...

#include <object_drawer.h>

Collaboration diagram for yaze::zelda3::ObjectDrawer:

Public Member Functions

 ObjectDrawer (Rom *rom, const uint8_t *room_gfx_buffer=nullptr)
 
absl::Status DrawObject (const RoomObject &object, gfx::BackgroundBuffer &bg1, gfx::BackgroundBuffer &bg2, const gfx::PaletteGroup &palette_group)
 Draw a room object to background buffers.
 
absl::Status DrawObjectList (const std::vector< RoomObject > &objects, gfx::BackgroundBuffer &bg1, gfx::BackgroundBuffer &bg2, const gfx::PaletteGroup &palette_group)
 Draw all objects in a room.
 
int GetDrawRoutineId (int16_t object_id) const
 Get draw routine ID for an object.
 
void InitializeDrawRoutines ()
 Initialize draw routine registry Must be called before drawing objects.
 
void DrawTileToBitmap (gfx::Bitmap &bitmap, const gfx::TileInfo &tile_info, int pixel_x, int pixel_y, const uint8_t *tiledata)
 Draw a single tile directly to bitmap.
 

Private Types

using DrawRoutine = std::function< void(ObjectDrawer *, const RoomObject &, gfx::BackgroundBuffer &, std::span< const gfx::TileInfo >)>
 

Private Member Functions

void DrawRightwards2x2_1to15or32 (const RoomObject &obj, gfx::BackgroundBuffer &bg, std::span< const gfx::TileInfo > tiles)
 
void DrawRightwards2x4_1to15or26 (const RoomObject &obj, gfx::BackgroundBuffer &bg, std::span< const gfx::TileInfo > tiles)
 
void DrawRightwards2x4spaced4_1to16 (const RoomObject &obj, gfx::BackgroundBuffer &bg, std::span< const gfx::TileInfo > tiles)
 
void DrawRightwards2x4spaced4_1to16_BothBG (const RoomObject &obj, gfx::BackgroundBuffer &bg, std::span< const gfx::TileInfo > tiles)
 
void DrawRightwards2x2_1to16 (const RoomObject &obj, gfx::BackgroundBuffer &bg, std::span< const gfx::TileInfo > tiles)
 
void DrawDiagonalAcute_1to16 (const RoomObject &obj, gfx::BackgroundBuffer &bg, std::span< const gfx::TileInfo > tiles)
 
void DrawDiagonalGrave_1to16 (const RoomObject &obj, gfx::BackgroundBuffer &bg, std::span< const gfx::TileInfo > tiles)
 
void DrawDiagonalAcute_1to16_BothBG (const RoomObject &obj, gfx::BackgroundBuffer &bg, std::span< const gfx::TileInfo > tiles)
 
void DrawDiagonalGrave_1to16_BothBG (const RoomObject &obj, gfx::BackgroundBuffer &bg, std::span< const gfx::TileInfo > tiles)
 
void DrawRightwards1x2_1to16_plus2 (const RoomObject &obj, gfx::BackgroundBuffer &bg, std::span< const gfx::TileInfo > tiles)
 
void DrawRightwardsHasEdge1x1_1to16_plus3 (const RoomObject &obj, gfx::BackgroundBuffer &bg, std::span< const gfx::TileInfo > tiles)
 
void DrawRightwardsHasEdge1x1_1to16_plus2 (const RoomObject &obj, gfx::BackgroundBuffer &bg, std::span< const gfx::TileInfo > tiles)
 
void DrawRightwardsTopCorners1x2_1to16_plus13 (const RoomObject &obj, gfx::BackgroundBuffer &bg, std::span< const gfx::TileInfo > tiles)
 
void DrawRightwardsBottomCorners1x2_1to16_plus13 (const RoomObject &obj, gfx::BackgroundBuffer &bg, std::span< const gfx::TileInfo > tiles)
 
void CustomDraw (const RoomObject &obj, gfx::BackgroundBuffer &bg, std::span< const gfx::TileInfo > tiles)
 
void DrawRightwards4x4_1to16 (const RoomObject &obj, gfx::BackgroundBuffer &bg, std::span< const gfx::TileInfo > tiles)
 
void DrawRightwards1x1Solid_1to16_plus3 (const RoomObject &obj, gfx::BackgroundBuffer &bg, std::span< const gfx::TileInfo > tiles)
 
void DrawDoorSwitcherer (const RoomObject &obj, gfx::BackgroundBuffer &bg, std::span< const gfx::TileInfo > tiles)
 
void DrawRightwardsDecor4x4spaced2_1to16 (const RoomObject &obj, gfx::BackgroundBuffer &bg, std::span< const gfx::TileInfo > tiles)
 
void DrawRightwardsStatue2x3spaced2_1to16 (const RoomObject &obj, gfx::BackgroundBuffer &bg, std::span< const gfx::TileInfo > tiles)
 
void DrawRightwardsPillar2x4spaced4_1to16 (const RoomObject &obj, gfx::BackgroundBuffer &bg, std::span< const gfx::TileInfo > tiles)
 
void DrawRightwardsDecor4x3spaced4_1to16 (const RoomObject &obj, gfx::BackgroundBuffer &bg, std::span< const gfx::TileInfo > tiles)
 
void DrawRightwardsDoubled2x2spaced2_1to16 (const RoomObject &obj, gfx::BackgroundBuffer &bg, std::span< const gfx::TileInfo > tiles)
 
void DrawRightwardsDecor2x2spaced12_1to16 (const RoomObject &obj, gfx::BackgroundBuffer &bg, std::span< const gfx::TileInfo > tiles)
 
void DrawDownwards2x2_1to15or32 (const RoomObject &obj, gfx::BackgroundBuffer &bg, std::span< const gfx::TileInfo > tiles)
 
void DrawDownwards4x2_1to15or26 (const RoomObject &obj, gfx::BackgroundBuffer &bg, std::span< const gfx::TileInfo > tiles)
 
void DrawDownwards4x2_1to16_BothBG (const RoomObject &obj, gfx::BackgroundBuffer &bg, std::span< const gfx::TileInfo > tiles)
 
void DrawDownwardsDecor4x2spaced4_1to16 (const RoomObject &obj, gfx::BackgroundBuffer &bg, std::span< const gfx::TileInfo > tiles)
 
void DrawDownwards2x2_1to16 (const RoomObject &obj, gfx::BackgroundBuffer &bg, std::span< const gfx::TileInfo > tiles)
 
void DrawDownwardsHasEdge1x1_1to16_plus3 (const RoomObject &obj, gfx::BackgroundBuffer &bg, std::span< const gfx::TileInfo > tiles)
 
void DrawDownwardsEdge1x1_1to16 (const RoomObject &obj, gfx::BackgroundBuffer &bg, std::span< const gfx::TileInfo > tiles)
 
void DrawDownwardsLeftCorners2x1_1to16_plus12 (const RoomObject &obj, gfx::BackgroundBuffer &bg, std::span< const gfx::TileInfo > tiles)
 
void DrawDownwardsRightCorners2x1_1to16_plus12 (const RoomObject &obj, gfx::BackgroundBuffer &bg, std::span< const gfx::TileInfo > tiles)
 
void WriteTile8 (gfx::BackgroundBuffer &bg, int tile_x, int tile_y, const gfx::TileInfo &tile_info)
 
bool IsValidTilePosition (int tile_x, int tile_y) const
 

Private Attributes

std::unordered_map< int16_t, int > object_to_routine_map_
 
std::vector< DrawRoutinedraw_routines_
 
bool routines_initialized_ = false
 
Romrom_
 
const uint8_t * room_gfx_buffer_
 

Static Private Attributes

static constexpr int kMaxTilesX = 64
 
static constexpr int kMaxTilesY = 64
 

Detailed Description

Draws dungeon objects to background buffers using game patterns.

This class interprets object IDs and draws them to BG1/BG2 buffers using the patterns extracted from the game's drawing routines. Based on ZScream's DungeonObjectData.cs and Subtype1_Draw.cs patterns.

Architecture:

  1. Load tile data from ROM for the object
  2. Look up draw routine ID from object ID mapping
  3. Execute appropriate draw routine with size/orientation
  4. Write tiles to BackgroundBuffer according to pattern
  5. Handle palette coordination and graphics sheet access

Definition at line 32 of file object_drawer.h.

Member Typedef Documentation

◆ DrawRoutine

using yaze::zelda3::ObjectDrawer::DrawRoutine = std::function<void(ObjectDrawer*, const RoomObject&, gfx::BackgroundBuffer&, std::span<const gfx::TileInfo>)>
private

Definition at line 88 of file object_drawer.h.

Constructor & Destructor Documentation

◆ ObjectDrawer()

yaze::zelda3::ObjectDrawer::ObjectDrawer ( Rom rom,
const uint8_t *  room_gfx_buffer = nullptr 
)
explicit

Definition at line 12 of file object_drawer.cc.

References InitializeDrawRoutines().

Here is the call graph for this function:

Member Function Documentation

◆ DrawObject()

absl::Status yaze::zelda3::ObjectDrawer::DrawObject ( const RoomObject object,
gfx::BackgroundBuffer bg1,
gfx::BackgroundBuffer bg2,
const gfx::PaletteGroup palette_group 
)

Draw a room object to background buffers.

Parameters
objectThe object to draw
bg1Background layer 1 buffer
bg2Background layer 2 buffer
palette_groupCurrent palette group for color mapping
Returns
Status of the drawing operation

Definition at line 17 of file object_drawer.cc.

References yaze::zelda3::RoomObject::BG2, draw_routines_, GetDrawRoutineId(), yaze::Rom::is_loaded(), LOG_DEBUG, rom_, routines_initialized_, yaze::zelda3::RoomObject::set_rom(), yaze::zelda3::RoomObject::tiles(), and WriteTile8().

Referenced by DrawObjectList(), yaze::zelda3::TEST_F(), yaze::zelda3::TEST_F(), yaze::zelda3::TEST_F(), yaze::zelda3::TEST_F(), yaze::zelda3::TEST_F(), and yaze::zelda3::TEST_F().

◆ DrawObjectList()

absl::Status yaze::zelda3::ObjectDrawer::DrawObjectList ( const std::vector< RoomObject > &  objects,
gfx::BackgroundBuffer bg1,
gfx::BackgroundBuffer bg2,
const gfx::PaletteGroup palette_group 
)

Draw all objects in a room.

Parameters
objectsVector of room objects
bg1Background layer 1 buffer
bg2Background layer 2 buffer
palette_groupCurrent palette group for color mapping
Returns
Status of the drawing operation

Definition at line 67 of file object_drawer.cc.

References yaze::gfx::BackgroundBuffer::bitmap(), and DrawObject().

Referenced by yaze::zelda3::Room::RenderObjectsToBackground(), yaze::test::TEST_F(), yaze::zelda3::TEST_F(), yaze::zelda3::TEST_F(), yaze::zelda3::TEST_F(), yaze::zelda3::TEST_F(), yaze::zelda3::TEST_F(), yaze::zelda3::TEST_F(), yaze::zelda3::TEST_F(), yaze::zelda3::TEST_F(), yaze::zelda3::TEST_F(), yaze::zelda3::TEST_F(), and yaze::zelda3::TEST_F().

Here is the call graph for this function:

◆ GetDrawRoutineId()

int yaze::zelda3::ObjectDrawer::GetDrawRoutineId ( int16_t  object_id) const

Get draw routine ID for an object.

Parameters
object_idThe object ID to look up
Returns
Draw routine ID (0-24) based on ZScream mapping

Definition at line 213 of file object_drawer.cc.

References object_to_routine_map_.

Referenced by DrawObject().

◆ InitializeDrawRoutines()

◆ DrawTileToBitmap()

void yaze::zelda3::ObjectDrawer::DrawTileToBitmap ( gfx::Bitmap bitmap,
const gfx::TileInfo tile_info,
int  pixel_x,
int  pixel_y,
const uint8_t *  tiledata 
)

Draw a single tile directly to bitmap.

Parameters
bitmapTarget bitmap to draw to
tile_infoTile information (ID, palette, mirroring)
pixel_xX pixel coordinate in bitmap
pixel_yY pixel coordinate in bitmap
tiledataSource graphics data from ROM

Definition at line 760 of file object_drawer.cc.

References yaze::gfx::Bitmap::height(), yaze::gfx::TileInfo::horizontal_mirror_, yaze::gfx::TileInfo::id_, yaze::gfx::Bitmap::is_active(), LOG_DEBUG, yaze::gfx::Bitmap::mutable_data(), yaze::gfx::TileInfo::palette_, yaze::gfx::Bitmap::set_modified(), yaze::gfx::TileInfo::vertical_mirror_, and yaze::gfx::Bitmap::width().

Referenced by WriteTile8().

◆ DrawRightwards2x2_1to15or32()

void yaze::zelda3::ObjectDrawer::DrawRightwards2x2_1to15or32 ( const RoomObject obj,
gfx::BackgroundBuffer bg,
std::span< const gfx::TileInfo tiles 
)
private

Definition at line 227 of file object_drawer.cc.

References yaze::zelda3::RoomObject::size_, WriteTile8(), yaze::zelda3::RoomObject::x_, and yaze::zelda3::RoomObject::y_.

Referenced by InitializeDrawRoutines().

Here is the call graph for this function:

◆ DrawRightwards2x4_1to15or26()

void yaze::zelda3::ObjectDrawer::DrawRightwards2x4_1to15or26 ( const RoomObject obj,
gfx::BackgroundBuffer bg,
std::span< const gfx::TileInfo tiles 
)
private

Definition at line 245 of file object_drawer.cc.

References yaze::zelda3::RoomObject::size_, WriteTile8(), yaze::zelda3::RoomObject::x_, and yaze::zelda3::RoomObject::y_.

Referenced by InitializeDrawRoutines().

Here is the call graph for this function:

◆ DrawRightwards2x4spaced4_1to16()

void yaze::zelda3::ObjectDrawer::DrawRightwards2x4spaced4_1to16 ( const RoomObject obj,
gfx::BackgroundBuffer bg,
std::span< const gfx::TileInfo tiles 
)
private

◆ DrawRightwards2x4spaced4_1to16_BothBG()

void yaze::zelda3::ObjectDrawer::DrawRightwards2x4spaced4_1to16_BothBG ( const RoomObject obj,
gfx::BackgroundBuffer bg,
std::span< const gfx::TileInfo tiles 
)
private

Definition at line 286 of file object_drawer.cc.

References DrawRightwards2x4spaced4_1to16().

Referenced by InitializeDrawRoutines().

Here is the call graph for this function:

◆ DrawRightwards2x2_1to16()

void yaze::zelda3::ObjectDrawer::DrawRightwards2x2_1to16 ( const RoomObject obj,
gfx::BackgroundBuffer bg,
std::span< const gfx::TileInfo tiles 
)
private

Definition at line 293 of file object_drawer.cc.

References yaze::zelda3::RoomObject::size_, WriteTile8(), yaze::zelda3::RoomObject::x_, and yaze::zelda3::RoomObject::y_.

Referenced by InitializeDrawRoutines().

Here is the call graph for this function:

◆ DrawDiagonalAcute_1to16()

void yaze::zelda3::ObjectDrawer::DrawDiagonalAcute_1to16 ( const RoomObject obj,
gfx::BackgroundBuffer bg,
std::span< const gfx::TileInfo tiles 
)
private

Definition at line 309 of file object_drawer.cc.

References yaze::zelda3::RoomObject::size_, WriteTile8(), yaze::zelda3::RoomObject::x_, and yaze::zelda3::RoomObject::y_.

Referenced by DrawDiagonalAcute_1to16_BothBG(), and InitializeDrawRoutines().

Here is the call graph for this function:

◆ DrawDiagonalGrave_1to16()

void yaze::zelda3::ObjectDrawer::DrawDiagonalGrave_1to16 ( const RoomObject obj,
gfx::BackgroundBuffer bg,
std::span< const gfx::TileInfo tiles 
)
private

Definition at line 326 of file object_drawer.cc.

References yaze::zelda3::RoomObject::size_, WriteTile8(), yaze::zelda3::RoomObject::x_, and yaze::zelda3::RoomObject::y_.

Referenced by DrawDiagonalGrave_1to16_BothBG(), and InitializeDrawRoutines().

Here is the call graph for this function:

◆ DrawDiagonalAcute_1to16_BothBG()

void yaze::zelda3::ObjectDrawer::DrawDiagonalAcute_1to16_BothBG ( const RoomObject obj,
gfx::BackgroundBuffer bg,
std::span< const gfx::TileInfo tiles 
)
private

Definition at line 343 of file object_drawer.cc.

References DrawDiagonalAcute_1to16().

Here is the call graph for this function:

◆ DrawDiagonalGrave_1to16_BothBG()

void yaze::zelda3::ObjectDrawer::DrawDiagonalGrave_1to16_BothBG ( const RoomObject obj,
gfx::BackgroundBuffer bg,
std::span< const gfx::TileInfo tiles 
)
private

Definition at line 349 of file object_drawer.cc.

References DrawDiagonalGrave_1to16().

Here is the call graph for this function:

◆ DrawRightwards1x2_1to16_plus2()

void yaze::zelda3::ObjectDrawer::DrawRightwards1x2_1to16_plus2 ( const RoomObject obj,
gfx::BackgroundBuffer bg,
std::span< const gfx::TileInfo tiles 
)
private

Definition at line 355 of file object_drawer.cc.

References yaze::zelda3::RoomObject::size_, WriteTile8(), yaze::zelda3::RoomObject::x_, and yaze::zelda3::RoomObject::y_.

Here is the call graph for this function:

◆ DrawRightwardsHasEdge1x1_1to16_plus3()

void yaze::zelda3::ObjectDrawer::DrawRightwardsHasEdge1x1_1to16_plus3 ( const RoomObject obj,
gfx::BackgroundBuffer bg,
std::span< const gfx::TileInfo tiles 
)
private

Definition at line 369 of file object_drawer.cc.

References yaze::zelda3::RoomObject::size_, WriteTile8(), yaze::zelda3::RoomObject::x_, and yaze::zelda3::RoomObject::y_.

Here is the call graph for this function:

◆ DrawRightwardsHasEdge1x1_1to16_plus2()

void yaze::zelda3::ObjectDrawer::DrawRightwardsHasEdge1x1_1to16_plus2 ( const RoomObject obj,
gfx::BackgroundBuffer bg,
std::span< const gfx::TileInfo tiles 
)
private

Definition at line 382 of file object_drawer.cc.

References yaze::zelda3::RoomObject::size_, WriteTile8(), yaze::zelda3::RoomObject::x_, and yaze::zelda3::RoomObject::y_.

Here is the call graph for this function:

◆ DrawRightwardsTopCorners1x2_1to16_plus13()

void yaze::zelda3::ObjectDrawer::DrawRightwardsTopCorners1x2_1to16_plus13 ( const RoomObject obj,
gfx::BackgroundBuffer bg,
std::span< const gfx::TileInfo tiles 
)
private

Definition at line 395 of file object_drawer.cc.

References yaze::zelda3::RoomObject::size_, WriteTile8(), yaze::zelda3::RoomObject::x_, and yaze::zelda3::RoomObject::y_.

Here is the call graph for this function:

◆ DrawRightwardsBottomCorners1x2_1to16_plus13()

void yaze::zelda3::ObjectDrawer::DrawRightwardsBottomCorners1x2_1to16_plus13 ( const RoomObject obj,
gfx::BackgroundBuffer bg,
std::span< const gfx::TileInfo tiles 
)
private

Definition at line 409 of file object_drawer.cc.

References yaze::zelda3::RoomObject::size_, WriteTile8(), yaze::zelda3::RoomObject::x_, and yaze::zelda3::RoomObject::y_.

Here is the call graph for this function:

◆ CustomDraw()

void yaze::zelda3::ObjectDrawer::CustomDraw ( const RoomObject obj,
gfx::BackgroundBuffer bg,
std::span< const gfx::TileInfo tiles 
)
private

Definition at line 423 of file object_drawer.cc.

References WriteTile8(), yaze::zelda3::RoomObject::x_, and yaze::zelda3::RoomObject::y_.

Here is the call graph for this function:

◆ DrawRightwards4x4_1to16()

void yaze::zelda3::ObjectDrawer::DrawRightwards4x4_1to16 ( const RoomObject obj,
gfx::BackgroundBuffer bg,
std::span< const gfx::TileInfo tiles 
)
private

Definition at line 433 of file object_drawer.cc.

References yaze::zelda3::RoomObject::size_, WriteTile8(), yaze::zelda3::RoomObject::x_, and yaze::zelda3::RoomObject::y_.

Referenced by InitializeDrawRoutines().

Here is the call graph for this function:

◆ DrawRightwards1x1Solid_1to16_plus3()

void yaze::zelda3::ObjectDrawer::DrawRightwards1x1Solid_1to16_plus3 ( const RoomObject obj,
gfx::BackgroundBuffer bg,
std::span< const gfx::TileInfo tiles 
)
private

Definition at line 450 of file object_drawer.cc.

References yaze::zelda3::RoomObject::size_, WriteTile8(), yaze::zelda3::RoomObject::x_, and yaze::zelda3::RoomObject::y_.

Here is the call graph for this function:

◆ DrawDoorSwitcherer()

void yaze::zelda3::ObjectDrawer::DrawDoorSwitcherer ( const RoomObject obj,
gfx::BackgroundBuffer bg,
std::span< const gfx::TileInfo tiles 
)
private

Definition at line 463 of file object_drawer.cc.

References WriteTile8(), yaze::zelda3::RoomObject::x_, and yaze::zelda3::RoomObject::y_.

Here is the call graph for this function:

◆ DrawRightwardsDecor4x4spaced2_1to16()

void yaze::zelda3::ObjectDrawer::DrawRightwardsDecor4x4spaced2_1to16 ( const RoomObject obj,
gfx::BackgroundBuffer bg,
std::span< const gfx::TileInfo tiles 
)
private

Definition at line 473 of file object_drawer.cc.

References yaze::zelda3::RoomObject::size_, WriteTile8(), yaze::zelda3::RoomObject::x_, and yaze::zelda3::RoomObject::y_.

Here is the call graph for this function:

◆ DrawRightwardsStatue2x3spaced2_1to16()

void yaze::zelda3::ObjectDrawer::DrawRightwardsStatue2x3spaced2_1to16 ( const RoomObject obj,
gfx::BackgroundBuffer bg,
std::span< const gfx::TileInfo tiles 
)
private

Definition at line 490 of file object_drawer.cc.

References yaze::zelda3::RoomObject::size_, WriteTile8(), yaze::zelda3::RoomObject::x_, and yaze::zelda3::RoomObject::y_.

Here is the call graph for this function:

◆ DrawRightwardsPillar2x4spaced4_1to16()

void yaze::zelda3::ObjectDrawer::DrawRightwardsPillar2x4spaced4_1to16 ( const RoomObject obj,
gfx::BackgroundBuffer bg,
std::span< const gfx::TileInfo tiles 
)
private

Definition at line 507 of file object_drawer.cc.

References yaze::zelda3::RoomObject::size_, WriteTile8(), yaze::zelda3::RoomObject::x_, and yaze::zelda3::RoomObject::y_.

Here is the call graph for this function:

◆ DrawRightwardsDecor4x3spaced4_1to16()

void yaze::zelda3::ObjectDrawer::DrawRightwardsDecor4x3spaced4_1to16 ( const RoomObject obj,
gfx::BackgroundBuffer bg,
std::span< const gfx::TileInfo tiles 
)
private

Definition at line 524 of file object_drawer.cc.

References yaze::zelda3::RoomObject::size_, WriteTile8(), yaze::zelda3::RoomObject::x_, and yaze::zelda3::RoomObject::y_.

Here is the call graph for this function:

◆ DrawRightwardsDoubled2x2spaced2_1to16()

void yaze::zelda3::ObjectDrawer::DrawRightwardsDoubled2x2spaced2_1to16 ( const RoomObject obj,
gfx::BackgroundBuffer bg,
std::span< const gfx::TileInfo tiles 
)
private

Definition at line 541 of file object_drawer.cc.

References yaze::zelda3::RoomObject::size_, WriteTile8(), yaze::zelda3::RoomObject::x_, and yaze::zelda3::RoomObject::y_.

Here is the call graph for this function:

◆ DrawRightwardsDecor2x2spaced12_1to16()

void yaze::zelda3::ObjectDrawer::DrawRightwardsDecor2x2spaced12_1to16 ( const RoomObject obj,
gfx::BackgroundBuffer bg,
std::span< const gfx::TileInfo tiles 
)
private

Definition at line 558 of file object_drawer.cc.

References yaze::zelda3::RoomObject::size_, WriteTile8(), yaze::zelda3::RoomObject::x_, and yaze::zelda3::RoomObject::y_.

Here is the call graph for this function:

◆ DrawDownwards2x2_1to15or32()

void yaze::zelda3::ObjectDrawer::DrawDownwards2x2_1to15or32 ( const RoomObject obj,
gfx::BackgroundBuffer bg,
std::span< const gfx::TileInfo tiles 
)
private

Definition at line 578 of file object_drawer.cc.

References yaze::zelda3::RoomObject::size_, WriteTile8(), yaze::zelda3::RoomObject::x_, and yaze::zelda3::RoomObject::y_.

Referenced by InitializeDrawRoutines().

Here is the call graph for this function:

◆ DrawDownwards4x2_1to15or26()

void yaze::zelda3::ObjectDrawer::DrawDownwards4x2_1to15or26 ( const RoomObject obj,
gfx::BackgroundBuffer bg,
std::span< const gfx::TileInfo tiles 
)
private

◆ DrawDownwards4x2_1to16_BothBG()

void yaze::zelda3::ObjectDrawer::DrawDownwards4x2_1to16_BothBG ( const RoomObject obj,
gfx::BackgroundBuffer bg,
std::span< const gfx::TileInfo tiles 
)
private

Definition at line 633 of file object_drawer.cc.

References DrawDownwards4x2_1to15or26().

Referenced by InitializeDrawRoutines().

Here is the call graph for this function:

◆ DrawDownwardsDecor4x2spaced4_1to16()

void yaze::zelda3::ObjectDrawer::DrawDownwardsDecor4x2spaced4_1to16 ( const RoomObject obj,
gfx::BackgroundBuffer bg,
std::span< const gfx::TileInfo tiles 
)
private

Definition at line 640 of file object_drawer.cc.

References yaze::zelda3::RoomObject::size_, WriteTile8(), yaze::zelda3::RoomObject::x_, and yaze::zelda3::RoomObject::y_.

Referenced by InitializeDrawRoutines().

Here is the call graph for this function:

◆ DrawDownwards2x2_1to16()

void yaze::zelda3::ObjectDrawer::DrawDownwards2x2_1to16 ( const RoomObject obj,
gfx::BackgroundBuffer bg,
std::span< const gfx::TileInfo tiles 
)
private

Definition at line 660 of file object_drawer.cc.

References yaze::zelda3::RoomObject::size_, WriteTile8(), yaze::zelda3::RoomObject::x_, and yaze::zelda3::RoomObject::y_.

Referenced by InitializeDrawRoutines().

Here is the call graph for this function:

◆ DrawDownwardsHasEdge1x1_1to16_plus3()

void yaze::zelda3::ObjectDrawer::DrawDownwardsHasEdge1x1_1to16_plus3 ( const RoomObject obj,
gfx::BackgroundBuffer bg,
std::span< const gfx::TileInfo tiles 
)
private

Definition at line 676 of file object_drawer.cc.

References yaze::zelda3::RoomObject::size_, WriteTile8(), yaze::zelda3::RoomObject::x_, and yaze::zelda3::RoomObject::y_.

Referenced by InitializeDrawRoutines().

Here is the call graph for this function:

◆ DrawDownwardsEdge1x1_1to16()

void yaze::zelda3::ObjectDrawer::DrawDownwardsEdge1x1_1to16 ( const RoomObject obj,
gfx::BackgroundBuffer bg,
std::span< const gfx::TileInfo tiles 
)
private

Definition at line 689 of file object_drawer.cc.

References yaze::zelda3::RoomObject::size_, WriteTile8(), yaze::zelda3::RoomObject::x_, and yaze::zelda3::RoomObject::y_.

Referenced by InitializeDrawRoutines().

Here is the call graph for this function:

◆ DrawDownwardsLeftCorners2x1_1to16_plus12()

void yaze::zelda3::ObjectDrawer::DrawDownwardsLeftCorners2x1_1to16_plus12 ( const RoomObject obj,
gfx::BackgroundBuffer bg,
std::span< const gfx::TileInfo tiles 
)
private

Definition at line 702 of file object_drawer.cc.

References yaze::zelda3::RoomObject::size_, WriteTile8(), yaze::zelda3::RoomObject::x_, and yaze::zelda3::RoomObject::y_.

Referenced by InitializeDrawRoutines().

Here is the call graph for this function:

◆ DrawDownwardsRightCorners2x1_1to16_plus12()

void yaze::zelda3::ObjectDrawer::DrawDownwardsRightCorners2x1_1to16_plus12 ( const RoomObject obj,
gfx::BackgroundBuffer bg,
std::span< const gfx::TileInfo tiles 
)
private

Definition at line 716 of file object_drawer.cc.

References yaze::zelda3::RoomObject::size_, WriteTile8(), yaze::zelda3::RoomObject::x_, and yaze::zelda3::RoomObject::y_.

Referenced by InitializeDrawRoutines().

Here is the call graph for this function:

◆ WriteTile8()

◆ IsValidTilePosition()

bool yaze::zelda3::ObjectDrawer::IsValidTilePosition ( int  tile_x,
int  tile_y 
) const
private

Definition at line 755 of file object_drawer.cc.

References kMaxTilesX, and kMaxTilesY.

Member Data Documentation

◆ object_to_routine_map_

std::unordered_map<int16_t, int> yaze::zelda3::ObjectDrawer::object_to_routine_map_
private

Definition at line 167 of file object_drawer.h.

Referenced by GetDrawRoutineId(), and InitializeDrawRoutines().

◆ draw_routines_

std::vector<DrawRoutine> yaze::zelda3::ObjectDrawer::draw_routines_
private

Definition at line 168 of file object_drawer.h.

Referenced by DrawObject(), and InitializeDrawRoutines().

◆ routines_initialized_

bool yaze::zelda3::ObjectDrawer::routines_initialized_ = false
private

Definition at line 169 of file object_drawer.h.

Referenced by DrawObject(), and InitializeDrawRoutines().

◆ rom_

Rom* yaze::zelda3::ObjectDrawer::rom_
private

Definition at line 171 of file object_drawer.h.

Referenced by DrawObject().

◆ room_gfx_buffer_

const uint8_t* yaze::zelda3::ObjectDrawer::room_gfx_buffer_
private

Definition at line 172 of file object_drawer.h.

Referenced by WriteTile8().

◆ kMaxTilesX

constexpr int yaze::zelda3::ObjectDrawer::kMaxTilesX = 64
staticconstexprprivate

Definition at line 175 of file object_drawer.h.

Referenced by IsValidTilePosition().

◆ kMaxTilesY

constexpr int yaze::zelda3::ObjectDrawer::kMaxTilesY = 64
staticconstexprprivate

Definition at line 176 of file object_drawer.h.

Referenced by IsValidTilePosition().


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