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

Public Member Functions

 decalrenderer (const char *texname, int flags=0, int fadeintime=0, int fadeouttime=1000, int timetolive=-1)
 
 ~decalrenderer ()
 
void init (int tris)
 
int hasdecals ()
 
void cleanup ()
 
void cleardecals ()
 
int freedecal ()
 
void fadedecal (decalinfo &d, uchar alpha)
 
void clearfadeddecals ()
 
void fadeindecals ()
 
void fadeoutdecals ()
 
void render ()
 
decalinfonewdecal ()
 
void adddecal (const vec &center, const vec &dir, float radius, const bvec &color, int info)
 
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)
 

Static Public Member Functions

static void setuprenderstate ()
 
static void cleanuprenderstate ()
 
static int clip (const vec *in, int numin, const vec &dir, float below, float above, vec *out)
 

Public Attributes

const char * texname
 
int flags
 
int fadeintime
 
int fadeouttime
 
int timetolive
 
Texturetex
 
decalinfodecals
 
int maxdecals
 
int startdecal
 
int enddecal
 
decalvertverts
 
int maxverts
 
int startvert
 
int endvert
 
int lastvert
 
int availverts
 
GLuint vbo
 
bool dirty
 
ivec bbmin
 
ivec bbmax
 
vec decalcenter
 
vec decalnormal
 
vec decaltangent
 
vec decalbitangent
 
float decalradius
 
float decalu
 
float decalv
 
bvec4 decalcolor
 

Constructor & Destructor Documentation

decalrenderer::decalrenderer ( const char *  texname,
int  flags = 0,
int  fadeintime = 0,
int  fadeouttime = 1000,
int  timetolive = -1 
)
inline
decalrenderer::~decalrenderer ( )
inline

References decals, DELETEA, and verts.

Member Function Documentation

void decalrenderer::adddecal ( const vec center,
const vec dir,
float  radius,
const bvec color,
int  info 
)
inline
void decalrenderer::cleanup ( )
inline

References glDeleteBuffers_, and vbo.

Referenced by cleanupdecals().

static void decalrenderer::cleanuprenderstate ( )
inlinestatic

References gle::clearvbo(), and disablepolygonoffset().

Referenced by renderdecals().

void decalrenderer::cleardecals ( )
inline
void decalrenderer::clearfadeddecals ( )
inline
static int decalrenderer::clip ( const vec in,
int  numin,
const vec dir,
float  below,
float  above,
vec out 
)
inlinestatic

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

Referenced by gentris().

void decalrenderer::fadedecal ( decalinfo d,
uchar  alpha 
)
inline
void decalrenderer::fadeindecals ( )
inline
void decalrenderer::fadeoutdecals ( )
inline
void decalrenderer::findescaped ( cube cu,
const ivec o,
int  size,
int  escaped 
)
inline

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

Referenced by gentris().

void decalrenderer::findmaterials ( vtxarray va)
inline
int decalrenderer::freedecal ( )
inline
void decalrenderer::gentris ( cube cu,
int  orient,
const ivec o,
int  size,
materialsurface mat = nullptr,
int  vismask = 0 
)
inline
void decalrenderer::gentris ( cube cu,
const ivec o,
int  size,
int  escaped = 0 
)
inline
int decalrenderer::hasdecals ( )
inline

References enddecal, maxdecals, and startdecal.

Referenced by renderdecals().

void decalrenderer::init ( int  tris)
inline
decalinfo& decalrenderer::newdecal ( )
inline

References hmap::d, decals, dirty, enddecal, freedecal(), maxdecals, and startdecal.

Referenced by adddecal().

void decalrenderer::render ( )
inline
static void decalrenderer::setuprenderstate ( )
inlinestatic

References enablepolygonoffset().

Referenced by renderdecals().

Member Data Documentation

int decalrenderer::availverts
ivec decalrenderer::bbmax

Referenced by adddecal(), findmaterials(), and gentris().

ivec decalrenderer::bbmin

Referenced by adddecal(), findmaterials(), and gentris().

vec decalrenderer::decalbitangent

Referenced by adddecal(), and gentris().

vec decalrenderer::decalcenter

Referenced by adddecal(), and gentris().

bvec4 decalrenderer::decalcolor

Referenced by adddecal(), and gentris().

vec decalrenderer::decalnormal

Referenced by adddecal(), findmaterials(), and gentris().

float decalrenderer::decalradius

Referenced by adddecal(), and gentris().

decalinfo* decalrenderer::decals
vec decalrenderer::decaltangent

Referenced by adddecal(), and gentris().

float decalrenderer::decalu

Referenced by adddecal(), and gentris().

float decalrenderer::decalv

Referenced by adddecal(), and gentris().

bool decalrenderer::dirty
int decalrenderer::enddecal
int decalrenderer::endvert
int decalrenderer::fadeintime

Referenced by fadeindecals().

int decalrenderer::fadeouttime

Referenced by clearfadeddecals(), and fadeoutdecals().

int decalrenderer::flags

Referenced by adddecal(), fadedecal(), gentris(), and render().

int decalrenderer::lastvert
int decalrenderer::maxdecals
int decalrenderer::maxverts
int decalrenderer::startdecal
int decalrenderer::startvert
Texture* decalrenderer::tex

Referenced by init(), and render().

const char* decalrenderer::texname

Referenced by init().

int decalrenderer::timetolive

Referenced by clearfadeddecals(), and fadeoutdecals().

GLuint decalrenderer::vbo

Referenced by cleanup(), and render().

decalvert* decalrenderer::verts

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