1#ifndef YAZE_APP_GFX_ARENA_H
2#define YAZE_APP_GFX_ARENA_H
9#include <unordered_map>
62 SDL_Surface*
AllocateSurface(
int width,
int height,
int depth,
int format);
136 std::unique_ptr<SDL_Texture, util::SDL_Texture_Deleter>>
139 std::unordered_map<SDL_Surface*,
140 std::unique_ptr<SDL_Surface, util::SDL_Surface_Deleter>>
152 std::unordered_map<SDL_Surface*, std::tuple<int, int, int, int>>
surface_info_;
Resource management arena for efficient graphics memory handling.
size_t GetSurfaceCount() const
std::unordered_map< SDL_Surface *, std::unique_ptr< SDL_Surface, util::SDL_Surface_Deleter > > surfaces_
void Initialize(IRenderer *renderer)
struct yaze::gfx::Arena::TexturePool texture_pool_
SDL_Surface * AllocateSurface(int width, int height, int depth, int format)
std::unordered_map< TextureHandle, std::unique_ptr< SDL_Texture, util::SDL_Texture_Deleter > > textures_
size_t GetPooledSurfaceCount() const
auto gfx_sheet(int i)
Get a specific graphics sheet by index.
static constexpr int kTotalTiles
size_t GetTextureCount() const
void QueueTextureCommand(TextureCommandType type, Bitmap *bitmap)
std::array< uint16_t, kTotalTiles > layer2_buffer_
static constexpr int kTilesPerColumn
size_t GetPooledTextureCount() const
static constexpr int kTilesPerRow
auto mutable_gfx_sheets()
Get mutable reference to all graphics sheets.
void FreeSurface(SDL_Surface *surface)
auto mutable_gfx_sheet(int i)
Get mutable reference to a specific graphics sheet.
void ProcessTextureQueue(IRenderer *renderer)
std::array< gfx::Bitmap, 223 > gfx_sheets_
auto & bg2()
Get reference to background layer 2 buffer.
std::array< gfx::Bitmap, 223 > & gfx_sheets()
Get reference to all graphics sheets.
std::vector< TextureCommand > texture_command_queue_
std::array< uint16_t, kTotalTiles > layer1_buffer_
void NotifySheetModified(int sheet_index)
Notify Arena that a graphics sheet has been modified.
auto & bg1()
Get reference to background layer 1 buffer.
struct yaze::gfx::Arena::SurfacePool surface_pool_
Represents a bitmap image optimized for SNES ROM hacking.
Defines an abstract interface for all rendering operations.
void * TextureHandle
An abstract handle representing a texture.
Main namespace for the application.
static constexpr size_t MAX_POOL_SIZE
std::vector< SDL_Surface * > available_surfaces_
std::unordered_map< SDL_Surface *, std::tuple< int, int, int, int > > surface_info_
static constexpr size_t MAX_POOL_SIZE
std::vector< TextureHandle > available_textures_
std::unordered_map< TextureHandle, std::pair< int, int > > texture_sizes_