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

Resource management arena for efficient graphics memory handling. More...

#include <arena.h>

Collaboration diagram for yaze::gfx::Arena:

Classes

struct  SurfacePool
 
struct  TextureCommand
 
struct  TexturePool
 

Public Types

enum class  TextureCommandType { CREATE , UPDATE , DESTROY }
 
using PaletteChangeCallback
 

Public Member Functions

void Initialize (IRenderer *renderer)
 
 ~Arena ()
 
void QueueTextureCommand (TextureCommandType type, Bitmap *bitmap)
 
void ProcessTextureQueue (IRenderer *renderer)
 
bool HasPendingTextures () const
 Check if there are pending textures to process.
 
bool ProcessSingleTexture (IRenderer *renderer)
 Process a single texture command for frame-budget-aware loading.
 
SDL_Surface * AllocateSurface (int width, int height, int depth, int format)
 
void FreeSurface (SDL_Surface *surface)
 
void Shutdown ()
 
size_t GetTextureCount () const
 
size_t GetSurfaceCount () const
 
size_t GetPooledTextureCount () const
 
size_t GetPooledSurfaceCount () const
 
size_t texture_command_queue_size () const
 
std::array< gfx::Bitmap, 223 > & gfx_sheets ()
 Get reference to all graphics sheets.
 
auto gfx_sheet (int i)
 Get a specific graphics sheet by index.
 
auto mutable_gfx_sheet (int i)
 Get mutable reference to a specific graphics sheet.
 
auto mutable_gfx_sheets ()
 Get mutable reference to all graphics sheets.
 
void NotifySheetModified (int sheet_index)
 Notify Arena that a graphics sheet has been modified.
 
void NotifyPaletteModified (const std::string &group_name, int palette_index=-1)
 Notify all listeners that a palette has been modified.
 
int RegisterPaletteListener (PaletteChangeCallback callback)
 Register a callback for palette change notifications.
 
void UnregisterPaletteListener (int listener_id)
 Unregister a palette change listener.
 
auto & bg1 ()
 Get reference to background layer 1 buffer.
 
auto & bg2 ()
 Get reference to background layer 2 buffer.
 

Static Public Member Functions

static ArenaGet ()
 

Private Member Functions

 Arena ()
 

Private Attributes

BackgroundBuffer bg1_
 
BackgroundBuffer bg2_
 
std::array< uint16_t, kTotalTileslayer1_buffer_
 
std::array< uint16_t, kTotalTileslayer2_buffer_
 
std::array< gfx::Bitmap, 223 > gfx_sheets_
 
std::unordered_map< TextureHandle, std::unique_ptr< SDL_Texture, util::SDL_Texture_Deleter > > textures_
 
std::unordered_map< SDL_Surface *, std::unique_ptr< SDL_Surface, util::SDL_Surface_Deleter > > surfaces_
 
struct yaze::gfx::Arena::TexturePool texture_pool_
 
struct yaze::gfx::Arena::SurfacePool surface_pool_
 
std::vector< TextureCommandtexture_command_queue_
 
IRendererrenderer_ = nullptr
 
std::unordered_map< int, PaletteChangeCallbackpalette_listeners_
 
int next_palette_listener_id_ = 1
 

Static Private Attributes

static constexpr int kTilesPerRow = 64
 
static constexpr int kTilesPerColumn = 64
 
static constexpr int kTotalTiles = kTilesPerRow * kTilesPerColumn
 

Detailed Description

Resource management arena for efficient graphics memory handling.

The Arena class provides centralized management of SDL textures and surfaces for the YAZE ROM hacking editor. It implements several key optimizations:

