#include <background_buffer.h>

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 () |
| void | ClearBG1RevealMask () |
| void | ClearBG1RevealMask (BG1RevealMaskSource source) |
| void | ClearBG1RevealMaskRect (BG1RevealMaskSource source, int start_x, int start_y, int width, int height) |
| void | SetBG1RevealMaskRect (BG1RevealMaskSource source, int start_x, int start_y, int width, int height) |
| const std::vector< uint8_t > & | bg1_reveal_mask_data () const |
| std::vector< uint8_t > & | mutable_bg1_reveal_mask_data () |
| std::vector< uint16_t > & | buffer () |
| const std::vector< uint16_t > & | buffer () const |
| auto & | bitmap () |
| const gfx::Bitmap & | bitmap () const |
Private Member Functions | |
| void | EnsureTileBufferAllocated () |
| void | EnsurePriorityBufferAllocated () |
| void | EnsureCoverageBufferAllocated () |
| void | EnsureBG1RevealMaskAllocated () |
Private Attributes | |
| std::vector< uint16_t > | buffer_ |
| std::vector< uint8_t > | priority_buffer_ |
| std::vector< uint8_t > | coverage_buffer_ |
| std::vector< uint8_t > | bg1_reveal_mask_buffer_ |
| gfx::Bitmap | bitmap_ |
| int | width_ |
| int | height_ |
Definition at line 18 of file background_buffer.h.
| yaze::gfx::BackgroundBuffer::BackgroundBuffer | ( | int | width = 512, |
| int | height = 512 ) |
Definition at line 13 of file background_buffer.cc.
| void yaze::gfx::BackgroundBuffer::SetTileAt | ( | int | x, |
| int | y, | ||
| uint16_t | value ) |
Definition at line 59 of file background_buffer.cc.
References buffer_, EnsureTileBufferAllocated(), height_, and width_.
Referenced by DrawFloor(), and yaze::zelda3::DrawRoutineUtils::WriteTile8().

| uint16_t yaze::gfx::BackgroundBuffer::GetTileAt | ( | int | x, |
| int | y ) const |
Definition at line 72 of file background_buffer.cc.
References buffer_, height_, and width_.
Referenced by yaze::zelda3::ObjectGeometry::MeasureRoutineForState(), and yaze::zelda3::DrawRoutineUtils::TileIdAt().
| void yaze::gfx::BackgroundBuffer::ClearBuffer | ( | ) |
Definition at line 85 of file background_buffer.cc.
References buffer_, ClearBG1RevealMask(), ClearCoverageBuffer(), and ClearPriorityBuffer().
Referenced by yaze::gui::DungeonObjectEmulatorPreview::TriggerStaticRender().

| void yaze::gfx::BackgroundBuffer::DrawTile | ( | const TileInfo & | tile_info, |
| uint8_t * | canvas, | ||
| const uint8_t * | tiledata, | ||
| int | indexoffset ) |
Definition at line 204 of file background_buffer.cc.
References height_, yaze::gfx::TileInfo::horizontal_mirror_, yaze::gfx::TileInfo::id_, yaze::gfx::TileInfo::over_, yaze::gfx::TileInfo::palette_, priority_buffer_, yaze::gfx::TileInfo::vertical_mirror_, and width_.
Referenced by DrawBackground().
| void yaze::gfx::BackgroundBuffer::DrawBackground | ( | std::span< uint8_t > | gfx16_data | ) |
Definition at line 271 of file background_buffer.cc.
References bitmap_, buffer_, yaze::gfx::Bitmap::Create(), DrawTile(), EnsurePriorityBufferAllocated(), EnsureTileBufferAllocated(), height_, yaze::gfx::Bitmap::is_active(), yaze::gfx::Bitmap::mutable_data(), yaze::gfx::Bitmap::surface(), yaze::gfx::Bitmap::width(), width_, and yaze::gfx::WordToTileInfo().
Referenced by yaze::zelda3::Room::RenderRoomGraphics().
| void yaze::gfx::BackgroundBuffer::DrawFloor | ( | const std::vector< uint8_t > & | rom_data, |
| int | tile_address, | ||
| int | tile_address_floor, | ||
| uint8_t | floor_graphics ) |
Definition at line 336 of file background_buffer.cc.
References bitmap_, yaze::gfx::Bitmap::Create(), yaze::gfx::Bitmap::height(), height_, yaze::gfx::Bitmap::is_active(), LOG_DEBUG, SetTileAt(), yaze::gfx::TileInfoToWord(), yaze::gfx::Bitmap::width(), and width_.
Referenced by yaze::zelda3::Room::RenderRoomGraphics().
| void yaze::gfx::BackgroundBuffer::EnsureBitmapInitialized | ( | ) |
Definition at line 174 of file background_buffer.cc.
References bitmap_, yaze::gfx::Bitmap::Create(), EnsureCoverageBufferAllocated(), EnsurePriorityBufferAllocated(), height_, yaze::gfx::Bitmap::is_active(), yaze::gfx::Bitmap::SetPalette(), yaze::gfx::Bitmap::surface(), yaze::gfx::Bitmap::width(), and width_.
Referenced by yaze::emu::render::EmulatorRenderService::RenderDungeonObjectStatic(), yaze::zelda3::Room::RenderObjectsToBackground(), and yaze::zelda3::Room::RenderRoomGraphics().
| void yaze::gfx::BackgroundBuffer::ClearPriorityBuffer | ( | ) |
Definition at line 94 of file background_buffer.cc.
References priority_buffer_.
Referenced by ClearBuffer(), and yaze::zelda3::Room::RenderObjectsToBackground().
| uint8_t yaze::gfx::BackgroundBuffer::GetPriorityAt | ( | int | x, |
| int | y ) const |
Definition at line 159 of file background_buffer.cc.
References height_, priority_buffer_, and width_.
| void yaze::gfx::BackgroundBuffer::SetPriorityAt | ( | int | x, |
| int | y, | ||
| uint8_t | priority ) |
Definition at line 166 of file background_buffer.cc.
References EnsurePriorityBufferAllocated(), height_, priority_buffer_, and width_.

