Botcraft 1.21.4
Loading...
Searching...
No Matches
Botcraft::Renderer::Atlas Class Reference

#include <Atlas.hpp>

Public Member Functions

 Atlas ()
 
 ~Atlas ()
 
void Reset (const int height_, const int width_)
 
void LoadData (const std::vector< std::pair< std::string, std::string > > &textures_path)
 
int GetWidth () const
 
int GetHeight () const
 
const TextureDataGetData (const std::string &name) const
 
const unsigned char * Get (const int row=0, const int col=0, const int depth=0) const
 

Private Member Functions

unsigned char * Get (const int row=0, const int col=0, const int depth=0)
 

Private Attributes

std::vector< unsigned char > data
 
std::unordered_map< std::string, TextureDatatextures_map
 
int height
 
int width
 

Detailed Description

Definition at line 21 of file Atlas.hpp.

Constructor & Destructor Documentation

◆ Atlas()

Botcraft::Renderer::Atlas::Atlas ( )

Definition at line 36 of file Atlas.cpp.

References height, and width.

◆ ~Atlas()

Botcraft::Renderer::Atlas::~Atlas ( )

Definition at line 42 of file Atlas.cpp.

Member Function Documentation

◆ Get() [1/2]

unsigned char * Botcraft::Renderer::Atlas::Get ( const int  row = 0,
const int  col = 0,
const int  depth = 0 
)
private

Definition at line 253 of file Atlas.cpp.

References data, and width.

◆ Get() [2/2]

const unsigned char * Botcraft::Renderer::Atlas::Get ( const int  row = 0,
const int  col = 0,
const int  depth = 0 
) const

Definition at line 248 of file Atlas.cpp.

References data, and width.

Referenced by Botcraft::Renderer::WorldRenderer::InitGL(), LoadData(), and Reset().

◆ GetData()

const TextureData & Botcraft::Renderer::Atlas::GetData ( const std::string &  name) const

◆ GetHeight()

int Botcraft::Renderer::Atlas::GetHeight ( ) const

◆ GetWidth()

int Botcraft::Renderer::Atlas::GetWidth ( ) const

◆ LoadData()

◆ Reset()

void Botcraft::Renderer::Atlas::Reset ( const int  height_,
const int  width_ 
)

Definition at line 47 of file Atlas.cpp.

References data, Get(), height, textures_map, and width.

Referenced by LoadData().

Member Data Documentation

◆ data

std::vector<unsigned char> Botcraft::Renderer::Atlas::data
private

Definition at line 44 of file Atlas.hpp.

Referenced by Get(), Get(), LoadData(), and Reset().

◆ height

int Botcraft::Renderer::Atlas::height
private

Definition at line 47 of file Atlas.hpp.

Referenced by Atlas(), GetHeight(), LoadData(), and Reset().

◆ textures_map

std::unordered_map<std::string, TextureData> Botcraft::Renderer::Atlas::textures_map
private

Definition at line 45 of file Atlas.hpp.

Referenced by GetData(), LoadData(), and Reset().

◆ width

int Botcraft::Renderer::Atlas::width
private

Definition at line 48 of file Atlas.hpp.

Referenced by Atlas(), Get(), Get(), GetWidth(), LoadData(), and Reset().


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