R:/projects/actioncube/_svn/trunk/ac/source/src/rendercubes.cpp File Reference

#include "pch.h"
#include "cube.h"

Include dependency graph for rendercubes.cpp:


Classes

struct  strips
struct  stripbatch
struct  shadowvertex

Defines

#define RENDERSTRIPS(strips, type)
#define vert(v1, v2, v3, ls, t1, t2)
#define stripend(verts)
#define shadowvert(v1, v2, v3)
#define df(x)   s->floor-(x->vdelta/4.0f)

Functions

void finishstrips ()
void setupstrips ()
void renderstripssky ()
void renderstrips ()
void addstrip (int type, int tex, int start, int n)
void showmip ()
void mipstats (int a, int b, int c)
 COMMAND (showmip, ARG_NONE)
 VAR (mergestrips, 0, 1, 1)
 VARP (lighterror, 1, 4, 100)
void render_flat (int wtex, int x, int y, int size, int h, sqr *l1, sqr *l2, sqr *l3, sqr *l4, bool isceil)
void render_flatdelta (int wtex, int x, int y, int size, float h1, float h2, float h3, float h4, sqr *l1, sqr *l2, sqr *l3, sqr *l4, bool isceil)
void render_2tris (sqr *h, sqr *s, int x1, int y1, int x2, int y2, int x3, int y3, sqr *l1, sqr *l2, sqr *l3)
void render_tris (int x, int y, int size, bool topleft, sqr *h1, sqr *h2, sqr *s, sqr *t, sqr *u, sqr *v)
void render_square (int wtex, float floor1, float floor2, float ceil1, float ceil2, int x1, int y1, int x2, int y2, int size, sqr *l1, sqr *l2, bool flip)
void resetcubes ()
static void resetshadowverts ()
static void rendershadowstrips ()
void rendershadow_tri (sqr *h, int x1, int y1, int x2, int y2, int x3, int y3)
void rendershadow_tris (int x, int y, bool topleft, sqr *h1, sqr *h2)
static void rendershadow_flat (int x, int y, int h)
static void rendershadow_flatdelta (int x, int y, float h1, float h2, float h3, float h4)
void rendershadow (int x, int y, int xs, int ys, const vec &texgenS, const vec &texgenT)

Variables

vector< vertex > verts
stripbatch skystrips = { DEFAULT_SKY }
stripbatch stripbatches [256]
uchar renderedtex [256]
int renderedtexs = 0
int ati_mda_bug
int nquads
const float TEXTURESCALE = 32.0f
bool floorstrip = false
bool deltastrip = false
int oh
int oy
int ox
int striptex
int ol3r
int ol3g
int ol3b
int ol4r
int ol4g
int ol4b
int firstindex
bool showm = false
sqr sbright
sqr sdark
vector< shadowvertex > shadowverts

Define Documentation

#define df ( x   )     s->floor-(x->vdelta/4.0f)

#define RENDERSTRIPS ( strips,
type   ) 

Value:

if(strips.first.length()) \
    { \
        if(hasMDA && !ati_mda_bug) glMultiDrawArrays_(type, strips.first.getbuf(), strips.count.getbuf(), strips.first.length()); \
        else loopv(strips.first) glDrawArrays(type, strips.first[i], strips.count[i]); \
        strips.first.setsizenodelete(0); \
        strips.count.setsizenodelete(0); \
    }

#define shadowvert ( v1,
v2,
v3   ) 

Value:

{ \
    shadowvertex &v = shadowverts.add(); \
    v.x = (float)(v1); v.y = (float)(v2); v.z = (float)(v3); \
}

#define stripend ( verts   ) 

Value:

if(floorstrip || deltastrip) { \
        int type = GL_TRIANGLE_STRIP, len = verts.length()-firstindex; \
        if(mergestrips) switch(len) { \
            case 3: type = GL_TRIANGLES; break; \
            case 4: type = GL_QUADS; swap(verts.last(), verts[verts.length()-2]); break; \
         } \
         addstrip(type, striptex, firstindex, len); \
         floorstrip = deltastrip = false; \
    }

#define vert ( v1,
v2,
v3,
ls,
t1,
t2   ) 

Value:

{ \
        vertex &v = verts.add(); \
    v.u = t1; v.v = t2; \
    v.x = (float)(v1); v.y = (float)(v2); v.z = (float)(v3); \
    v.r = ls->r; v.g = ls->g; v.b = ls->b; v.a = 255; \
}


Function Documentation

void addstrip ( int  type,
int  tex,
int  start,
int  n 
)

COMMAND ( showmip  ,
ARG_NONE   
)

void finishstrips (  ) 

void mipstats ( int  a,
int  b,
int  c 
)

void render_2tris ( sqr *  h,
sqr *  s,
int  x1,
int  y1,
int  x2,
int  y2,
int  x3,
int  y3,
sqr *  l1,
sqr *  l2,
sqr *  l3 
)

void render_flat ( int  wtex,
int  x,
int  y,
int  size,
int  h,
sqr *  l1,
sqr *  l2,
sqr *  l3,
sqr *  l4,
bool  isceil 
)

void render_flatdelta ( int  wtex,
int  x,
int  y,
int  size,
float  h1,
float  h2,
float  h3,
float  h4,
sqr *  l1,
sqr *  l2,
sqr *  l3,
sqr *  l4,
bool  isceil 
)

void render_square ( int  wtex,
float  floor1,
float  floor2,
float  ceil1,
float  ceil2,
int  x1,
int  y1,
int  x2,
int  y2,
int  size,
sqr *  l1,
sqr *  l2,
bool  flip 
)

void render_tris ( int  x,
int  y,
int  size,
bool  topleft,
sqr *  h1,
sqr *  h2,
sqr *  s,
sqr *  t,
sqr *  u,
sqr *  v 
)

void rendershadow ( int  x,
int  y,
int  xs,
int  ys,
const vec &  texgenS,
const vec &  texgenT 
)

static void rendershadow_flat ( int  x,
int  y,
int  h 
) [static]

static void rendershadow_flatdelta ( int  x,
int  y,
float  h1,
float  h2,
float  h3,
float  h4 
) [static]

void rendershadow_tri ( sqr *  h,
int  x1,
int  y1,
int  x2,
int  y2,
int  x3,
int  y3 
)

void rendershadow_tris ( int  x,
int  y,
bool  topleft,
sqr *  h1,
sqr *  h2 
)

static void rendershadowstrips (  )  [static]

void renderstrips (  ) 

void renderstripssky (  ) 

void resetcubes (  ) 

static void resetshadowverts (  )  [static]

void setupstrips (  ) 

void showmip (  ) 

VAR ( mergestrips  ,
0  ,
1  ,
1   
)

VARP ( lighterror  ,
1  ,
4  ,
100   
)


Variable Documentation

bool deltastrip = false

bool floorstrip = false

int nquads

int oh

int ol3b

int ol3g

int ol3r

int ol4b

int ol4g

int ol4r

int ox

int oy

int renderedtexs = 0

bool showm = false

stripbatch skystrips = { DEFAULT_SKY }

int striptex

const float TEXTURESCALE = 32.0f


Generated on Mon Dec 8 21:41:32 2008 for AssaultCube by  doxygen 1.5.7.1