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

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

Include dependency graph for texture.cpp:


Classes

struct  Slot
struct  tmufunc
struct  tmu

Defines

#define FUNCNAME(name)   name##1
#define DEFPIXEL   uint OP(r, 0);
#define PIXELOP   OP(r, 0);
#define BPP   1
#define FUNCNAME(name)   name##2
#define DEFPIXEL   uint OP(r, 0), OP(g, 1);
#define PIXELOP   OP(r, 0); OP(g, 1);
#define BPP   2
#define FUNCNAME(name)   name##3
#define DEFPIXEL   uint OP(r, 0), OP(g, 1), OP(b, 2);
#define PIXELOP   OP(r, 0); OP(g, 1); OP(b, 2);
#define BPP   3
#define FUNCNAME(name)   name##4
#define DEFPIXEL   uint OP(r, 0), OP(g, 1), OP(b, 2), OP(a, 3);
#define PIXELOP   OP(r, 0); OP(g, 1); OP(b, 2); OP(a, 3);
#define BPP   4
#define INVALIDTMU
#define INITTMU
#define MAXTMUS   4

Functions

void scaletexture (uchar *src, uint sw, uint sh, uint bpp, uchar *dst, uint dw, uint dh)
 VAR (hwtexsize, 1, 0, 0)
 VARFP (maxtexsize, 0, 0, 1<< 12, initwarning("texture quality", INIT_LOAD))
 VARFP (trilinear, 0, 1, 1, initwarning("texture filtering", INIT_LOAD))
 VARFP (bilinear, 0, 1, 1, initwarning("texture filtering", INIT_LOAD))
int formatsize (GLenum format)
void resizetexture (int w, int h, bool mipmap, GLenum target, int &tw, int &th)
void uploadtexture (GLenum target, GLenum internal, int tw, int th, GLenum format, GLenum type, void *pixels, int pw, int ph, bool mipmap)
void createtexture (int tnum, int w, int h, void *pixels, int clamp, bool mipmap, GLenum format)
GLenum texformat (int bpp)
SDL_Surface * texdecal (SDL_Surface *s)
GLuint loadsurface (const char *texname, int &xs, int &ys, int &bpp, int clamp)
Texture * textureload (const char *name, int clamp)
void texturereset ()
void texture (char *aframe, char *name)
 COMMAND (texturereset, ARG_NONE)
 COMMAND (texture, ARG_2STR)
Texture * lookuptexture (int tex, Texture *failtex)
void cleanuptextures ()
bool reloadtexture (Texture &t)
bool reloadtexture (const char *name)
void reloadtextures ()
void loadsky (char *basename)
 COMMAND (loadsky, ARG_1STR)
void loadnotexture (char *c)
 COMMAND (loadnotexture, ARG_1STR)
void draw_envbox_face (float s0, float t0, float x0, float y0, float z0, float s1, float t1, float x1, float y1, float z1, float s2, float t2, float x2, float y2, float z2, float s3, float t3, float x3, float y3, float z3, Texture *tex)
 VAR (skyclip, 0, 1, 1)
void draw_envbox (int w)
 VAR (maxtmus, 1, 0, 0)
void parsetmufunc (tmufunc &f, const char *s)
void committmufunc (bool rgb, tmufunc &dst, tmufunc &src)
void committmu (int n, tmu &f)
void resettmu (int n)
void scaletmu (int n, int rgbscale, int alphascale)
void colortmu (int n, float r, float g, float b, float a)
void setuptmu (int n, const char *rgbfunc, const char *alphafunc)
void inittmus ()
void cleanuptmus ()

Variables

Texture * notexture = NULL
Texture * noworldtexture = NULL
hashtable< char *, Texture > textures
vector< Slot > slots
Texture * sky [6] = {NULL, NULL, NULL, NULL, NULL, NULL}
float skyfloor = 1e16f
tmu tmus [MAXTMUS]

Define Documentation

#define BPP   4

#define BPP   3

#define BPP   2

#define BPP   1

#define DEFPIXEL   uint OP(r, 0), OP(g, 1), OP(b, 2), OP(a, 3);

#define DEFPIXEL   uint OP(r, 0), OP(g, 1), OP(b, 2);

#define DEFPIXEL   uint OP(r, 0), OP(g, 1);

#define DEFPIXEL   uint OP(r, 0);

#define FUNCNAME ( name   )     name##4

#define FUNCNAME ( name   )     name##3

#define FUNCNAME ( name   )     name##2

#define FUNCNAME ( name   )     name##1

#define INITTMU

Value:

