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

#include <background_buffer.h>

Collaboration diagram for yaze::gfx::BackgroundBuffer:

Public Member Functions

 BackgroundBuffer (int width=512, int height=512)
 
void SetTileAt (int x, int y, uint16_t value)
 
uint16_t GetTileAt (int x, int y) const
 
void ClearBuffer ()
 
void DrawTile (const TileInfo &tile_info, uint8_t *canvas, const uint8_t *tiledata, int indexoffset)
 
void DrawBackground (std::span< uint8_t > gfx16_data)
 
void DrawFloor (const std::vector< uint8_t > &rom_data, int tile_address, int tile_address_floor, uint8_t floor_graphics)
 
void EnsureBitmapInitialized ()
 
void ClearPriorityBuffer ()
 
uint8_t GetPriorityAt (int x, int y) const
 
void SetPriorityAt (int x, int y, uint8_t priority)
 
const std::vector< uint8_t > & priority_data () const
 
std::vector< uint8_t > & mutable_priority_data ()
 
void ClearCoverageBuffer ()
 
const std::vector< uint8_t > & coverage_data () const
 
std::vector< uint8_t > & mutable_coverage_data ()
 
std::vector< uint16_t > & buffer ()
 
const std::vector< uint16_t > & buffer () const
 
auto & bitmap ()
 
const gfx::Bitmapbitmap () const
 

Private Member Functions

void EnsureTileBufferAllocated ()
 
void EnsurePriorityBufferAllocated ()
 
void EnsureCoverageBufferAllocated ()
 

Private Attributes

std::vector< uint16_t > buffer_
 
std::vector< uint8_t > priority_buffer_
 
std::vector< uint8_t > coverage_buffer_
 
gfx::Bitmap bitmap_
 
int width_
 
int height_
 

Detailed Description

Definition at line 13 of file background_buffer.h.

Constructor & Destructor Documentation

◆ BackgroundBuffer()

yaze::gfx::BackgroundBuffer::BackgroundBuffer ( int width = 512,
int height = 512 )

Definition at line 13 of file background_buffer.cc.

Member Function Documentation

◆ SetTileAt()

void yaze::gfx::BackgroundBuffer::SetTileAt ( int x,
int y,
uint16_t value )

Definition at line 47 of file background_buffer.cc.

References buffer_, EnsureTileBufferAllocated(), height_, and width_.

Referenced by DrawFloor(), and yaze::zelda3::DrawRoutineUtils::WriteTile8().

Here is the call graph for this function:

◆ GetTileAt()

uint16_t yaze::gfx::BackgroundBuffer::GetTileAt ( int x,
int y ) const

◆ ClearBuffer()

void yaze::gfx::BackgroundBuffer::ClearBuffer ( )

◆ DrawTile()

void yaze::gfx::BackgroundBuffer::DrawTile ( const TileInfo & tile_info,
uint8_t * canvas,
const uint8_t * tiledata,
int indexoffset )

◆ DrawBackground()

◆ DrawFloor()

void yaze::gfx::BackgroundBuffer::DrawFloor ( const std::vector< uint8_t > & rom_data,
int tile_address,
int tile_address_floor,
uint8_t floor_graphics )

◆ EnsureBitmapInitialized()

◆ ClearPriorityBuffer()

void yaze::gfx::BackgroundBuffer::ClearPriorityBuffer ( )

Definition at line 81 of file background_buffer.cc.

References priority_buffer_.

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

◆ GetPriorityAt()

uint8_t yaze::gfx::BackgroundBuffer::GetPriorityAt ( int x,
int y ) const

Definition at line 95 of file background_buffer.cc.

References height_, priority_buffer_, and width_.

◆ SetPriorityAt()

void yaze::gfx::BackgroundBuffer::SetPriorityAt ( int x,
int y,
uint8_t priority )

Definition at line 102 of file background_buffer.cc.

References EnsurePriorityBufferAllocated(), height_, priority_buffer_, and width_.

Here is the call graph for this function:

◆ priority_data()

const std::vector< uint8_t > & yaze::gfx::BackgroundBuffer::priority_data ( ) const
inline

Definition at line 40 of file background_buffer.h.

References priority_buffer_.

◆ mutable_priority_data()

std::vector< uint8_t > & yaze::gfx::BackgroundBuffer::mutable_priority_data ( )

◆ ClearCoverageBuffer()

void yaze::gfx::BackgroundBuffer::ClearCoverageBuffer ( )

Definition at line 88 of file background_buffer.cc.

References coverage_buffer_.

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

◆ coverage_data()

const std::vector< uint8_t > & yaze::gfx::BackgroundBuffer::coverage_data ( ) const
inline

Definition at line 52 of file background_buffer.h.

References coverage_buffer_.

◆ mutable_coverage_data()

std::vector< uint8_t > & yaze::gfx::BackgroundBuffer::mutable_coverage_data ( )

◆ buffer() [1/2]

std::vector< uint16_t > & yaze::gfx::BackgroundBuffer::buffer ( )
inline

Definition at line 56 of file background_buffer.h.

References buffer_.

◆ buffer() [2/2]

const std::vector< uint16_t > & yaze::gfx::BackgroundBuffer::buffer ( ) const
inline

Definition at line 57 of file background_buffer.h.

References buffer_.

◆ bitmap() [1/2]

◆ bitmap() [2/2]

const gfx::Bitmap & yaze::gfx::BackgroundBuffer::bitmap ( ) const
inline

Definition at line 59 of file background_buffer.h.

References bitmap_.

◆ EnsureTileBufferAllocated()

void yaze::gfx::BackgroundBuffer::EnsureTileBufferAllocated ( )
private

Definition at line 16 of file background_buffer.cc.

References buffer_, height_, and width_.

Referenced by DrawBackground(), and SetTileAt().

◆ EnsurePriorityBufferAllocated()

void yaze::gfx::BackgroundBuffer::EnsurePriorityBufferAllocated ( )
private

◆ EnsureCoverageBufferAllocated()

void yaze::gfx::BackgroundBuffer::EnsureCoverageBufferAllocated ( )
private

Definition at line 30 of file background_buffer.cc.

References coverage_buffer_, height_, and width_.

Referenced by EnsureBitmapInitialized(), and mutable_coverage_data().

Member Data Documentation

◆ buffer_

std::vector<uint16_t> yaze::gfx::BackgroundBuffer::buffer_
private

◆ priority_buffer_

std::vector<uint8_t> yaze::gfx::BackgroundBuffer::priority_buffer_
private

◆ coverage_buffer_

std::vector<uint8_t> yaze::gfx::BackgroundBuffer::coverage_buffer_
private

◆ bitmap_

gfx::Bitmap yaze::gfx::BackgroundBuffer::bitmap_
private

◆ width_

◆ height_


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