Key Features:

  • Singleton pattern for global access across all graphics components
  • Automatic resource cleanup with RAII-style management
  • Memory pooling to reduce allocation overhead
  • Support for 223 graphics sheets (YAZE's full graphics space)
  • Background buffer management for SNES layer rendering

Performance Optimizations:

  • Unique_ptr with custom deleters for automatic SDL resource cleanup
  • Hash map storage for O(1) texture/surface lookup
  • Batch resource management to minimize SDL calls
  • Pre-allocated graphics sheet array for fast access

ROM Hacking Specific:

  • Fixed-size graphics sheet array (223 sheets) matching YAZE's graphics space
  • Background buffer support for SNES layer 1 and layer 2 rendering
  • Tile buffer management for 64x64 tile grids
  • Integration with SNES graphics format requirements

Definition at line 46 of file arena.h.

Member Typedef Documentation

◆ PaletteChangeCallback

Initial value:
std::function<void(const std::string& group_name, int palette_index)>

Callback type for palette change listeners

Parameters
group_nameThe palette group that changed (e.g., "ow_main")
palette_indexThe specific palette that changed, or -1 for all

Definition at line 141 of file arena.h.

Member Enumeration Documentation

◆ TextureCommandType

Enumerator
CREATE 
UPDATE 
DESTROY 

Definition at line 54 of file arena.h.

Constructor & Destructor Documentation

◆ ~Arena()

yaze::gfx::Arena::~Arena ( )

Definition at line 29 of file arena.cc.

References Shutdown().

Here is the call graph for this function:

◆ Arena()

yaze::gfx::Arena::Arena ( )
private

Definition at line 24 of file arena.cc.

References layer1_buffer_, and layer2_buffer_.

Member Function Documentation

◆ Get()

Arena & yaze::gfx::Arena::Get ( )
static

Definition at line 19 of file arena.cc.

Referenced by yaze::editor::PixelEditorPanel::ApplyBrush(), yaze::editor::PixelEditorPanel::ApplyEraser(), yaze::editor::PixelEditorPanel::ApplyEyedropper(), yaze::editor::PixelEditorPanel::ApplyFill(), yaze::gui::CanvasUtils::ApplyPaletteGroup(), yaze::editor::PaletteControlsPanel::ApplyPaletteToAllSheets(), yaze::editor::Tile16Editor::ApplyPaletteToCurrentTile16Bitmap(), yaze::editor::PaletteControlsPanel::ApplyPaletteToSheet(), yaze::editor::PixelEditorPanel::ApplyPencil(), yaze::gui::CanvasUtils::ApplyPendingPaletteUpdates(), yaze::gfx::PaletteManager::ApplyPreviewChanges(), yaze::gui::PaletteEditorWidget::ApplyROMPalette(), yaze::editor::LinkSpritePanel::ApplySelectedPalette(), yaze::gfx::Bitmap::Bitmap(), yaze::zelda3::Inventory::BuildTileset(), yaze::zelda3::TitleScreen::BuildTileset(), yaze::editor::OverworldEditor::CheckForCurrentMap(), yaze::editor::OverworldEditor::Clear(), yaze::editor::OverworldEditor::ClearScratchSpace(), yaze::editor::Tile16Editor::ClearTile16(), yaze::test::TestManager::CollectResourceStats(), yaze::editor::Tile16Editor::CommitChangesToBlockset(), yaze::editor::Tile16Editor::CommitChangesToOverworld(), yaze::editor::Tile16Editor::CopyTile16ToClipboard(), yaze::gfx::Bitmap::Create(), yaze::zelda3::OverworldMapScreen::Create(), yaze::zelda3::Inventory::Create(), yaze::gfx::Bitmap::CreateTexture(), yaze::gfx::CreateTilemap(), yaze::editor::GraphicsEditor::DecompressImportData(), yaze::editor::GraphicsEditor::DecompressSuperDonkey(), yaze::Controller::DoRender(), yaze::editor::DungeonRoomGraphicsPanel::Draw(), yaze::editor::OverworldEditor::DrawAreaGraphics(), yaze::gui::DrawBitmap(), yaze::gui::DrawBitmapPreview(), yaze::editor::GfxGroupEditor::DrawBlocksetViewer(), yaze::editor::PixelEditorPanel::DrawCanvas(), yaze::editor::GraphicsEditor::DrawCgxImport(), yaze::editor::PixelEditorPanel::DrawColorPicker(), yaze::editor::SpriteEditor::DrawCurrentSheets(), yaze::editor::ScreenEditor::DrawDungeonMapScreen(), yaze::editor::ScreenEditor::DrawDungeonMapsRoomGfx(), yaze::editor::PixelEditorPanel::DrawLine(), yaze::editor::MessageEditor::DrawMessagePreview(), yaze::editor::PixelEditorPanel::DrawMiniMap(), yaze::editor::ScreenEditor::DrawOverworldMapEditor(), yaze::editor::PixelEditorPanel::DrawRectangle(), yaze::editor::DungeonCanvasViewer::DrawRoomBackgroundLayers(), yaze::editor::DungeonObjectSelector::DrawRoomGraphics(), yaze::editor::GfxGroupEditor::DrawRoomsetViewer(), yaze::editor::OverworldEditor::DrawScratchSpace(), yaze::editor::GraphicsEditor::DrawScrImport(), yaze::editor::SheetBrowserPanel::DrawSheetGrid(), yaze::editor::LinkSpritePanel::DrawSheetThumbnail(), yaze::editor::GfxGroupEditor::DrawSpritesetViewer(), yaze::editor::OverworldEditor::DrawTile8Selector(), yaze::editor::ScreenEditor::DrawTitleScreenBG1Canvas(), yaze::editor::ScreenEditor::DrawTitleScreenBG2Canvas(), yaze::editor::ScreenEditor::DrawTitleScreenCompositeCanvas(), yaze::editor::ScreenEditor::DrawTitleScreenEditor(), yaze::editor::Tile16Editor::DrawToCurrentTile16(), yaze::editor::PixelEditorPanel::DrawToolbar(), yaze::editor::PixelEditorPanel::EndSelection(), yaze::editor::OverworldEditor::EnsureMapTexture(), yaze::cli::agent::tools::VisualAnalysisBase::ExtractTileAtPosition(), yaze::editor::Tile16Editor::FillTile16WithTile8(), getArenaStatus(), getGfxSheetInfo(), yaze::editor::DungeonObjectSelector::GetOrCreatePreview(), yaze::editor::PixelEditorPanel::HandleCanvasInput(), yaze::cli::HandleGfxExportLegacy(), yaze::cli::HandleGfxImportLegacy(), yaze::editor::MessageEditor::Initialize(), yaze::editor::Tile16Editor::Initialize(), yaze::editor::GraphicsEditor::Load(), yaze::editor::ScreenEditor::Load(), yaze::editor::OverworldEditor::Load(), yaze::editor::EditorManager::LoadAssets(), yaze::editor::ScreenEditor::LoadBinaryGfx(), yaze::zelda3::OverworldMapScreen::LoadCustomMap(), yaze::zelda3::LoadDungeonMapGfxFromBinary(), yaze::zelda3::LoadDungeonMapTile16(), yaze::editor::OverworldEditor::LoadGraphics(), yaze::editor::OverworldEditor::LoadSpriteGraphics(), yaze::editor::SpriteEditor::LoadSpriteGraphicsBuffer(), yaze::editor::Tile16Editor::LoadTile16FromScratchSpace(), yaze::editor::Tile16Editor::LoadTile8(), yaze::zelda3::TitleScreen::LoadTitleScreen(), yaze::Controller::OnEntry(), yaze::editor::ObjectEditorPanel::OpenStaticObjectEditor(), yaze::gfx::Bitmap::operator=(), yaze::gfx::Bitmap::operator=(), yaze::editor::PixelEditorPanel::PasteSelection(), yaze::editor::Tile16Editor::PasteTile16FromClipboard(), yaze::editor::Tile16Editor::PreviewPaletteChange(), yaze::editor::DungeonEditorV2::ProcessDeferredTextures(), yaze::editor::OverworldEditor::ProcessDeferredTextures(), yaze::editor::Tile16Editor::Redo(), yaze::gfx::Bitmap::Reformat(), yaze::editor::Tile16Editor::RefreshAllPalettes(), yaze::editor::OverworldEditor::RefreshChildMapOnDemand(), yaze::editor::OverworldEditor::RefreshMapPalette(), yaze::editor::OverworldEditor::RefreshMultiAreaMapsSafely(), yaze::editor::OverworldEditor::RefreshTile16Blockset(), yaze::editor::Tile16Editor::RefreshTile16Blockset(), yaze::editor::Tile16Editor::RegenerateTile16BitmapFromROM(), yaze::zelda3::TitleScreen::RenderBG1Layer(), yaze::zelda3::TitleScreen::RenderBG2Layer(), yaze::gui::CanvasContextMenu::RenderBitmapOperationsMenu(), yaze::zelda3::TitleScreen::RenderCompositeLayer(), yaze::editor::DungeonObjectInteraction::RenderGhostPreviewBitmap(), yaze::gui::RenderPreviewPanel(), yaze::zelda3::Room::RenderRoomGraphics(), yaze::gfx::RenderTilesBatch(), yaze::editor::OverworldEditor::RenderUpdatedMapBitmap(), yaze::gfx::Bitmap::Resize(), yaze::test::ArenaTestSuite::RunArenaAllocationTest(), yaze::test::ArenaTestSuite::RunArenaCleanupTest(), yaze::test::IntegratedTestSuite::RunArenaIntegrityTest(), yaze::test::IntegratedTestSuite::RunArenaResourceManagementTest(), yaze::test::ArenaTestSuite::RunArenaResourceTrackingTest(), yaze::test::IntegratedTestSuite::RunGraphicsValidationTest(), yaze::test::PerformanceTestSuite::RunMemoryUsageTest(), yaze::test::PerformanceTestSuite::RunResourceLeakTest(), yaze::editor::GraphicsEditor::Save(), yaze::editor::OverworldEditor::SaveCurrentSelectionToScratch(), yaze::gfx::PaletteManager::SaveGroup(), yaze::editor::EditorManager::SaveRom(), yaze::editor::Tile16Editor::SaveTile16ToScratchSpace(), yaze::editor::PixelEditorPanel::SaveUndoState(), yaze::editor::Tile16Editor::SetCurrentTile(), yaze::platform::SDL2WindowBackend::Shutdown(), yaze::core::ShutdownWindow(), yaze::editor::Tile16Editor::Undo(), yaze::editor::Tile16Editor::UpdateBlocksetBitmap(), yaze::editor::OverworldEditor::UpdateBlocksetWithPendingTileChanges(), yaze::editor::Tile16Editor::UpdateLivePreview(), yaze::editor::Tile16Editor::UpdateOverworldTilemap(), yaze::editor::OverworldEditor::UpdateScratchBitmapTile(), yaze::gfx::Bitmap::UpdateTexture(), yaze::gfx::UpdateTile16(), yaze::editor::Tile16Editor::UpdateTile16Edit(), yaze::editor::Tile16Editor::UpdateTile8Palette(), and yaze::gfx::UpdateTilemap().

◆ Initialize()

void yaze::gfx::Arena::Initialize ( IRenderer * renderer)

Definition at line 15 of file arena.cc.

References renderer_.

Referenced by yaze::Controller::OnEntry().

◆ QueueTextureCommand()

void yaze::gfx::Arena::QueueTextureCommand ( TextureCommandType type,
Bitmap * bitmap )

Definition at line 34 of file arena.cc.

References yaze::gfx::Bitmap::generation(), and texture_command_queue_.

Referenced by yaze::gui::CanvasUtils::ApplyPaletteGroup(), yaze::editor::Tile16Editor::ApplyPaletteToCurrentTile16Bitmap(), yaze::gui::CanvasUtils::ApplyPendingPaletteUpdates(), yaze::gui::PaletteEditorWidget::ApplyROMPalette(), yaze::editor::LinkSpritePanel::ApplySelectedPalette(), yaze::zelda3::Inventory::BuildTileset(), yaze::zelda3::TitleScreen::BuildTileset(), yaze::editor::OverworldEditor::CheckForCurrentMap(), yaze::editor::OverworldEditor::ClearScratchSpace(), yaze::editor::Tile16Editor::ClearTile16(), yaze::editor::Tile16Editor::CommitChangesToBlockset(), yaze::editor::Tile16Editor::CommitChangesToOverworld(), yaze::editor::Tile16Editor::CopyTile16ToClipboard(), yaze::zelda3::OverworldMapScreen::Create(), yaze::zelda3::Inventory::Create(), yaze::gfx::Bitmap::CreateTexture(), yaze::gfx::CreateTilemap(), yaze::editor::GraphicsEditor::DecompressImportData(), yaze::editor::GraphicsEditor::DecompressSuperDonkey(), yaze::editor::DungeonRoomGraphicsPanel::Draw(), yaze::editor::OverworldEditor::DrawAreaGraphics(), yaze::gui::DrawBitmap(), yaze::gui::DrawBitmapPreview(), yaze::editor::GraphicsEditor::DrawCgxImport(), yaze::editor::ScreenEditor::DrawDungeonMapScreen(), yaze::editor::ScreenEditor::DrawDungeonMapsRoomGfx(), yaze::editor::MessageEditor::DrawMessagePreview(), yaze::editor::ScreenEditor::DrawOverworldMapEditor(), yaze::editor::DungeonCanvasViewer::DrawRoomBackgroundLayers(), yaze::editor::OverworldEditor::DrawScratchSpace(), yaze::editor::GraphicsEditor::DrawScrImport(), yaze::editor::LinkSpritePanel::DrawSheetThumbnail(), yaze::editor::ScreenEditor::DrawTitleScreenBG1Canvas(), yaze::editor::ScreenEditor::DrawTitleScreenBG2Canvas(), yaze::editor::ScreenEditor::DrawTitleScreenCompositeCanvas(), yaze::editor::ScreenEditor::DrawTitleScreenEditor(), yaze::editor::Tile16Editor::DrawToCurrentTile16(), yaze::editor::OverworldEditor::EnsureMapTexture(), yaze::editor::Tile16Editor::FillTile16WithTile8(), yaze::editor::DungeonObjectSelector::GetOrCreatePreview(), yaze::editor::MessageEditor::Initialize(), yaze::editor::Tile16Editor::Initialize(), yaze::editor::GraphicsEditor::Load(), yaze::editor::ScreenEditor::Load(), yaze::editor::ScreenEditor::LoadBinaryGfx(), yaze::zelda3::OverworldMapScreen::LoadCustomMap(), yaze::zelda3::LoadDungeonMapGfxFromBinary(), yaze::zelda3::LoadDungeonMapTile16(), yaze::editor::OverworldEditor::LoadGraphics(), yaze::editor::OverworldEditor::LoadSpriteGraphics(), yaze::editor::Tile16Editor::LoadTile16FromScratchSpace(), yaze::editor::Tile16Editor::LoadTile8(), yaze::zelda3::TitleScreen::LoadTitleScreen(), NotifySheetModified(), yaze::editor::ObjectEditorPanel::OpenStaticObjectEditor(), yaze::gfx::Bitmap::operator=(), yaze::editor::Tile16Editor::PasteTile16FromClipboard(), yaze::editor::Tile16Editor::PreviewPaletteChange(), yaze::editor::Tile16Editor::Redo(), yaze::editor::Tile16Editor::RefreshAllPalettes(), yaze::editor::OverworldEditor::RefreshChildMapOnDemand(), yaze::editor::OverworldEditor::RefreshMapPalette(), yaze::editor::OverworldEditor::RefreshMultiAreaMapsSafely(), yaze::editor::OverworldEditor::RefreshTile16Blockset(), yaze::editor::Tile16Editor::RefreshTile16Blockset(), yaze::editor::Tile16Editor::RegenerateTile16BitmapFromROM(), yaze::zelda3::TitleScreen::RenderBG1Layer(), yaze::zelda3::TitleScreen::RenderBG2Layer(), yaze::gui::CanvasContextMenu::RenderBitmapOperationsMenu(), yaze::zelda3::TitleScreen::RenderCompositeLayer(), yaze::editor::DungeonObjectInteraction::RenderGhostPreviewBitmap(), yaze::gui::RenderPreviewPanel(), yaze::zelda3::Room::RenderRoomGraphics(), yaze::gfx::RenderTilesBatch(), yaze::editor::OverworldEditor::RenderUpdatedMapBitmap(), yaze::editor::OverworldEditor::SaveCurrentSelectionToScratch(), yaze::editor::Tile16Editor::SaveTile16ToScratchSpace(), yaze::editor::Tile16Editor::SetCurrentTile(), yaze::editor::Tile16Editor::Undo(), yaze::editor::Tile16Editor::UpdateBlocksetBitmap(), yaze::editor::OverworldEditor::UpdateBlocksetWithPendingTileChanges(), yaze::editor::Tile16Editor::UpdateLivePreview(), yaze::editor::Tile16Editor::UpdateOverworldTilemap(), yaze::editor::OverworldEditor::UpdateScratchBitmapTile(), yaze::gfx::Bitmap::UpdateTexture(), yaze::gfx::UpdateTile16(), yaze::editor::Tile16Editor::UpdateTile16Edit(), yaze::editor::Tile16Editor::UpdateTile8Palette(), and yaze::gfx::UpdateTilemap().

Here is the call graph for this function:

◆ ProcessTextureQueue()

◆ HasPendingTextures()

bool yaze::gfx::Arena::HasPendingTextures ( ) const
inline

Check if there are pending textures to process.

Returns
true if texture queue has pending commands

Definition at line 68 of file arena.h.

References texture_command_queue_.

◆ ProcessSingleTexture()

bool yaze::gfx::Arena::ProcessSingleTexture ( IRenderer * renderer)

Process a single texture command for frame-budget-aware loading.

Parameters
rendererThe renderer to use for texture operations
Returns
true if a texture was processed, false if queue was empty

Definition at line 40 of file arena.cc.

References CREATE, yaze::gfx::IRenderer::CreateTexture(), DESTROY, yaze::gfx::IRenderer::DestroyTexture(), LOG_DEBUG, LOG_ERROR, renderer_, texture_command_queue_, UPDATE, and yaze::gfx::IRenderer::UpdateTexture().

Here is the call graph for this function:

◆ AllocateSurface()

SDL_Surface * yaze::gfx::Arena::AllocateSurface ( int width,
int height,
int depth,
int format )

◆ FreeSurface()

◆ Shutdown()

◆ GetTextureCount()

size_t yaze::gfx::Arena::GetTextureCount ( ) const
inline

Definition at line 84 of file arena.h.

References textures_.

◆ GetSurfaceCount()

size_t yaze::gfx::Arena::GetSurfaceCount ( ) const
inline

Definition at line 85 of file arena.h.

References surfaces_.

◆ GetPooledTextureCount()

size_t yaze::gfx::Arena::GetPooledTextureCount ( ) const
inline

Definition at line 86 of file arena.h.

References yaze::gfx::Arena::TexturePool::available_textures_, and texture_pool_.

◆ GetPooledSurfaceCount()

size_t yaze::gfx::Arena::GetPooledSurfaceCount ( ) const
inline

Definition at line 89 of file arena.h.

References yaze::gfx::Arena::SurfacePool::available_surfaces_, and surface_pool_.

◆ texture_command_queue_size()

size_t yaze::gfx::Arena::texture_command_queue_size ( ) const
inline

Definition at line 92 of file arena.h.

References texture_command_queue_.

◆ gfx_sheets()

◆ gfx_sheet()

auto yaze::gfx::Arena::gfx_sheet ( int i)
inline

Get a specific graphics sheet by index.

Parameters
iSheet index (0-222)
Returns
Copy of the Bitmap at index i, or empty Bitmap if out of bounds

Definition at line 108 of file arena.h.

References gfx_sheets_.

◆ mutable_gfx_sheet()

auto yaze::gfx::Arena::mutable_gfx_sheet ( int i)
inline

Get mutable reference to a specific graphics sheet.

Parameters
iSheet index (0-222)
Returns
Pointer to mutable Bitmap at index i, or nullptr if out of bounds

Definition at line 118 of file arena.h.

References gfx_sheets_.

◆ mutable_gfx_sheets()

◆ NotifySheetModified()

◆ NotifyPaletteModified()

void yaze::gfx::Arena::NotifyPaletteModified ( const std::string & group_name,
int palette_index = -1 )

Notify all listeners that a palette has been modified.

Parameters
group_nameThe palette group name (e.g., "ow_main", "dungeon_main")
palette_indexSpecific palette index, or -1 for entire group

This triggers bitmap refresh in editors using these palettes

Definition at line 343 of file arena.cc.

References LOG_DEBUG, LOG_ERROR, and palette_listeners_.

Referenced by yaze::gfx::PaletteManager::ApplyPreviewChanges(), and yaze::gfx::PaletteManager::SaveGroup().

◆ RegisterPaletteListener()

int yaze::gfx::Arena::RegisterPaletteListener ( PaletteChangeCallback callback)

Register a callback for palette change notifications.

Parameters
callbackFunction to call when palettes change
Returns
Unique ID for this listener (use to unregister)

Definition at line 360 of file arena.cc.

References LOG_DEBUG, next_palette_listener_id_, and palette_listeners_.

Referenced by yaze::editor::OverworldEditor::Load().

◆ UnregisterPaletteListener()

void yaze::gfx::Arena::UnregisterPaletteListener ( int listener_id)

Unregister a palette change listener.

Parameters
listener_idThe ID returned from RegisterPaletteListener

Definition at line 367 of file arena.cc.

References LOG_DEBUG, and palette_listeners_.

Referenced by yaze::editor::OverworldEditor::Clear().

◆ bg1()

auto & yaze::gfx::Arena::bg1 ( )
inline

Get reference to background layer 1 buffer.

Returns
Reference to BackgroundBuffer for layer 1

Definition at line 171 of file arena.h.

References bg1_.

◆ bg2()

auto & yaze::gfx::Arena::bg2 ( )
inline

Get reference to background layer 2 buffer.

Returns
Reference to BackgroundBuffer for layer 2

Definition at line 177 of file arena.h.

References bg2_.

Member Data Documentation

◆ bg1_

BackgroundBuffer yaze::gfx::Arena::bg1_
private

Definition at line 182 of file arena.h.

Referenced by bg1().

◆ bg2_

BackgroundBuffer yaze::gfx::Arena::bg2_
private

Definition at line 183 of file arena.h.

Referenced by bg2().

◆ kTilesPerRow

constexpr int yaze::gfx::Arena::kTilesPerRow = 64
staticconstexprprivate

Definition at line 185 of file arena.h.

◆ kTilesPerColumn

constexpr int yaze::gfx::Arena::kTilesPerColumn = 64
staticconstexprprivate

Definition at line 186 of file arena.h.

◆ kTotalTiles

constexpr int yaze::gfx::Arena::kTotalTiles = kTilesPerRow * kTilesPerColumn
staticconstexprprivate

Definition at line 187 of file arena.h.

◆ layer1_buffer_

std::array<uint16_t, kTotalTiles> yaze::gfx::Arena::layer1_buffer_
private

Definition at line 189 of file arena.h.

Referenced by Arena().

◆ layer2_buffer_

std::array<uint16_t, kTotalTiles> yaze::gfx::Arena::layer2_buffer_
private

Definition at line 190 of file arena.h.

Referenced by Arena().

◆ gfx_sheets_

std::array<gfx::Bitmap, 223> yaze::gfx::Arena::gfx_sheets_
private

◆ textures_

std::unordered_map<TextureHandle, std::unique_ptr<SDL_Texture, util::SDL_Texture_Deleter> > yaze::gfx::Arena::textures_
private

Definition at line 196 of file arena.h.

Referenced by GetTextureCount(), and Shutdown().

◆ surfaces_

std::unordered_map<SDL_Surface*, std::unique_ptr<SDL_Surface, util::SDL_Surface_Deleter> > yaze::gfx::Arena::surfaces_
private

Definition at line 200 of file arena.h.

Referenced by AllocateSurface(), FreeSurface(), GetSurfaceCount(), and Shutdown().

◆ texture_pool_

struct yaze::gfx::Arena::TexturePool yaze::gfx::Arena::texture_pool_
private

Referenced by GetPooledTextureCount(), and Shutdown().

◆ surface_pool_

struct yaze::gfx::Arena::SurfacePool yaze::gfx::Arena::surface_pool_
private

◆ texture_command_queue_

std::vector<TextureCommand> yaze::gfx::Arena::texture_command_queue_
private

◆ renderer_

IRenderer* yaze::gfx::Arena::renderer_ = nullptr
private

Definition at line 217 of file arena.h.

Referenced by Initialize(), ProcessSingleTexture(), ProcessTextureQueue(), and Shutdown().

◆ palette_listeners_

std::unordered_map<int, PaletteChangeCallback> yaze::gfx::Arena::palette_listeners_
private

◆ next_palette_listener_id_

int yaze::gfx::Arena::next_palette_listener_id_ = 1
private

Definition at line 221 of file arena.h.

Referenced by RegisterPaletteListener().


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