Inexor
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | List of all members
blobrenderer Struct Reference

Public Member Functions

 blobrenderer (const char *texname)
 
 ~blobrenderer ()
 
void cleanup ()
 
void init (int tris)
 
bool freeblob ()
 
blobinfonewblob (const vec &o, float radius)
 
void dupblob ()
 
int addvert (const vec &pos)
 
void addtris (const vec *v, int numv)
 
void gentris (cube &cu, int orient, const ivec &o, int size, materialsurface *mat=nullptr, int vismask=0)
 
void findmaterials (vtxarray *va)
 
void findescaped (cube *cu, const ivec &o, int size, int escaped)
 
void gentris (cube *cu, const ivec &o, int size, int escaped=0)
 
blobinfoaddblob (const vec &o, float radius, float fade)
 
void fadeblob (blobinfo *b, float fade)
 
void renderblob (const vec &o, float radius, float fade)
 
void flushblobs ()
 

Static Public Member Functions

template<int C>
static int split (const vec *in, int numin, float below, float above, vec *out)
 
template<int C>
static int clip (const vec *in, int numin, float below, float above, vec *out)
 
static void setuprenderstate ()
 
static void cleanuprenderstate ()
 
static void reset ()
 

Public Attributes

const char * texname
 
Texturetex
 
ushortcache
 
int cachesize
 
blobinfoblobs
 
int maxblobs
 
int startblob
 
int endblob
 
blobvertverts
 
int maxverts
 
int startvert
 
int endvert
 
int availverts
 
ushortindexes
 
int maxindexes
 
int startindex
 
int endindex
 
int availindexes
 
GLuint ebo
 
GLuint vbo
 
ushortedata
 
blobvertvdata
 
int numedata
 
int numvdata
 
blobinfostartrender
 
blobinfoendrender
 
blobinfolastblob
 
vec blobmin
 
vec blobmax
 
ivec bbmin
 
ivec bbmax
 
float blobalphalow
 
float blobalphahigh
 
uchar blobalpha
 

Static Public Attributes

static int lastreset = 0
 
static blobrendererlastrender = nullptr
 

Constructor & Destructor Documentation

blobrenderer::blobrenderer ( const char *  texname)
inline
blobrenderer::~blobrenderer ( )
inline

References blobs, cache, DELETEA, indexes, and verts.

Member Function Documentation

blobinfo* blobrenderer::addblob ( const vec o,
float  radius,
float  fade 
)
inline
void blobrenderer::addtris ( const vec v,
int  numv 
)
inline
int blobrenderer::addvert ( const vec pos)
inline
void blobrenderer::cleanup ( )
inline
static void blobrenderer::cleanuprenderstate ( )
inlinestatic
template<int C>
static int blobrenderer::clip ( const vec in,
int  numin,
float  below,
float  above,
vec out 
)
inlinestatic

References vec::add(), C, loopi(), vec::mul(), and vec::sub().

void blobrenderer::dupblob ( )
inline
void blobrenderer::fadeblob ( blobinfo b,
float  fade 
)
inline
void blobrenderer::findescaped ( cube cu,
const ivec o,
int  size,
int  escaped 
)
inline

References gentris(), loopi(), loopj, and cube::merged.

Referenced by gentris().

void blobrenderer::findmaterials ( vtxarray va)
inline
void blobrenderer::flushblobs ( )
inline
bool blobrenderer::freeblob ( )
inline
void blobrenderer::gentris ( cube cu,
int  orient,
const ivec o,
int  size,
materialsurface mat = nullptr,
int  vismask = 0 
)
inline
void blobrenderer::gentris ( cube cu,
const ivec o,
int  size,
int  escaped = 0 
)
inline
void blobrenderer::init ( int  tris)
inline
blobinfo& blobrenderer::newblob ( const vec o,
float  radius 
)
inline
void blobrenderer::renderblob ( const vec o,
float  radius,
float  fade 
)
inline
static void blobrenderer::reset ( )
inlinestatic

References lastreset, and totalmillis.

Referenced by resetblobs().

static void blobrenderer::setuprenderstate ( )
inlinestatic
template<int C>
static int blobrenderer::split ( const vec in,
int  numin,
float  below,
float  above,
vec out 
)
inlinestatic

References vec::add(), C, loopi(), vec::mul(), and vec::sub().

Member Data Documentation

int blobrenderer::availindexes

Referenced by addtris(), freeblob(), and init().

int blobrenderer::availverts

Referenced by addtris(), freeblob(), and init().

ivec blobrenderer::bbmax

Referenced by addblob(), and gentris().

ivec blobrenderer::bbmin

Referenced by addblob(), and gentris().

uchar blobrenderer::blobalpha

Referenced by addblob(), and addvert().

float blobrenderer::blobalphahigh

Referenced by addblob(), and addvert().

float blobrenderer::blobalphalow

Referenced by addblob(), and addvert().

vec blobrenderer::blobmax
vec blobrenderer::blobmin
blobinfo* blobrenderer::blobs
ushort* blobrenderer::cache

Referenced by init(), renderblob(), and ~blobrenderer().

int blobrenderer::cachesize

Referenced by init(), and renderblob().

GLuint blobrenderer::ebo

Referenced by cleanup(), and flushblobs().

ushort* blobrenderer::edata

Referenced by cleanup(), and flushblobs().

int blobrenderer::endblob
int blobrenderer::endindex
blobinfo * blobrenderer::endrender

Referenced by cleanup(), flushblobs(), and renderblob().

int blobrenderer::endvert

Referenced by addtris(), addvert(), dupblob(), init(), and newblob().

ushort* blobrenderer::indexes
blobinfo* blobrenderer::lastblob
blobrenderer * blobrenderer::lastrender = nullptr
static

Referenced by flushblobs(), and renderblob().

int blobrenderer::lastreset = 0
static

Referenced by freeblob(), and reset().

int blobrenderer::maxblobs
int blobrenderer::maxindexes

Referenced by addtris(), flushblobs(), freeblob(), and init().

int blobrenderer::maxverts

Referenced by addtris(), flushblobs(), freeblob(), and init().

int blobrenderer::numedata

Referenced by cleanup(), flushblobs(), and renderblob().

int blobrenderer::numvdata

Referenced by cleanup(), flushblobs(), and renderblob().

int blobrenderer::startblob
int blobrenderer::startindex

Referenced by freeblob(), and init().

blobinfo* blobrenderer::startrender

Referenced by cleanup(), flushblobs(), and renderblob().

int blobrenderer::startvert

Referenced by freeblob(), and init().

Texture* blobrenderer::tex

Referenced by flushblobs(), init(), and renderblob().

const char* blobrenderer::texname

Referenced by init().

GLuint blobrenderer::vbo

Referenced by cleanup(), and flushblobs().

blobvert* blobrenderer::vdata

Referenced by cleanup(), and flushblobs().

blobvert* blobrenderer::verts

The documentation for this struct was generated from the following file: