]> de.git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
Remove the model parameter from NativeContentsFromSuperContents/SuperContentsFromNati...
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Tue, 10 Apr 2018 06:59:02 +0000 (06:59 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Tue, 10 Apr 2018 06:59:02 +0000 (06:59 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12384 d7cf8633-e32d-0410-b094-e92efae38249

clvm_cmds.c
model_brush.c
model_shared.c
model_shared.h
sv_phys.c
svvm_cmds.c

index e6cb562f84a0ead336060b5b8a4c4744d5560a59..54848d8e410fcbed4eea7b8b662082b59aac23da 100644 (file)
@@ -662,7 +662,7 @@ static void VM_CL_pointcontents (prvm_prog_t *prog)
        vec3_t point;
        VM_SAFEPARMCOUNT(1, VM_CL_pointcontents);
        VectorCopy(PRVM_G_VECTOR(OFS_PARM0), point);
        vec3_t point;
        VM_SAFEPARMCOUNT(1, VM_CL_pointcontents);
        VectorCopy(PRVM_G_VECTOR(OFS_PARM0), point);
-       PRVM_G_FLOAT(OFS_RETURN) = Mod_Q1BSP_NativeContentsFromSuperContents(NULL, CL_PointSuperContents(point));
+       PRVM_G_FLOAT(OFS_RETURN) = Mod_Q1BSP_NativeContentsFromSuperContents(CL_PointSuperContents(point));
 }
 
 // #48 void(vector o, vector d, float color, float count) particle
 }
 
 // #48 void(vector o, vector d, float color, float count) particle
index 2d465af65a9f5e42252e63e085c6be1e2e00af9f..e981a59fb830901528fea71ccdb14581df0d4e5d 100644 (file)
@@ -640,7 +640,7 @@ static void Mod_Q1BSP_FindNonSolidLocation(dp_model_t *model, const vec3_t in, v
        VectorCopy(info.center, out);
 }
 
        VectorCopy(info.center, out);
 }
 
