From 3d604171a34bc172c17a00109fb71b322c3f9d14 Mon Sep 17 00:00:00 2001 From: havoc Date: Tue, 10 Apr 2018 06:59:02 +0000 Subject: [PATCH] Remove the model parameter from NativeContentsFromSuperContents/SuperContentsFromNativeContents functions, none of the current formats need it. git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12384 d7cf8633-e32d-0410-b094-e92efae38249 --- clvm_cmds.c | 2 +- model_brush.c | 32 ++++++++++++++++---------------- model_shared.c | 2 +- model_shared.h | 12 ++++++------ sv_phys.c | 4 ++-- svvm_cmds.c | 2 +- 6 files changed, 27 insertions(+), 27 deletions(-) diff --git a/clvm_cmds.c b/clvm_cmds.c index e6cb562f..54848d8e 100644 --- a/clvm_cmds.c +++ b/clvm_cmds.c @@ -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); - 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 diff --git a/model_brush.c b/model_brush.c index 2d465af6..e981a59f 100644 --- a/model_brush.c +++ b/model_brush.c @@ -640,7 +640,7 @@ static void Mod_Q1BSP_FindNonSolidLocation(dp_model_t *model, const vec3_t in, v VectorCopy(info.center, out); } -int Mod_Q1BSP_SuperContentsFromNativeContents(dp_model_t *model, int nativecontents) +int Mod_Q1BSP_SuperContentsFromNativeContents(int nativecontents) { switch(nativecontents) { @@ -660,7 +660,7 @@ int Mod_Q1BSP_SuperContentsFromNativeContents(dp_model_t *model, int nativeconte 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; @@ -813,7 +813,7 @@ static int Mod_Q1BSP_RecursiveHullCheck(RecursiveHullCheckTraceInfo_t *t, int nu // 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; @@ -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]; } - num = Mod_Q1BSP_SuperContentsFromNativeContents(NULL, num); + num = Mod_Q1BSP_SuperContentsFromNativeContents(num); 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]; } - 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) @@ -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; - side = Mod_Q1BSP_SuperContentsFromNativeContents(NULL, leaf->contents); + side = Mod_Q1BSP_SuperContentsFromNativeContents(leaf->contents); 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); } -int Mod_Q2BSP_SuperContentsFromNativeContents(dp_model_t *model, int nativecontents) +int Mod_Q2BSP_SuperContentsFromNativeContents(int nativecontents) { int supercontents = 0; if (nativecontents & CONTENTSQ2_SOLID) @@ -4272,7 +4272,7 @@ int Mod_Q2BSP_SuperContentsFromNativeContents(dp_model_t *model, int nativeconte 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) @@ -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->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; @@ -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 - 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 @@ -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); } -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) { @@ -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); - 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); - 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; } -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) @@ -7842,7 +7842,7 @@ static int Mod_Q3BSP_SuperContentsFromNativeContents(dp_model_t *model, int nati 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) diff --git a/model_shared.c b/model_shared.c index b6225fdc..eaa7134c 100644 --- a/model_shared.c +++ b/model_shared.c @@ -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) - texture->supercontents = Mod_Q2BSP_SuperContentsFromNativeContents(loadmodel, texture->q2contents); + texture->supercontents = Mod_Q2BSP_SuperContentsFromNativeContents(texture->q2contents); } else success = false; diff --git a/model_shared.h b/model_shared.h index 9ccae5c3..f913e4bd 100644 --- a/model_shared.h +++ b/model_shared.h @@ -867,8 +867,8 @@ typedef struct model_brush_s 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); @@ -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 -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 -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; diff --git a/sv_phys.c b/sv_phys.c index da9933db..4e6f88d6 100644 --- 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 - nNativeContents = Mod_Q1BSP_NativeContentsFromSuperContents(NULL, cont); + nNativeContents = Mod_Q1BSP_NativeContentsFromSuperContents(cont); // 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); - cont = Mod_Q1BSP_NativeContentsFromSuperContents(NULL, SV_PointSuperContents(entorigin)); + cont = Mod_Q1BSP_NativeContentsFromSuperContents(SV_PointSuperContents(entorigin)); if (!PRVM_serveredictfloat(ent, watertype)) { // just spawned here diff --git a/svvm_cmds.c b/svvm_cmds.c index d2c55efd..e4969440 100644 --- a/svvm_cmds.c +++ b/svvm_cmds.c @@ -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); - PRVM_G_FLOAT(OFS_RETURN) = Mod_Q1BSP_NativeContentsFromSuperContents(NULL, SV_PointSuperContents(point)); + PRVM_G_FLOAT(OFS_RETURN) = Mod_Q1BSP_NativeContentsFromSuperContents(SV_PointSuperContents(point)); } /* -- 2.39.2