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)
 

Static Public Member Functions

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 }
 

Private Member Functions

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

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

Member Function Documentation

◆ ebo()

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

◆ enabled()

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

◆ gen()

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

◆ init()

void nngn::Map::init ( Textures * t)
inline
Here is the caller graph for this function:

◆ load()

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 call graph for this function:
Here is the caller graph for this function:

◆ load_tiles()

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

◆ perspective()

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

◆ set_enabled()

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

◆ set_graphics()

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

◆ set_max()

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:

◆ vbo()

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: