]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - model_shared.h
Fix crash in q3bsp loading on submodels where it was adding the submodelsurfaces_star...
[xonotic/darkplaces.git] / model_shared.h
index b5312b8c6f37322dd55ca57452357cfb55abe655..d131fb8bccf9f0e5bfa756775ec67ad5ecb28f37 100644 (file)
@@ -501,9 +501,9 @@ typedef struct model_s
        const char              *modeldatatypestring;
        // generates vertex data for a given frameblend
        void(*AnimateVertices)(const struct model_s * RESTRICT model, const struct frameblend_s * RESTRICT frameblend, const struct skeleton_s *skeleton, float * RESTRICT vertex3f, float * RESTRICT normal3f, float * RESTRICT svector3f, float * RESTRICT tvector3f);
-       // draw the model's sky polygons (only used by brush models)
+       // draw the model's sky polygons
        void(*DrawSky)(struct entity_render_s *ent);
-       // draw refraction/reflection textures for the model's water polygons (only used by brush models)
+       // draw refraction/reflection textures for the model's water polygons
        void(*DrawAddWaterPlanes)(struct entity_render_s *ent);
        // draw the model using lightmap/dlight shading
        void(*Draw)(struct entity_render_s *ent);
@@ -606,6 +606,11 @@ void Mod_MakeSortedSurfaces(model_t *mod);
 // automatically called after model loader returns
 void Mod_BuildVBOs(void);
 
+/// Sets the mod->DrawSky and mod->DrawAddWaterPlanes pointers conditionally based on whether surfaces in this submodel use these features
+/// called specifically by brush model loaders when generating submodels
+/// automatically called after model loader returns
+void Mod_SetDrawSkyAndWater(model_t* mod);
+
 shadowmesh_t *Mod_ShadowMesh_Alloc(struct mempool_s *mempool, int maxverts, int maxtriangles);
 int Mod_ShadowMesh_AddVertex(shadowmesh_t *mesh, const float *vertex3f);
 void Mod_ShadowMesh_AddMesh(shadowmesh_t *mesh, const float *vertex3f, int numtris, const int *element3i);