*/
+#ifndef MODEL_BRUSH_H
+#define MODEL_BRUSH_H
+
/*
==============================================================================
#define SURF_PLANEBACK 2
#define SURF_DRAWSKY 4
-//#define SURF_DRAWSPRITE 8
#define SURF_DRAWTURB 0x10
#define SURF_LIGHTMAP 0x20
-//#define SURF_DRAWBACKGROUND 0x40
-//#define SURF_UNDERWATER 0x80
#define SURF_DRAWNOALPHA 0x100
#define SURF_DRAWFULLBRIGHT 0x200
#define SURF_LIGHTBOTHSIDES 0x400
// LordHavoc: replaces glpoly, triangle mesh
typedef struct surfmesh_s
{
+ // can be multiple meshs per surface
+ struct surfmesh_s *chain;
int numverts;
int numtriangles;
surfvertex_t *vertex;
texture_t *currenttexture; // updated (animated) during early surface processing each frame
// index into d_lightstylevalue array, 255 means not used (black)
- byte styles[MAXLIGHTMAPS];
+ qbyte styles[MAXLIGHTMAPS];
// RGB lighting data [numstyles][height][width][3]
- byte *samples;
+ qbyte *samples;
+ // stain to apply on lightmap (soot/dirt/blood/whatever)
+ qbyte *stainsamples;
// these fields are generated during model loading
// the lightmap texture fragment to use on the surface
// the stride when building lightmaps to comply with fragment update
int lightmaptexturestride;
// mesh for rendering
- surfmesh_t mesh;
+ surfmesh_t *mesh;
// these are just 3D points defining the outline of the polygon,
// no texcoord info (that can be generated from these)
unsigned short cached_light[MAXLIGHTMAPS];
// if lightmap was lit by dynamic lights, force update on next frame
short cached_dlight;
- // to cause lightmap to be rerendered when lighthalf changes
+ // to cause lightmap to be rerendered when v_overbrightbits changes
short cached_lightscalebit;
// rerender lightmaps when r_ambient changes
float cached_ambient;
#define SHADERSTAGE_SKY 0
#define SHADERSTAGE_NORMAL 1
-#define SHADERSTAGE_FOG 2
-#define SHADERSTAGE_COUNT 3
+#define SHADERSTAGE_COUNT 2
// change this stuff when real shaders are added
typedef struct Cshader_s
{
- int (*shaderfunc[SHADERSTAGE_COUNT])(int stage, msurface_t *s);
+ void (*shaderfunc[SHADERSTAGE_COUNT])(msurface_t *firstsurf);
// list of surfaces using this shader (used during surface rendering)
msurface_t *chain;
}
int dlightbits[8];
int dlightframe;
- byte *compressed_vis;
+ qbyte *compressed_vis;
msurface_t **firstmarksurface;
int nummarksurfaces;
- byte ambient_sound_level[NUM_AMBIENTS];
+ qbyte ambient_sound_level[NUM_AMBIENTS];
}
mleaf_t;
int lastclipnode;
vec3_t clip_mins;
vec3_t clip_maxs;
+ vec3_t clip_size;
}
hull_t;
}
mportal_t;
+typedef struct mlight_s
+{
+ vec3_t origin;
+ float falloff;
+ vec3_t light;
+ float subtract;
+ vec3_t spotdir;
+ float spotcone; // cosine of spotlight cone angle (or 0 if not a spotlight)
+ float distbias;
+ int style;
+ int numleafs; // used only for loading calculations, number of leafs this shines on
+}
+mlight_t;
+
extern rtexture_t *r_notexture;
extern texture_t r_notexture_mip;
void Mod_LoadBrushModel (struct model_s *mod, void *buffer);
void Mod_BrushInit(void);
void Mod_FindNonSolidLocation(vec3_t pos, struct model_s *mod);
+
+#endif
+