UFO: Alien Invasion
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
r_material.h File Reference

Header file for the render material subsystem. More...

Go to the source code of this file.

Data Structures

struct  dirt_s
 
struct  rotate_s
 
struct  blendmode_s
 
struct  pulse_s
 
struct  stretch_s
 
struct  scroll_s
 
struct  scale_s
 
struct  terrain_s
 
struct  tape_s
 
struct  anim_s
 
struct  materialStage_s
 
struct  material_s
 

Macros

#define STAGE_TEXTURE   (1 << 0)
 
#define STAGE_ENVMAP   (1 << 1)
 
#define STAGE_BLEND   (1 << 2)
 
#define STAGE_COLOR   (1 << 3)
 
#define STAGE_PULSE   (1 << 4)
 
#define STAGE_STRETCH   (1 << 5)
 
#define STAGE_ROTATE   (1 << 6)
 
#define STAGE_SCROLL_S   (1 << 7)
 
#define STAGE_SCROLL_T   (1 << 8)
 
#define STAGE_SCALE_S   (1 << 9)
 
#define STAGE_SCALE_T   (1 << 10)
 
#define STAGE_TERRAIN   (1 << 11)
 
#define STAGE_TAPE   (1 << 12)
 
#define STAGE_LIGHTMAP   (1 << 13)
 
#define STAGE_ANIM   (1 << 14)
 
#define STAGE_DIRTMAP   (1 << 15)
 
#define STAGE_FLARE   (1 << 16)
 
#define STAGE_GLOWMAPLINK   (1 << 17)
 
#define STAGE_LIGHTING   (1 << 30)
 
#define STAGE_RENDER   (1 << 31)
 
#define STAGE_TEXTURE_MATRIX
 
#define MAX_ANIM_FRAMES   16
 
#define UPDATE_THRESHOLD   0.02
 
#define DEFAULT_BUMP   1.0f
 
#define DEFAULT_PARALLAX   1.0f
 
#define DEFAULT_SPECULAR   0.2f
 
#define DEFAULT_HARDNESS   0.2f
 
#define DEFAULT_GLOWSCALE   1.0f
 

Typedefs

typedef struct dirt_s dirt_t
 
typedef struct rotate_s rotate_t
 
typedef struct blendmode_s blendmode_t
 
typedef struct pulse_s pulse_t
 
typedef struct stretch_s stretch_t
 
typedef struct scroll_s scroll_t
 
typedef struct scale_s scale_t
 
typedef struct terrain_s terrain_t
 
typedef struct tape_s tape_t
 
typedef struct anim_s anim_t
 
typedef struct materialStage_s materialStage_t
 
typedef struct material_s material_t
 

Enumerations

enum  animLoop_t {
  ANIM_NORMAL, ANIM_ALTERNATE, ANIM_BACKWARDS, ANIM_RANDOM,
  ANIM_RANDOMFORCE
}
 

Functions

void R_LoadMaterials (const char *map)
 Load material definitions for each map that has one. More...
 
void R_UpdateDefaultMaterial (const char *cvarName, const char *oldValue, const char *newValue, void *data)
 Change listener callback for material value cvars. More...
 

Variables

material_t defaultMaterial
 

Detailed Description

Header file for the render material subsystem.

Definition in file r_material.h.

Macro Definition Documentation

#define DEFAULT_BUMP   1.0f

Definition at line 150 of file r_material.h.

#define DEFAULT_GLOWSCALE   1.0f

Definition at line 154 of file r_material.h.

#define DEFAULT_HARDNESS   0.2f

Definition at line 153 of file r_material.h.

#define DEFAULT_PARALLAX   1.0f

Definition at line 151 of file r_material.h.

#define DEFAULT_SPECULAR   0.2f

Definition at line 152 of file r_material.h.

#define MAX_ANIM_FRAMES   16

Definition at line 64 of file r_material.h.

Referenced by R_ParseStage().

#define STAGE_ANIM   (1 << 14)

Definition at line 46 of file r_material.h.

Referenced by R_LoadMaterials(), R_ParseStage(), and R_UpdateMaterial().

#define STAGE_BLEND   (1 << 2)

Definition at line 34 of file r_material.h.

Referenced by R_ParseStage(), and R_SetSurfaceStageState().

#define STAGE_COLOR   (1 << 3)
#define STAGE_DIRTMAP   (1 << 15)
#define STAGE_ENVMAP   (1 << 1)
#define STAGE_FLARE   (1 << 16)

Definition at line 48 of file r_material.h.

Referenced by R_CreateSurfaceFlare(), R_LoadSurfacesArrays_(), and R_ParseStage().

#define STAGE_GLOWMAPLINK   (1 << 17)

