nngn
Loading...
Searching...
No Matches
nngn::Map Class Reference

#include <map.h>

Collaboration diagram for nngn::Map:

Public Member Functions

void init (Textures *t)
 
u32 vbo () const
 
u32 ebo () const
 
bool set_max (std::size_t n)
 
bool set_graphics (Graphics *g)
 
bool load (unsigned int tex, float sprite_scale, float trans_x, float trans_y, float scale_x, float scale_y, unsigned int width, unsigned int height, nngn::lua::table_view tiles)
 
bool enabled () const
 
bool perspective () const
 
bool set_enabled (bool e)
 
void init (Textures *t)
 
u32 vbo () const
 
u32 ebo () const
 
bool set_max (std::size_t n)
 
bool set_graphics (Graphics *g)
 
bool load (unsigned int tex, float sprite_scale, float trans_x, float trans_y, float scale_x, float scale_y, unsigned int width, unsigned int height, nngn::lua::table_view tiles)
 
bool enabled () const
 
bool perspective () const
 
bool set_enabled (bool e)
 

Static Public Member Functions

static std::vector< uvec2load_tiles (std::size_t width, std::size_t height, nngn::lua::table_view tiles)
 
static std::vector< uvec2load_tiles (std::size_t width, std::size_t height, nngn::lua::table_view tiles)
 

Private Types

enum  Flag : uint8_t { ENABLED = 1u << 0 , PERSPECTIVE = 1u << 1 , ENABLED = 1u << 0 , PERSPECTIVE = 1u << 1 }
 
enum  Flag : uint8_t { ENABLED = 1u << 0 , PERSPECTIVE = 1u << 1 , ENABLED = 1u << 0 , PERSPECTIVE = 1u << 1 }
 

Private Member Functions

bool gen () const
 
bool gen () const
 

Private Attributes

Texturestextures = nullptr
 
Graphicsgraphics = nullptr
 
Flags< Flagm_flags = {Flag::ENABLED | Flag::PERSPECTIVE}
 
unsigned int tex = 0
 
uvec2 size = {}
 
float sprite_scale = 1.0f
 
vec2 trans = {}
 
vec2 scale = {}
 
std::vector< uvec2uv = {}
 
std::size_t max = {}
 
u32 m_vbo = {}
 
u32 m_ebo = {}
 

Member Enumeration Documentation

◆ Flag [1/2]

enum nngn::Map::Flag : uint8_t
private
Enumerator
ENABLED 
PERSPECTIVE 
ENABLED 
PERSPECTIVE 

◆ Flag [2/2]

enum nngn::Map::Flag : uint8_t
private
Enumerator
ENABLED 
PERSPECTIVE 
ENABLED 
PERSPECTIVE 

Member Function Documentation

◆ ebo() [1/2]

u32 nngn::Map::ebo ( ) const
inline

◆ ebo() [2/2]

u32 nngn::Map::ebo ( ) const
inline

◆ enabled() [1/2]

bool nngn::Map::enabled ( ) const
inline
Here is the call graph for this function:
Here is the caller graph for this function:

◆ enabled() [2/2]

bool nngn::Map::enabled ( ) const
inline
Here is the call graph for this function:

◆ gen() [1/2]

bool nngn::Map::gen ( ) const
private
Here is the call graph for this function:

◆ gen() [2/2]

bool nngn::Map::gen ( ) const
private

◆ init() [1/2]

void nngn::Map::init ( Textures t)
inline

◆ init() [2/2]

void nngn::Map::init ( Textures t)
inline

◆ load() [1/2]

bool nngn::Map::load ( unsigned int  tex,
float  sprite_scale,
float  trans_x,
float  trans_y,
float  scale_x,
float  scale_y,
unsigned int  width,
unsigned int  height,
nngn::lua::table_view  tiles 
)
Here is the caller graph for this function:

◆ load() [2/2]

bool nngn::Map::load ( unsigned int  tex,
float  sprite_scale,
float  trans_x,
float  trans_y,
float  scale_x,
float  scale_y,
unsigned int  width,
unsigned int  height,
nngn::lua::table_view  tiles 
)

◆ load_tiles() [1/2]

std::vector< uvec2 > nngn::Map::load_tiles ( std::size_t  width,
std::size_t  height,
nngn::lua::table_view  tiles 
)
static
Here is the caller graph for this function:

◆ load_tiles() [2/2]

static std::vector< uvec2 > nngn::Map::load_tiles ( std::size_t  width,
std::size_t  height,
nngn::lua::table_view  tiles 
)
static

◆ perspective() [1/2]

bool nngn::Map::perspective ( ) const
inline
Here is the call graph for this function:
Here is the caller graph for this function:

◆ perspective() [2/2]

bool nngn::Map::perspective ( ) const
inline
Here is the call graph for this function:

◆ set_enabled() [1/2]

bool nngn::Map::set_enabled ( bool  e)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ set_enabled() [2/2]

bool nngn::Map::set_enabled ( bool  e)

◆ set_graphics() [1/2]

bool nngn::Map::set_graphics ( Graphics g)
Here is the call graph for this function:

◆ set_graphics() [2/2]

bool nngn::Map::set_graphics ( Graphics g)

◆ set_max() [1/2]

bool nngn::Map::set_max ( std::size_t  n)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ set_max() [2/2]

bool nngn::Map::set_max ( std::size_t  n)

◆ vbo() [1/2]

u32 nngn::Map::vbo ( ) const
inline

◆ vbo() [2/2]

u32 nngn::Map::vbo ( ) const
inline

Member Data Documentation

◆ graphics

Graphics * nngn::Map::graphics = nullptr
private

◆ m_ebo

u32 nngn::Map::m_ebo = {}
private

◆ m_flags

Flags< Flag > nngn::Map::m_flags = {Flag::ENABLED | Flag::PERSPECTIVE}
private

◆ m_vbo

u32 nngn::Map::m_vbo = {}
private

◆ max

std::size_t nngn::Map::max = {}
private

◆ scale

vec2 nngn::Map::scale = {}
private

◆ size

uvec2 nngn::Map::size = {}
private

◆ sprite_scale

float nngn::Map::sprite_scale = 1.0f
private

◆ tex

unsigned int nngn::Map::tex = 0
private

◆ textures

Textures * nngn::Map::textures = nullptr
private

◆ trans

vec2 nngn::Map::trans = {}
private

◆ uv

std::vector< uvec2 > nngn::Map::uv = {}
private

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