|
inline |
Definition at line 45 of file background_buffer.h.
References priority_buffer_.
| std::vector< uint8_t > & yaze::gfx::BackgroundBuffer::mutable_priority_data | ( | ) |
Definition at line 44 of file background_buffer.cc.
References EnsurePriorityBufferAllocated(), and priority_buffer_.
Referenced by yaze::zelda3::ObjectDrawer::DrawDoor(), yaze::zelda3::ObjectDrawer::DrawMissingCustomObjectPlaceholder(), and yaze::zelda3::ObjectDrawer::WriteTile8().

| void yaze::gfx::BackgroundBuffer::ClearCoverageBuffer | ( | ) |
Definition at line 101 of file background_buffer.cc.
References coverage_buffer_.
Referenced by ClearBuffer(), and yaze::zelda3::Room::RenderObjectsToBackground().
|
inline |
Definition at line 57 of file background_buffer.h.
References coverage_buffer_.
| std::vector< uint8_t > & yaze::gfx::BackgroundBuffer::mutable_coverage_data | ( | ) |
Definition at line 49 of file background_buffer.cc.
References coverage_buffer_, and EnsureCoverageBufferAllocated().
Referenced by yaze::zelda3::ObjectDrawer::DrawDoor(), yaze::zelda3::ObjectDrawer::DrawDoorIndicator(), yaze::zelda3::ObjectDrawer::DrawMissingCustomObjectPlaceholder(), yaze::zelda3::ObjectDrawer::DrawPotItem(), and yaze::zelda3::ObjectDrawer::WriteTile8().

| void yaze::gfx::BackgroundBuffer::ClearBG1RevealMask | ( | ) |
Definition at line 108 of file background_buffer.cc.
References bg1_reveal_mask_buffer_.
Referenced by ClearBuffer(), yaze::zelda3::Room::LoadLayoutTilesToBuffer(), and yaze::zelda3::Room::RenderObjectsToBackground().
| void yaze::gfx::BackgroundBuffer::ClearBG1RevealMask | ( | BG1RevealMaskSource | source | ) |
Definition at line 115 of file background_buffer.cc.
References bg1_reveal_mask_buffer_.
| void yaze::gfx::BackgroundBuffer::ClearBG1RevealMaskRect | ( | BG1RevealMaskSource | source, |
| int | start_x, | ||
| int | start_y, | ||
| int | width, | ||
| int | height ) |
Definition at line 125 of file background_buffer.cc.
References bg1_reveal_mask_buffer_, height_, and width_.
Referenced by yaze::zelda3::ObjectDrawer::DrawDoor(), yaze::zelda3::ObjectDrawer::DrawDoorIndicator(), yaze::zelda3::ObjectDrawer::DrawMissingCustomObjectPlaceholder(), yaze::zelda3::ObjectDrawer::DrawPotItem(), and yaze::zelda3::ObjectDrawer::WriteTile8().
| void yaze::gfx::BackgroundBuffer::SetBG1RevealMaskRect | ( | BG1RevealMaskSource | source, |
| int | start_x, | ||
| int | start_y, | ||
| int | width, | ||
| int | height ) |
Definition at line 141 of file background_buffer.cc.
References bg1_reveal_mask_buffer_, EnsureBG1RevealMaskAllocated(), height_, and width_.
Referenced by yaze::zelda3::ObjectDrawer::MarkBg1RectRevealed().

