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

Utility functions for tile writing used by all routines. More...

Functions

void WriteTile8 (gfx::BackgroundBuffer &bg, int tile_x, int tile_y, const gfx::TileInfo &tile_info)
 Write an 8x8 tile to the background buffer.
 
void DrawBlock2x2 (gfx::BackgroundBuffer &bg, int tile_x, int tile_y, std::span< const gfx::TileInfo > tiles, int offset=0)
 Draw a 2x2 block of tiles (16x16 pixels)
 
void DrawBlock2x4 (gfx::BackgroundBuffer &bg, int tile_x, int tile_y, std::span< const gfx::TileInfo > tiles, int offset=0)
 Draw a 2x4 block of tiles (16x32 pixels)
 
void DrawBlock4x2 (gfx::BackgroundBuffer &bg, int tile_x, int tile_y, std::span< const gfx::TileInfo > tiles, int offset=0)
 Draw a 4x2 block of tiles (32x16 pixels)
 
void DrawBlock4x4 (gfx::BackgroundBuffer &bg, int tile_x, int tile_y, std::span< const gfx::TileInfo > tiles, int offset=0)
 Draw a 4x4 block of tiles (32x32 pixels)
 
bool IsValidTilePosition (int tile_x, int tile_y)
 Check if tile position is within canvas bounds.
 

Detailed Description

Utility functions for tile writing used by all routines.

Function Documentation

◆ WriteTile8()

void yaze::zelda3::DrawRoutineUtils::WriteTile8 ( gfx::BackgroundBuffer & bg,
int tile_x,
int tile_y,
const gfx::TileInfo & tile_info )

Write an 8x8 tile to the background buffer.

Parameters
bgBackground buffer to write to
tile_xTile X coordinate (0-63)
tile_yTile Y coordinate (0-63)
tile_infoTile information (ID, palette, flip flags)

Definition at line 10 of file draw_routine_types.cc.

References IsValidTilePosition(), yaze::gfx::BackgroundBuffer::SetTileAt(), and yaze::gfx::TileInfoToWord().

Referenced by yaze::zelda3::draw_routines::CustomDraw(), yaze::zelda3::draw_routines::Draw3x3FloorIn4x4SuperSquare(), yaze::zelda3::draw_routines::Draw4x4BlocksIn4x4SuperSquare(), yaze::zelda3::draw_routines::Draw4x4Corner_BothBG(), yaze::zelda3::draw_routines::Draw4x4FloorIn4x4SuperSquare(), yaze::zelda3::draw_routines::Draw4x4FloorOneIn4x4SuperSquare(), yaze::zelda3::draw_routines::Draw4x4FloorTwoIn4x4SuperSquare(), yaze::zelda3::draw_routines::DrawAutoStairs(), yaze::zelda3::draw_routines::DrawBigHole4x4_1to16(), yaze::zelda3::draw_routines::DrawBigKeyLock(), DrawBlock2x2(), DrawBlock2x4(), DrawBlock4x2(), DrawBlock4x4(), yaze::zelda3::draw_routines::DrawBombableFloor(), yaze::zelda3::draw_routines::DrawChest(), yaze::zelda3::draw_routines::DrawChestPlatformHorizontalWall(), yaze::zelda3::draw_routines::DrawChestPlatformVerticalWall(), yaze::zelda3::draw_routines::DrawClosedChestPlatform(), yaze::zelda3::draw_routines::DrawCorner4x4(), yaze::zelda3::draw_routines::DrawDiagonalAcute_1to16(), yaze::zelda3::draw_routines::DrawDiagonalAcute_1to16_BothBG(), yaze::zelda3::draw_routines::DrawDiagonalGrave_1to16(), yaze::zelda3::draw_routines::DrawDiagonalGrave_1to16_BothBG(), yaze::zelda3::draw_routines::DrawDoorSwitcherer(), yaze::zelda3::draw_routines::DrawDownwards2x2_1to15or32(), yaze::zelda3::draw_routines::DrawDownwards2x2_1to16(), yaze::zelda3::draw_routines::DrawDownwards4x2_1to15or26(), yaze::zelda3::draw_routines::DrawDownwardsDecor4x2spaced4_1to16(), yaze::zelda3::draw_routines::DrawDownwardsEdge1x1_1to16(), yaze::zelda3::draw_routines::DrawDownwardsHasEdge1x1_1to16_plus3(), yaze::zelda3::draw_routines::DrawDownwardsLeftCorners2x1_1to16_plus12(), yaze::zelda3::draw_routines::DrawDownwardsRightCorners2x1_1to16_plus12(), yaze::zelda3::draw_routines::DrawInterRoomFatStairsUp(), yaze::zelda3::draw_routines::DrawLargeCanvasObject(), yaze::zelda3::draw_routines::DrawMovingWall(), yaze::zelda3::draw_routines::DrawPrisonCell(), yaze::zelda3::draw_routines::DrawRightwards1x1Solid_1to16_plus3(), yaze::zelda3::draw_routines::DrawRightwards1x2_1to16_plus2(), yaze::zelda3::draw_routines::DrawRightwards2x2_1to15or32(), yaze::zelda3::draw_routines::DrawRightwards2x2_1to16(), yaze::zelda3::draw_routines::DrawRightwards2x4_1to15or26(), yaze::zelda3::draw_routines::DrawRightwards2x4_1to16(), yaze::zelda3::draw_routines::DrawRightwards4x4_1to16(), yaze::zelda3::draw_routines::DrawRightwardsBottomCorners1x2_1to16_plus13(), yaze::zelda3::draw_routines::DrawRightwardsDecor2x2spaced12_1to16(), yaze::zelda3::draw_routines::DrawRightwardsDecor4x3spaced4_1to16(), yaze::zelda3::draw_routines::DrawRightwardsDecor4x4spaced2_1to16(), yaze::zelda3::draw_routines::DrawRightwardsDoubled2x2spaced2_1to16(), yaze::zelda3::draw_routines::DrawRightwardsHasEdge1x1_1to16_plus2(), yaze::zelda3::draw_routines::DrawRightwardsHasEdge1x1_1to16_plus3(), yaze::zelda3::draw_routines::DrawRightwardsPillar2x4spaced4_1to16(), yaze::zelda3::draw_routines::DrawRightwardsStatue2x3spaced2_1to16(), yaze::zelda3::draw_routines::DrawRightwardsTopCorners1x2_1to16_plus13(), yaze::zelda3::draw_routines::DrawSomariaLine(), yaze::zelda3::draw_routines::DrawSpike2x2In4x4SuperSquare(), yaze::zelda3::draw_routines::DrawSpiralStairs(), yaze::zelda3::draw_routines::DrawStraightInterRoomStairs(), yaze::zelda3::draw_routines::DrawTableRock4x4_1to16(), yaze::zelda3::draw_routines::DrawWaterFace(), yaze::zelda3::draw_routines::DrawWaterOverlay8x8_1to16(), yaze::zelda3::draw_routines::DrawWeirdCornerBottom_BothBG(), yaze::zelda3::draw_routines::DrawWeirdCornerTop_BothBG(), and yaze::zelda3::draw_routines::RegisterSpecialRoutines().