{ \
    GL_MODULATE, \
    { 0, 0, 0, 0 }, \
    { GL_MODULATE, { GL_TEXTURE, GL_PREVIOUS_ARB, GL_CONSTANT_ARB }, { GL_SRC_COLOR, GL_SRC_COLOR, GL_SRC_ALPHA }, 1 }, \
    { GL_MODULATE, { GL_TEXTURE, GL_PREVIOUS_ARB, GL_CONSTANT_ARB }, { GL_SRC_ALPHA, GL_SRC_ALPHA, GL_SRC_ALPHA }, 1 } \
}

#define INVALIDTMU

Value:

{ \
    0, \
    { -1, -1, -1, -1 }, \
    { 0, { 0, 0, 0 }, { 0, 0, 0 }, 0 }, \
    { 0, { 0, 0, 0 }, { 0, 0, 0 }, 0 } \
}

#define MAXTMUS   4

#define PIXELOP   OP(r, 0); OP(g, 1); OP(b, 2); OP(a, 3);

#define PIXELOP   OP(r, 0); OP(g, 1); OP(b, 2);

#define PIXELOP   OP(r, 0); OP(g, 1);

#define PIXELOP   OP(r, 0);


Function Documentation

void cleanuptextures (  ) 

void cleanuptmus (  ) 

void colortmu ( int  n,
float  r,
float  g,
float  b,
float  a 
)

COMMAND ( loadnotexture  ,
ARG_1STR   
)

COMMAND ( loadsky  ,
ARG_1STR   
)

COMMAND ( texture  ,
ARG_2STR   
)

COMMAND ( texturereset  ,
ARG_NONE   
)

void committmu ( int  n,
tmu &  f 
)

void committmufunc ( bool  rgb,
tmufunc &  dst,
tmufunc &  src 
)

void createtexture ( int  tnum,
int  w,
int  h,
void *  pixels,
int  clamp,
bool  mipmap,
GLenum  format 
)

void draw_envbox ( int  w  ) 

void draw_envbox_face ( float  s0,
float  t0,
float  x0,
float  y0,
float  z0,
float  s1,
float  t1,
float  x1,
float  y1,
float  z1,
float  s2,
float  t2,
float  x2,
float  y2,
float  z2,
float  s3,
float  t3,
float  x3,
float  y3,
float  z3,
Texture *  tex 
)

int formatsize ( GLenum  format  ) 

void inittmus (  ) 

void loadnotexture ( char *  c  ) 

void loadsky ( char *  basename  ) 

GLuint loadsurface ( const char *  texname,
int &  xs,
int &  ys,
int &  bpp,
int  clamp 
)

Texture* lookuptexture ( int  tex,
Texture *  failtex 
)

void parsetmufunc ( tmufunc &  f,
const char *  s 
)

bool reloadtexture ( const char *  name  ) 

bool reloadtexture ( Texture &  t  ) 

void reloadtextures (  ) 

void resettmu ( int  n  ) 

void resizetexture ( int  w,
int  h,
bool  mipmap,
GLenum  target,
int &  tw,
int &  th 
)

void scaletexture ( uchar *  src,
uint  sw,
uint  sh,
uint  bpp,
uchar *  dst,
uint  dw,
uint  dh 
)

void scaletmu ( int  n,
int  rgbscale,
int  alphascale 
)

void setuptmu ( int  n,
const char *  rgbfunc,
const char *  alphafunc 
)

SDL_Surface* texdecal ( SDL_Surface *  s  ) 

GLenum texformat ( int  bpp  ) 

void texture ( char *  aframe,
char *  name 
)

Texture* textureload ( const char *  name,
int  clamp 
)

void texturereset (  ) 

void uploadtexture ( GLenum  target,
GLenum  internal,
int  tw,
int  th,
GLenum  format,
GLenum  type,
void *  pixels,
int  pw,
int  ph,
bool  mipmap 
)

VAR ( maxtmus  ,
1  ,
0  ,
0   
)

VAR ( skyclip  ,
0  ,
1  ,
1   
)

VAR ( hwtexsize  ,
1  ,
0  ,
0   
)

VARFP ( bilinear  ,
0  ,
1  ,
1  ,
initwarning("texture filtering", INIT_LOAD)   
)

VARFP ( trilinear  ,
0  ,
1  ,
1  ,
initwarning("texture filtering", INIT_LOAD)   
)

VARFP ( maxtexsize  ,
0  ,
0  ,
1<<  12,
initwarning("texture quality", INIT_LOAD)   
)


Variable Documentation

Texture* notexture = NULL

Texture* sky[6] = {NULL, NULL, NULL, NULL, NULL, NULL}

float skyfloor = 1e16f

tmu tmus[MAXTMUS]

Initial value:

{
    INVALIDTMU,
    INVALIDTMU,
    INVALIDTMU,
    INVALIDTMU
}


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