Inexor
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Macros | Enumerations | Functions | Variables
material.hpp File Reference
#include "inexor/network/SharedVar.hpp"
#include "inexor/shared/cube_types.hpp"
#include "inexor/shared/cube_vector.hpp"

Go to the source code of this file.

Macros

#define isliquid(mat)   ((mat)==MAT_WATER || (mat)==MAT_LAVA)
 
#define isclipped(mat)   ((mat)==MAT_GLASS)
 
#define isdeadly(mat)   ((mat)==MAT_LAVA)
 

Enumerations

enum  {
  MATF_INDEX_SHIFT = 0, MATF_VOLUME_SHIFT = 2, MATF_CLIP_SHIFT = 5, MATF_FLAG_SHIFT = 8,
  MATF_INDEX = 3 << MATF_INDEX_SHIFT, MATF_VOLUME = 7 << MATF_VOLUME_SHIFT, MATF_CLIP = 7 << MATF_CLIP_SHIFT, MATF_FLAGS = 0xFF << MATF_FLAG_SHIFT
}
 
enum  {
  MAT_AIR = 0, MAT_WATER = 1 << MATF_VOLUME_SHIFT, MAT_LAVA = 2 << MATF_VOLUME_SHIFT, MAT_GLASS = 3 << MATF_VOLUME_SHIFT,
  MAT_NOCLIP = 1 << MATF_CLIP_SHIFT, MAT_CLIP = 2 << MATF_CLIP_SHIFT, MAT_GAMECLIP = 3 << MATF_CLIP_SHIFT, MAT_DEATH = 1 << MATF_FLAG_SHIFT,
  MAT_ALPHA = 4 << MATF_FLAG_SHIFT
}
 

Functions

int findmaterial (const char *name)
 
const char * findmaterialname (int mat)
 
const char * getmaterialdesc (int mat, const char *prefix="")
 
void genmatsurfs (const cube &c, const ivec &co, int size, vector< materialsurface > &matsurfs)
 
void rendermatgrid (materialsurface *matbuf, int matsurfs)
 
int optimizematsurfs (materialsurface *matbuf, int matsurfs)
 
void setupmaterials (int start=0, int len=0)
 
void rendermaterials ()
 
int visiblematerial (const cube &c, int orient, const ivec &co, int size, ushort matmask=MATF_VOLUME)
 

Variables

SharedVar< int > showmat
 

Macro Definition Documentation

#define isclipped (   mat)    ((mat)==MAT_GLASS)
#define isdeadly (   mat)    ((mat)==MAT_LAVA)

Referenced by mpeditmat().

#define isliquid (   mat)    ((mat)==MAT_WATER || (mat)==MAT_LAVA)

Enumeration Type Documentation

anonymous enum
Enumerator
MATF_INDEX_SHIFT 
MATF_VOLUME_SHIFT 
MATF_CLIP_SHIFT 
MATF_FLAG_SHIFT 
MATF_INDEX 
MATF_VOLUME 
MATF_CLIP 
MATF_FLAGS 
anonymous enum
Enumerator
MAT_AIR 
MAT_WATER 
MAT_LAVA 
MAT_GLASS 
MAT_NOCLIP 
MAT_CLIP 
MAT_GAMECLIP 
MAT_DEATH 
MAT_ALPHA 

Function Documentation

int findmaterial ( const char *  name)

References material::id, loopi(), and materials.

Referenced by editmat(), and texture().

const char* findmaterialname ( int  mat)

References loopi(), materials, and material::name.

Referenced by getmaterialdesc().

void genmatsurfs ( const cube c,
const ivec co,
int  size,
vector< materialsurface > &  matsurfs 
)
const char* getmaterialdesc ( int  mat,
const char *  prefix = "" 
)
int optimizematsurfs ( materialsurface matbuf,
int  matsurfs 
)
void rendermaterials ( )
void rendermatgrid ( materialsurface matbuf,
int  matsurfs 
)
void setupmaterials ( int  start = 0,
int  len = 0 
)
int visiblematerial ( const cube c,
int  orient,
const ivec co,
int  size,
ushort  matmask = MATF_VOLUME 
)

Variable Documentation

SharedVar<int> showmat