]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - model_shared.h
BuildTriangleNeighbors now detects edges shared by three triangles, fixes weird shado...
[xonotic/darkplaces.git] / model_shared.h
index 83d981fdf9d61da98b3503cce5c65c51f2e59dd9..cfebccbe543214caa94b0f86042b5bec4ed9d327 100644 (file)
@@ -99,6 +99,8 @@ typedef struct model_s
        qboolean                isworldmodel;
        // true if this model is a HalfLife .bsp file
        qboolean                ishlbsp;
+       // true if this model was not successfully loaded and should be purged
+       qboolean                error;
 
        // mod_brush, mod_alias, mod_sprite
        modtype_t               type;
@@ -186,8 +188,6 @@ typedef struct model_s
        int                             numtextures;
        texture_t               *textures;
 
-       msurface_t              **texturesurfacechains;
-
        qbyte                   *visdata;
        qbyte                   *lightdata;
        char                    *entities;
@@ -201,11 +201,6 @@ typedef struct model_s
        int                             numlights;
        mlight_t                *lights;
 
-       // used only for casting dynamic shadow volumes
-       shadowmesh_t    *shadowmesh;
-       vec3_t                  shadowmesh_mins, shadowmesh_maxs, shadowmesh_center;
-       float                   shadowmesh_radius;
-
        // pvs visibility marking
        mleaf_t                 *pvsviewleaf;
        int                             pvsviewleafnovis;
@@ -213,6 +208,20 @@ typedef struct model_s
        mleaf_t                 *pvsleafchain;
        int                             *pvssurflist;
        int                             pvssurflistlength;
+       // these get rebuilt as the player moves around if this is the world,
+       // otherwise they are left alone (no pvs for bmodels)
+       msurface_t              ***pvstexturechains;
+       msurface_t              **pvstexturechainsbuffer;
+       int                             *pvstexturechainslength;
+
+       // lightmap update chains for light styles
+       int                             light_styles;
+       qbyte                   *light_style;
+       int                             *light_stylevalue;
+       msurface_t              ***light_styleupdatechains;
+       msurface_t              **light_styleupdatechainsbuffer;
+       int                             light_scalebit;
+       float                   light_ambient;
 
        // skin animation info
        animscene_t             *skinscenes; // [numskins]
@@ -286,6 +295,7 @@ extern cvar_t r_fullbrights;
 void Mod_Init (void);
 void Mod_CheckLoaded (model_t *mod);
 void Mod_ClearAll (void);
+void Mod_ClearErrorModels (void);
 model_t *Mod_FindName (const char *name);
 model_t *Mod_ForName (const char *name, qboolean crash, qboolean checkdisk, qboolean isworldmodel);
 void Mod_TouchModel (const char *name);
@@ -298,7 +308,7 @@ void Mod_LoadModels(void);
 extern model_t *loadmodel;
 extern char loadname[32];      // for hunk tags
 
-int Mod_FindTriangleWithEdge(const int *elements, int numtriangles, int start, int end);
+int Mod_FindTriangleWithEdge(const int *elements, int numtriangles, int start, int end, int ignore);
 void Mod_BuildTriangleNeighbors(int *neighbors, const int *elements, int numtriangles);
 void Mod_ValidateElements(const int *elements, int numtriangles, int numverts, const char *filename, int fileline);
 void Mod_BuildTextureVectorsAndNormals(int numverts, int numtriangles, const float *vertex, const float *texcoord, const int *elements, float *svectors, float *tvectors, float *normals);