Definition at line 49 of file r_material.h.

Referenced by R_ParseStage(), and R_StageGlow().

#define STAGE_LIGHTING   (1 << 30)

Definition at line 52 of file r_material.h.

Referenced by R_ParseStage(), R_StageLighting(), and UI_MaterialEditorChangeValue_f().

#define STAGE_LIGHTMAP   (1 << 13)

Definition at line 45 of file r_material.h.

Referenced by R_ParseStage(), and R_StageLighting().

#define STAGE_PULSE   (1 << 4)

Definition at line 36 of file r_material.h.

Referenced by R_ParseStage(), R_SetSurfaceStageState(), and R_UpdateMaterial().

#define STAGE_RENDER   (1 << 31)
#define STAGE_ROTATE   (1 << 6)

Definition at line 38 of file r_material.h.

Referenced by R_ParseStage(), R_StageTextureMatrix(), and R_UpdateMaterial().

#define STAGE_SCALE_S   (1 << 9)

Definition at line 41 of file r_material.h.

Referenced by R_CreateSurfaceFlare(), R_ParseStage(), and R_StageTextureMatrix().

#define STAGE_SCALE_T   (1 << 10)

Definition at line 42 of file r_material.h.

Referenced by R_CreateSurfaceFlare(), R_ParseStage(), and R_StageTextureMatrix().

#define STAGE_SCROLL_S   (1 << 7)

Definition at line 39 of file r_material.h.

Referenced by R_ParseStage(), R_StageTextureMatrix(), and R_UpdateMaterial().

#define STAGE_SCROLL_T   (1 << 8)

Definition at line 40 of file r_material.h.

Referenced by R_ParseStage(), R_StageTextureMatrix(), and R_UpdateMaterial().

#define STAGE_STRETCH   (1 << 5)

Definition at line 37 of file r_material.h.

Referenced by R_ParseStage(), R_StageTextureMatrix(), and R_UpdateMaterial().

#define STAGE_TAPE   (1 << 12)
#define STAGE_TERRAIN   (1 << 11)
#define STAGE_TEXTURE   (1 << 0)

Definition at line 32 of file r_material.h.

Referenced by R_ParseStage(), and UI_MaterialEditorChangeValue_f().

#define STAGE_TEXTURE_MATRIX
Value:
( \
)
#define STAGE_STRETCH
Definition: r_material.h:37
#define STAGE_ROTATE
Definition: r_material.h:38
#define STAGE_SCROLL_T
Definition: r_material.h:40
#define STAGE_SCROLL_S
Definition: r_material.h:39
#define STAGE_SCALE_S
Definition: r_material.h:41
#define STAGE_SCALE_T
Definition: r_material.h:42

Definition at line 58 of file r_material.h.

Referenced by R_StageTextureMatrix().

#define UPDATE_THRESHOLD   0.02

Definition at line 66 of file r_material.h.

Typedef Documentation

typedef struct anim_s anim_t
typedef struct blendmode_s blendmode_t
typedef struct dirt_s dirt_t
typedef struct material_s material_t
typedef struct pulse_s pulse_t
typedef struct rotate_s rotate_t
typedef struct scale_s scale_t
typedef struct scroll_s scroll_t
typedef struct stretch_s stretch_t
typedef struct tape_s tape_t
typedef struct terrain_s terrain_t

Enumeration Type Documentation

enum animLoop_t
Enumerator
ANIM_NORMAL 

loops the animation from frame [0, n-1]

ANIM_ALTERNATE 

amount of frames should be uneven [0, n-1, 1]

ANIM_BACKWARDS 

plays the animation in reverse order. Loops from [n-1, 0]

ANIM_RANDOM 

plays the animation in random order.

ANIM_RANDOMFORCE 

plays the animation in random order, but enforces that the following frame is not the same as the current one.

Definition at line 114 of file r_material.h.

Function Documentation

void R_UpdateDefaultMaterial ( const char *  cvarName,
const char *  oldValue,
const char *  newValue,
void data 
)

Change listener callback for material value cvars.

Definition at line 1092 of file r_material.cpp.

References material_s::hardness, r_default_hardness, r_default_specular, material_s::specular, and cvar_s::value.

Referenced by R_Init(), R_RegisterSystemVars(), and R_ReinitOpenglContext().

Variable Documentation

material_t defaultMaterial
Todo:
load this from file, will make tweaking the game much easier

Definition at line 34 of file r_material.cpp.

Referenced by R_EnableBumpmap(), R_EnableModelLights(), R_ImageClearMaterials(), R_InitModelProgram(), R_InitWorldProgram(), R_LoadImageData(), and R_UseMaterial().