Here is the call graph for this function:

◆ DrawBlock2x2()

void yaze::zelda3::DrawRoutineUtils::DrawBlock2x2 ( gfx::BackgroundBuffer & bg,
int tile_x,
int tile_y,
std::span< const gfx::TileInfo > tiles,
int offset )

Draw a 2x2 block of tiles (16x16 pixels)

Definition at line 20 of file draw_routine_types.cc.

References WriteTile8().

Here is the call graph for this function:

◆ DrawBlock2x4()

void yaze::zelda3::DrawRoutineUtils::DrawBlock2x4 ( gfx::BackgroundBuffer & bg,
int tile_x,
int tile_y,
std::span< const gfx::TileInfo > tiles,
int offset )

Draw a 2x4 block of tiles (16x32 pixels)

Definition at line 33 of file draw_routine_types.cc.

References WriteTile8().

Here is the call graph for this function:

◆ DrawBlock4x2()

void yaze::zelda3::DrawRoutineUtils::DrawBlock4x2 ( gfx::BackgroundBuffer & bg,
int tile_x,
int tile_y,
std::span< const gfx::TileInfo > tiles,
int offset )

Draw a 4x2 block of tiles (32x16 pixels)

Definition at line 48 of file draw_routine_types.cc.

References WriteTile8().

Here is the call graph for this function:

◆ DrawBlock4x4()

void yaze::zelda3::DrawRoutineUtils::DrawBlock4x4 ( gfx::BackgroundBuffer & bg,
int tile_x,
int tile_y,
std::span< const gfx::TileInfo > tiles,
int offset )

Draw a 4x4 block of tiles (32x32 pixels)

Definition at line 61 of file draw_routine_types.cc.

References WriteTile8().

Here is the call graph for this function:

◆ IsValidTilePosition()

bool yaze::zelda3::DrawRoutineUtils::IsValidTilePosition ( int tile_x,
int tile_y )
inline

Check if tile position is within canvas bounds.

Definition at line 82 of file draw_routine_types.h.

References yaze::zelda3::DrawContext::kMaxTilesY.

Referenced by WriteTile8().