]> git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - model_brush.h
DP code cleanup, stage one - all headers that can be protected by ifdef
[xonotic/darkplaces.git] / model_brush.h
index 0594fcd7e3395df05cb342d8d440f09a15e24c0b..554a5980aff16cb4a7619f03058f117f1b2a2506 100644 (file)
@@ -18,6 +18,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 
 */
 
+#ifndef MODEL_BRUSH_H
+#define MODEL_BRUSH_H
+
 /*
 ==============================================================================
 
@@ -71,11 +74,8 @@ texture_t;
 
 #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
@@ -111,6 +111,8 @@ surfvertex_t;
 // 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;
@@ -153,7 +155,7 @@ typedef struct msurface_s
        // 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)
@@ -185,26 +187,21 @@ msurface_t;
 
 #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;
 }
 Cshader_t;
 
 extern Cshader_t Cshader_wall_vertex;
-extern Cshader_t Cshader_wall_vertex_glow;
 extern Cshader_t Cshader_wall_lightmap;
-extern Cshader_t Cshader_wall_lightmap_glow;
 extern Cshader_t Cshader_wall_fullbright;
-extern Cshader_t Cshader_wall_fullbright_glow;
 extern Cshader_t Cshader_water;
-extern Cshader_t Cshader_water_glow;
 extern Cshader_t Cshader_sky;
 
 // warning: if this is changed, references must be updated in cpu_* assembly files
@@ -266,6 +263,7 @@ typedef struct
        int                     lastclipnode;
        vec3_t          clip_mins;
        vec3_t          clip_maxs;
+       vec3_t          clip_size;
 }
 hull_t;
 
@@ -281,6 +279,20 @@ typedef struct mportal_s
 }
 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;
 
@@ -288,3 +300,6 @@ struct model_s;
 void Mod_LoadBrushModel (struct model_s *mod, void *buffer);
 void Mod_BrushInit(void);
 void Mod_FindNonSolidLocation(vec3_t pos, struct model_s *mod);
+
+#endif
+