|
inline |
Definition at line 70 of file background_buffer.h.
References bg1_reveal_mask_buffer_.
Referenced by yaze::zelda3::RoomLayerManager::CompositeToOutput().
| std::vector< uint8_t > & yaze::gfx::BackgroundBuffer::mutable_bg1_reveal_mask_data | ( | ) |
Definition at line 54 of file background_buffer.cc.
References bg1_reveal_mask_buffer_, and EnsureBG1RevealMaskAllocated().
Referenced by yaze::zelda3::ObjectDrawer::MarkBg1OpaqueTilePixelsRevealed().

|
inline |
Definition at line 76 of file background_buffer.h.
References buffer_.
|
inline |
Definition at line 77 of file background_buffer.h.
References buffer_.
|
inline |
Definition at line 78 of file background_buffer.h.
References bitmap_.
Referenced by yaze::zelda3::RoomLayerManager::CompositeToOutput(), yaze::zelda3::ObjectDrawer::DrawDoor(), yaze::zelda3::ObjectDrawer::DrawDoorIndicator(), yaze::zelda3::ObjectDrawer::DrawMissingCustomObjectPlaceholder(), yaze::zelda3::ObjectDrawer::DrawObjectList(), yaze::editor::DungeonObjectSelector::DrawObjectPreview(), yaze::zelda3::ObjectDrawer::DrawPotItem(), yaze::editor::DungeonObjectSelector::GetOrCreatePreview(), yaze::zelda3::ObjectDrawer::MarkBg1OpaqueTilePixelsRevealed(), yaze::zelda3::Room::PrepareForRender(), yaze::emu::render::EmulatorRenderService::RenderDungeonObjectStatic(), yaze::zelda3::Room::RenderObjectsToBackground(), yaze::zelda3::Room::RenderRoomGraphics(), yaze::gui::DungeonObjectEmulatorPreview::TriggerStaticRender(), and yaze::zelda3::ObjectDrawer::WriteTile8().
|
inline |
Definition at line 79 of file background_buffer.h.
References bitmap_.
|
private |
Definition at line 16 of file background_buffer.cc.
References buffer_, height_, and width_.
Referenced by DrawBackground(), and SetTileAt().
|
private |
Definition at line 23 of file background_buffer.cc.
References height_, priority_buffer_, and width_.
Referenced by DrawBackground(), EnsureBitmapInitialized(), mutable_priority_data(), and SetPriorityAt().
|
private |
Definition at line 30 of file background_buffer.cc.
References coverage_buffer_, height_, and width_.
Referenced by EnsureBitmapInitialized(), and mutable_coverage_data().
|
private |
Definition at line 37 of file background_buffer.cc.
References bg1_reveal_mask_buffer_, height_, and width_.
Referenced by mutable_bg1_reveal_mask_data(), and SetBG1RevealMaskRect().
|
private |
Definition at line 87 of file background_buffer.h.
Referenced by buffer(), buffer(), ClearBuffer(), DrawBackground(), EnsureTileBufferAllocated(), GetTileAt(), and SetTileAt().
|
private |
Definition at line 88 of file background_buffer.h.
Referenced by ClearPriorityBuffer(), DrawTile(), EnsurePriorityBufferAllocated(), GetPriorityAt(), mutable_priority_data(), priority_data(), and SetPriorityAt().
|
private |
Definition at line 89 of file background_buffer.h.
Referenced by ClearCoverageBuffer(), coverage_data(), EnsureCoverageBufferAllocated(), and mutable_coverage_data().
|
private |
Definition at line 90 of file background_buffer.h.
Referenced by bg1_reveal_mask_data(), ClearBG1RevealMask(), ClearBG1RevealMask(), ClearBG1RevealMaskRect(), EnsureBG1RevealMaskAllocated(), mutable_bg1_reveal_mask_data(), and SetBG1RevealMaskRect().
|
private |
Definition at line 91 of file background_buffer.h.
Referenced by bitmap(), bitmap(), DrawBackground(), DrawFloor(), and EnsureBitmapInitialized().
|
private |
Definition at line 92 of file background_buffer.h.
Referenced by ClearBG1RevealMaskRect(), DrawBackground(), DrawFloor(), DrawTile(), EnsureBG1RevealMaskAllocated(), EnsureBitmapInitialized(), EnsureCoverageBufferAllocated(), EnsurePriorityBufferAllocated(), EnsureTileBufferAllocated(), GetPriorityAt(), GetTileAt(), SetBG1RevealMaskRect(), SetPriorityAt(), and SetTileAt().
|
private |
Definition at line 93 of file background_buffer.h.
Referenced by ClearBG1RevealMaskRect(), DrawBackground(), DrawFloor(), DrawTile(), EnsureBG1RevealMaskAllocated(), EnsureBitmapInitialized(), EnsureCoverageBufferAllocated(), EnsurePriorityBufferAllocated(), EnsureTileBufferAllocated(), GetPriorityAt(), GetTileAt(), SetBG1RevealMaskRect(), SetPriorityAt(), and SetTileAt().