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

#include <arena.h>

Collaboration diagram for yaze::gfx::Arena:

Public Member Functions

 ~Arena ()
 
SDL_Texture * AllocateTexture (SDL_Renderer *renderer, int width, int height)
 
void FreeTexture (SDL_Texture *texture)
 
void UpdateTexture (SDL_Texture *texture, SDL_Surface *surface)
 
SDL_Surface * AllocateSurface (int width, int height, int depth, int format)
 
void FreeSurface (SDL_Surface *surface)
 
std::array< gfx::Bitmap, 223 > & gfx_sheets ()
 
auto gfx_sheet (int i)
 
auto mutable_gfx_sheet (int i)
 
auto mutable_gfx_sheets ()
 
auto & bg1 ()
 
auto & bg2 ()
 

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< SDL_Texture *, std::unique_ptr< SDL_Texture, core::SDL_Texture_Deleter > > textures_
 
std::unordered_map< SDL_Surface *, std::unique_ptr< SDL_Surface, core::SDL_Surface_Deleter > > surfaces_
 

Static Private Attributes

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

Detailed Description

Definition at line 16 of file arena.h.

Constructor & Destructor Documentation

◆ ~Arena()

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

Definition at line 20 of file arena.cc.

References surfaces_, and textures_.

◆ Arena()

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

Definition at line 15 of file arena.cc.

References layer1_buffer_, and layer2_buffer_.

Referenced by Get().

Member Function Documentation

◆ Get()

◆ AllocateTexture()

SDL_Texture * yaze::gfx::Arena::AllocateTexture ( SDL_Renderer * renderer,
int width,
int height )

Definition at line 25 of file arena.cc.

References textures_.

Referenced by yaze::gfx::Bitmap::CreateTexture().

◆ FreeTexture()

void yaze::gfx::Arena::FreeTexture ( SDL_Texture * texture)

Definition at line 50 of file arena.cc.

References textures_.

◆ UpdateTexture()

void yaze::gfx::Arena::UpdateTexture ( SDL_Texture * texture,
SDL_Surface * surface )

◆ AllocateSurface()

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

Definition at line 93 of file arena.cc.

References surfaces_.

Referenced by yaze::gfx::Bitmap::Create(), and yaze::gfx::Bitmap::Reformat().

◆ FreeSurface()

void yaze::gfx::Arena::FreeSurface ( SDL_Surface * surface)

Definition at line 107 of file arena.cc.

References surfaces_.

◆ gfx_sheets()

std::array< gfx::Bitmap, 223 > & yaze::gfx::Arena::gfx_sheets ( )
inline

◆ gfx_sheet()

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

Definition at line 30 of file arena.h.

References gfx_sheets_.

◆ mutable_gfx_sheet()

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

Definition at line 31 of file arena.h.

References gfx_sheets_.

◆ mutable_gfx_sheets()

◆ bg1()

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

Definition at line 34 of file arena.h.

References bg1_.

Referenced by yaze::zelda3::Room::RenderRoomGraphics().

◆ bg2()

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

Definition at line 35 of file arena.h.

References bg2_.

Referenced by yaze::zelda3::Room::RenderRoomGraphics().

Member Data Documentation

◆ bg1_

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

Definition at line 40 of file arena.h.

Referenced by bg1().

◆ bg2_

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

Definition at line 41 of file arena.h.

Referenced by bg2().

◆ kTilesPerRow

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

Definition at line 43 of file arena.h.

◆ kTilesPerColumn

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

Definition at line 44 of file arena.h.

◆ kTotalTiles

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

Definition at line 45 of file arena.h.

◆ layer1_buffer_

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

Definition at line 47 of file arena.h.

Referenced by Arena().

◆ layer2_buffer_

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

Definition at line 48 of file arena.h.

Referenced by Arena().

◆ gfx_sheets_

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

Definition at line 50 of file arena.h.

Referenced by gfx_sheet(), gfx_sheets(), mutable_gfx_sheet(), and mutable_gfx_sheets().

◆ textures_

std::unordered_map<SDL_Texture*, std::unique_ptr<SDL_Texture, core::SDL_Texture_Deleter> > yaze::gfx::Arena::textures_
private

Definition at line 54 of file arena.h.

Referenced by AllocateTexture(), FreeTexture(), and ~Arena().

◆ surfaces_

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

Definition at line 58 of file arena.h.

Referenced by AllocateSurface(), FreeSurface(), and ~Arena().


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