-int Mod_Q1BSP_SuperContentsFromNativeContents(dp_model_t *model, int nativecontents)
+int Mod_Q1BSP_SuperContentsFromNativeContents(int nativecontents)
 {
        switch(nativecontents)
        {
 {
        switch(nativecontents)
        {
@@ -660,7 +660,7 @@ int Mod_Q1BSP_SuperContentsFromNativeContents(dp_model_t *model, int nativeconte
        return 0;
 }
 
        return 0;
 }
 
-int Mod_Q1BSP_NativeContentsFromSuperContents(dp_model_t *model, int supercontents)
+int Mod_Q1BSP_NativeContentsFromSuperContents(int supercontents)
 {
        if (supercontents & (SUPERCONTENTS_SOLID | SUPERCONTENTS_BODY))
                return CONTENTS_SOLID;
 {
        if (supercontents & (SUPERCONTENTS_SOLID | SUPERCONTENTS_BODY))
                return CONTENTS_SOLID;
@@ -813,7 +813,7 @@ static int Mod_Q1BSP_RecursiveHullCheck(RecursiveHullCheckTraceInfo_t *t, int nu
        // we reached a leaf contents
 
        // check for empty
        // we reached a leaf contents
 
        // check for empty
-       num = Mod_Q1BSP_SuperContentsFromNativeContents(NULL, num);
+       num = Mod_Q1BSP_SuperContentsFromNativeContents(num);
        if (!t->trace->startfound)
        {
                t->trace->startfound = true;
        if (!t->trace->startfound)
        {
                t->trace->startfound = true;
@@ -868,7 +868,7 @@ static int Mod_Q1BSP_RecursiveHullCheckPoint(RecursiveHullCheckTraceInfo_t *t, i
                plane = planes + nodes[num].planenum;
                num = nodes[num].children[(plane->type < 3 ? point[plane->type] : DotProduct(plane->normal, point)) < plane->dist];
        }
                plane = planes + nodes[num].planenum;
                num = nodes[num].children[(plane->type < 3 ? point[plane->type] : DotProduct(plane->normal, point)) < plane->dist];
        }
-       num = Mod_Q1BSP_SuperContentsFromNativeContents(NULL, num);
+       num = Mod_Q1BSP_SuperContentsFromNativeContents(num);
        t->trace->startsupercontents |= num;
        if (num & SUPERCONTENTS_LIQUIDSMASK)
                t->trace->inwater = true;
        t->trace->startsupercontents |= num;
        if (num & SUPERCONTENTS_LIQUIDSMASK)
                t->trace->inwater = true;
@@ -1060,7 +1060,7 @@ static int Mod_Q1BSP_PointSuperContents(struct model_s *model, int frame, const
                plane = planes + nodes[num].planenum;
                num = nodes[num].children[(plane->type < 3 ? point[plane->type] : DotProduct(plane->normal, point)) < plane->dist];
        }
                plane = planes + nodes[num].planenum;
                num = nodes[num].children[(plane->type < 3 ? point[plane->type] : DotProduct(plane->normal, point)) < plane->dist];
        }
-       return Mod_Q1BSP_SuperContentsFromNativeContents(NULL, num);
+       return Mod_Q1BSP_SuperContentsFromNativeContents(num);
 }
 
 void Collision_ClipTrace_Box(trace_t *trace, const vec3_t cmins, const vec3_t cmaxs, const vec3_t start, const vec3_t mins, const vec3_t maxs, const vec3_t end, int hitsupercontentsmask, int skipsupercontentsmask, int skipmaterialflagsmask, int boxsupercontents, int boxq3surfaceflags, const texture_t *boxtexture)
 }
 
 void Collision_ClipTrace_Box(trace_t *trace, const vec3_t cmins, const vec3_t cmaxs, const vec3_t start, const vec3_t mins, const vec3_t maxs, const vec3_t end, int hitsupercontentsmask, int skipsupercontentsmask, int skipmaterialflagsmask, int boxsupercontents, int boxq3surfaceflags, const texture_t *boxtexture)
@@ -1491,7 +1491,7 @@ static int Mod_Q1BSP_TraceLineAgainstSurfacesRecursiveBSPNode(RecursiveHullCheck
                return Mod_Q1BSP_TraceLineAgainstSurfacesRecursiveBSPNode(t, model, node->children[side ^ 1], mid, p2);
        }
        leaf = (const mleaf_t *)node;
                return Mod_Q1BSP_TraceLineAgainstSurfacesRecursiveBSPNode(t, model, node->children[side ^ 1], mid, p2);
        }
        leaf = (const mleaf_t *)node;
-       side = Mod_Q1BSP_SuperContentsFromNativeContents(NULL, leaf->contents);
+       side = Mod_Q1BSP_SuperContentsFromNativeContents(leaf->contents);
        if (!t->trace->startfound)
        {
                t->trace->startfound = true;
        if (!t->trace->startfound)
        {
                t->trace->startfound = true;
@@ -4248,7 +4248,7 @@ void Mod_Q1BSP_Load(dp_model_t *mod, void *buffer, void *bufferend)
        Con_DPrintf("Stats for q1bsp model \"%s\": %i faces, %i nodes, %i leafs, %i visleafs, %i visleafportals, mesh: %i vertices, %i triangles, %i surfaces\n", loadmodel->name, loadmodel->num_surfaces, loadmodel->brush.num_nodes, loadmodel->brush.num_leafs, mod->brush.num_pvsclusters, loadmodel->brush.num_portals, loadmodel->surfmesh.num_vertices, loadmodel->surfmesh.num_triangles, loadmodel->num_surfaces);
 }
 
        Con_DPrintf("Stats for q1bsp model \"%s\": %i faces, %i nodes, %i leafs, %i visleafs, %i visleafportals, mesh: %i vertices, %i triangles, %i surfaces\n", loadmodel->name, loadmodel->num_surfaces, loadmodel->brush.num_nodes, loadmodel->brush.num_leafs, mod->brush.num_pvsclusters, loadmodel->brush.num_portals, loadmodel->surfmesh.num_vertices, loadmodel->surfmesh.num_triangles, loadmodel->num_surfaces);
 }
 
-int Mod_Q2BSP_SuperContentsFromNativeContents(dp_model_t *model, int nativecontents)
+int Mod_Q2BSP_SuperContentsFromNativeContents(int nativecontents)
 {
        int supercontents = 0;
        if (nativecontents & CONTENTSQ2_SOLID)
 {
        int supercontents = 0;
        if (nativecontents & CONTENTSQ2_SOLID)
@@ -4272,7 +4272,7 @@ int Mod_Q2BSP_SuperContentsFromNativeContents(dp_model_t *model, int nativeconte
        return supercontents;
 }
 
        return supercontents;
 }
 
-int Mod_Q2BSP_NativeContentsFromSuperContents(dp_model_t *model, int supercontents)
+int Mod_Q2BSP_NativeContentsFromSuperContents(int supercontents)
 {
        int nativecontents = 0;
        if (supercontents & SUPERCONTENTS_SOLID)
 {
        int nativecontents = 0;
        if (supercontents & SUPERCONTENTS_SOLID)
@@ -4531,7 +4531,7 @@ static void Mod_Q2BSP_LoadTexinfo(sizebuf_t *sb)
                                        tx->q2contents |= Q2CONTENTS_SOLID;
                                if (tx->q2flags & (Q2SURF_HINT | Q2SURF_SKIP))
                                        tx->q2contents = 0;
                                        tx->q2contents |= Q2CONTENTS_SOLID;
                                if (tx->q2flags & (Q2SURF_HINT | Q2SURF_SKIP))
                                        tx->q2contents = 0;
-                               tx->supercontents = Mod_Q2BSP_SuperContentsFromNativeContents(loadmodel, tx->q2contents);
+                               tx->supercontents = Mod_Q2BSP_SuperContentsFromNativeContents(tx->q2contents);
                                // set the current values to the base values
                                tx->currentframe = tx;
                                tx->currentskinframe = tx->materialshaderpass != NULL ? tx->materialshaderpass->skinframes[0] : NULL;
                                // set the current values to the base values
                                tx->currentframe = tx;
                                tx->currentskinframe = tx->materialshaderpass != NULL ? tx->materialshaderpass->skinframes[0] : NULL;
@@ -4758,7 +4758,7 @@ static void Mod_Q2BSP_LoadBrushes(sizebuf_t *sb)
                out->firstbrushside = loadmodel->brush.data_brushsides + firstside;
                out->numbrushsides = numsides;
                // convert the contents to our values
                out->firstbrushside = loadmodel->brush.data_brushsides + firstside;
                out->numbrushsides = numsides;
                // convert the contents to our values
-               supercontents = Mod_Q2BSP_SuperContentsFromNativeContents(loadmodel, contents);
+               supercontents = Mod_Q2BSP_SuperContentsFromNativeContents(contents);
 
                // problem: q2bsp brushes have contents but not a texture
                // problem: q2bsp brushsides *may* have a texture or may not
 
                // problem: q2bsp brushes have contents but not a texture
                // problem: q2bsp brushsides *may* have a texture or may not
@@ -5219,8 +5219,8 @@ static void Mod_Q2BSP_Load(dp_model_t *mod, void *buffer, void *bufferend)
        Con_DPrintf("Stats for q2bsp model \"%s\": %i faces, %i nodes, %i leafs, %i clusters, %i clusterportals, mesh: %i vertices, %i triangles, %i surfaces\n", loadmodel->name, loadmodel->num_surfaces, loadmodel->brush.num_nodes, loadmodel->brush.num_leafs, mod->brush.num_pvsclusters, loadmodel->brush.num_portals, loadmodel->surfmesh.num_vertices, loadmodel->surfmesh.num_triangles, loadmodel->num_surfaces);
 }
 
        Con_DPrintf("Stats for q2bsp model \"%s\": %i faces, %i nodes, %i leafs, %i clusters, %i clusterportals, mesh: %i vertices, %i triangles, %i surfaces\n", loadmodel->name, loadmodel->num_surfaces, loadmodel->brush.num_nodes, loadmodel->brush.num_leafs, mod->brush.num_pvsclusters, loadmodel->brush.num_portals, loadmodel->surfmesh.num_vertices, loadmodel->surfmesh.num_triangles, loadmodel->num_surfaces);
 }
 
-static int Mod_Q3BSP_SuperContentsFromNativeContents(dp_model_t *model, int nativecontents);
-static int Mod_Q3BSP_NativeContentsFromSuperContents(dp_model_t *model, int supercontents);
+static int Mod_Q3BSP_SuperContentsFromNativeContents(int nativecontents);
+static int Mod_Q3BSP_NativeContentsFromSuperContents(int supercontents);
 
 static void Mod_Q3BSP_LoadEntities(lump_t *l)
 {
 
 static void Mod_Q3BSP_LoadEntities(lump_t *l)
 {
@@ -5308,11 +5308,11 @@ static void Mod_Q3BSP_LoadTextures(lump_t *l)
        for (i = 0;i < count;i++)
        {
                out[i].surfaceflags = LittleLong(in[i].surfaceflags);
        for (i = 0;i < count;i++)
        {
                out[i].surfaceflags = LittleLong(in[i].surfaceflags);
-               out[i].supercontents = Mod_Q3BSP_SuperContentsFromNativeContents(loadmodel, LittleLong(in[i].contents));
+               out[i].supercontents = Mod_Q3BSP_SuperContentsFromNativeContents(LittleLong(in[i].contents));
                Mod_LoadTextureFromQ3Shader(out + i, in[i].name, true, true, TEXF_MIPMAP | TEXF_ISWORLD | TEXF_PICMIP | TEXF_COMPRESS);
                // restore the surfaceflags and supercontents
                out[i].surfaceflags = LittleLong(in[i].surfaceflags);
                Mod_LoadTextureFromQ3Shader(out + i, in[i].name, true, true, TEXF_MIPMAP | TEXF_ISWORLD | TEXF_PICMIP | TEXF_COMPRESS);
                // restore the surfaceflags and supercontents
                out[i].surfaceflags = LittleLong(in[i].surfaceflags);
-               out[i].supercontents = Mod_Q3BSP_SuperContentsFromNativeContents(loadmodel, LittleLong(in[i].contents));
+               out[i].supercontents = Mod_Q3BSP_SuperContentsFromNativeContents(LittleLong(in[i].contents));
        }
 }
 
        }
 }
 
@@ -7812,7 +7812,7 @@ bih_t *Mod_MakeCollisionBIH(dp_model_t *model, qboolean userendersurfaces, bih_t
        return out;
 }
 
        return out;
 }
 
-static int Mod_Q3BSP_SuperContentsFromNativeContents(dp_model_t *model, int nativecontents)
+static int Mod_Q3BSP_SuperContentsFromNativeContents(int nativecontents)
 {
        int supercontents = 0;
        if (nativecontents & CONTENTSQ3_SOLID)
 {
        int supercontents = 0;
        if (nativecontents & CONTENTSQ3_SOLID)
@@ -7842,7 +7842,7 @@ static int Mod_Q3BSP_SuperContentsFromNativeContents(dp_model_t *model, int nati
        return supercontents;
 }
 
        return supercontents;
 }
 
-static int Mod_Q3BSP_NativeContentsFromSuperContents(dp_model_t *model, int supercontents)
+static int Mod_Q3BSP_NativeContentsFromSuperContents(int supercontents)
 {
        int nativecontents = 0;
        if (supercontents & SUPERCONTENTS_SOLID)
 {
        int nativecontents = 0;
        if (supercontents & SUPERCONTENTS_SOLID)
index b6225fdcf0614a57f5ef2d9d8cc61fd76f94bfd0..eaa7134cf8efb6657af01b7b233bc92b6bc7904c 100644 (file)
@@ -2815,7 +2815,7 @@ nothing                GL_ZERO GL_ONE
                                        if (texture->materialshaderpass->skinframes[0]->hasalpha)
                                                texture->basematerialflags |= MATERIALFLAG_ALPHA | MATERIALFLAG_BLENDED | MATERIALFLAG_NOSHADOW;
                                        if (texture->q2contents)
                                        if (texture->materialshaderpass->skinframes[0]->hasalpha)
                                                texture->basematerialflags |= MATERIALFLAG_ALPHA | MATERIALFLAG_BLENDED | MATERIALFLAG_NOSHADOW;
                                        if (texture->q2contents)
-                                               texture->supercontents = Mod_Q2BSP_SuperContentsFromNativeContents(loadmodel, texture->q2contents);
+                                               texture->supercontents = Mod_Q2BSP_SuperContentsFromNativeContents(texture->q2contents);
                                }
                                else
                                        success = false;
                                }
                                else
                                        success = false;
index 9ccae5c312094ffb1990b831998448bedd1d5d2f..f913e4bd89bd85cf68284558f5e898b0c992759a 100644 (file)
@@ -867,8 +867,8 @@ typedef struct model_brush_s
        shadowmesh_t *collisionmesh;
 
        // common functions
        shadowmesh_t *collisionmesh;
 
        // common functions
-       int (*SuperContentsFromNativeContents)(struct model_s *model, int nativecontents);
-       int (*NativeContentsFromSuperContents)(struct model_s *model, int supercontents);
+       int (*SuperContentsFromNativeContents)(int nativecontents);
+       int (*NativeContentsFromSuperContents)(int supercontents);
        unsigned char *(*GetPVS)(struct model_s *model, const vec3_t p);
        int (*FatPVS)(struct model_s *model, const vec3_t org, vec_t radius, unsigned char *pvsbuffer, int pvsbufferlength, qboolean merge);
        int (*BoxTouchingPVS)(struct model_s *model, const unsigned char *pvs, const vec3_t mins, const vec3_t maxs);
        unsigned char *(*GetPVS)(struct model_s *model, const vec3_t p);
        int (*FatPVS)(struct model_s *model, const vec3_t org, vec_t radius, unsigned char *pvsbuffer, int pvsbufferlength, qboolean merge);
        int (*BoxTouchingPVS)(struct model_s *model, const unsigned char *pvs, const vec3_t mins, const vec3_t maxs);
@@ -1240,11 +1240,11 @@ qboolean Mod_AllocLightmap_Block(mod_alloclightmap_state_t *state, int blockwidt
 // bsp models
 void Mod_BrushInit(void);
 // used for talking to the QuakeC mainly
 // bsp models
 void Mod_BrushInit(void);
 // used for talking to the QuakeC mainly
-int Mod_Q1BSP_NativeContentsFromSuperContents(struct model_s *model, int supercontents);
-int Mod_Q1BSP_SuperContentsFromNativeContents(struct model_s *model, int nativecontents);
+int Mod_Q1BSP_NativeContentsFromSuperContents(int supercontents);
+int Mod_Q1BSP_SuperContentsFromNativeContents(int nativecontents);
 // used for loading wal files in Mod_LoadTextureFromQ3Shader
 // used for loading wal files in Mod_LoadTextureFromQ3Shader
-int Mod_Q2BSP_SuperContentsFromNativeContents(dp_model_t *model, int nativecontents);
-int Mod_Q2BSP_NativeContentsFromSuperContents(dp_model_t *model, int supercontents);
+int Mod_Q2BSP_SuperContentsFromNativeContents(int nativecontents);
+int Mod_Q2BSP_NativeContentsFromSuperContents(int supercontents);
 
 // a lot of model formats use the Q1BSP code, so here are the prototypes...
 struct entity_render_s;
 
 // a lot of model formats use the Q1BSP code, so here are the prototypes...
 struct entity_render_s;
index da9933dbfbaca273d4fbe1e72535e0f480a69867..4e6f88d6bd16be90a486b9efb1501a103cfcc1dd 100644 (file)
--- a/sv_phys.c
+++ b/sv_phys.c
@@ -2154,7 +2154,7 @@ static qboolean SV_CheckWater (prvm_edict_t *ent)
        // Acquire Super Contents Prior to Resets
        cont = SV_PointSuperContents(point);
        // Acquire Native Contents Here
        // Acquire Super Contents Prior to Resets
        cont = SV_PointSuperContents(point);
        // Acquire Native Contents Here
-       nNativeContents = Mod_Q1BSP_NativeContentsFromSuperContents(NULL, cont);
+       nNativeContents = Mod_Q1BSP_NativeContentsFromSuperContents(cont);
 
        // DRESK - Support for Entity Contents Transition Event
        if(PRVM_serveredictfloat(ent, watertype))
 
        // DRESK - Support for Entity Contents Transition Event
        if(PRVM_serveredictfloat(ent, watertype))
@@ -2540,7 +2540,7 @@ static void SV_CheckWaterTransition (prvm_edict_t *ent)
        // LordHavoc: bugfixes in this function are keyed to the sv_gameplayfix_bugfixedcheckwatertransition cvar - if this cvar is 0 then all the original bugs should be reenabled for compatibility
        int cont;
        VectorCopy(PRVM_serveredictvector(ent, origin), entorigin);
        // LordHavoc: bugfixes in this function are keyed to the sv_gameplayfix_bugfixedcheckwatertransition cvar - if this cvar is 0 then all the original bugs should be reenabled for compatibility
        int cont;
        VectorCopy(PRVM_serveredictvector(ent, origin), entorigin);
-       cont = Mod_Q1BSP_NativeContentsFromSuperContents(NULL, SV_PointSuperContents(entorigin));
+       cont = Mod_Q1BSP_NativeContentsFromSuperContents(SV_PointSuperContents(entorigin));
        if (!PRVM_serveredictfloat(ent, watertype))
        {
                // just spawned here
        if (!PRVM_serveredictfloat(ent, watertype))
        {
                // just spawned here
index d2c55efd8dbb3ff7997477f602b4ac4f0d949fa3..e4969440a27c713127c6eec5bf8da0a5371cd87d 100644 (file)
@@ -1266,7 +1266,7 @@ static void VM_SV_pointcontents(prvm_prog_t *prog)
        vec3_t point;
        VM_SAFEPARMCOUNT(1, VM_SV_pointcontents);
        VectorCopy(PRVM_G_VECTOR(OFS_PARM0), point);
        vec3_t point;
        VM_SAFEPARMCOUNT(1, VM_SV_pointcontents);
        VectorCopy(PRVM_G_VECTOR(OFS_PARM0), point);
-       PRVM_G_FLOAT(OFS_RETURN) = Mod_Q1BSP_NativeContentsFromSuperContents(NULL, SV_PointSuperContents(point));
+       PRVM_G_FLOAT(OFS_RETURN) = Mod_Q1BSP_NativeContentsFromSuperContents(SV_PointSuperContents(point));
 }
 
 /*
 }
 
 /*