diff --git a/QW/server/model.c b/QW/server/model.c index c94c9dc..ee7823e 100644 --- a/QW/server/model.c +++ b/QW/server/model.c @@ -29,7 +29,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "qtypes.h" #include "qwsvdef.h" -model_t *loadmodel; +static model_t *loadmodel; static char loadname[MAX_QPATH]; /* for hunk tags */ static void Mod_LoadBrushModel(model_t *mod, void *buffer); diff --git a/common/gl_model.c b/common/gl_model.c index 6c1db3c..2b9c6ae 100644 --- a/common/gl_model.c +++ b/common/gl_model.c @@ -33,7 +33,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // FIXME - header hacks extern unsigned d_8to24table[]; -model_t *loadmodel; +static model_t *loadmodel; static char loadname[MAX_QPATH]; /* for hunk tags */ static dheader_t *loadheader; @@ -794,14 +794,14 @@ Mod_LoadFaces(lump_t *l) /* set the surface drawing flags */ if (!strncmp(out->texinfo->texture->name, "sky", 3)) { out->flags |= (SURF_DRAWSKY | SURF_DRAWTILED); - GL_SubdivideSurface(out); + GL_SubdivideSurface(loadmodel, out); } else if (!strncmp(out->texinfo->texture->name, "*", 1)) { out->flags |= (SURF_DRAWTURB | SURF_DRAWTILED); for (i = 0; i < 2; i++) { out->extents[i] = 16384; out->texturemins[i] = -8192; } - GL_SubdivideSurface(out); + GL_SubdivideSurface(loadmodel, out); } } } diff --git a/common/gl_warp.c b/common/gl_warp.c index 675418d..8281016 100644 --- a/common/gl_warp.c +++ b/common/gl_warp.c @@ -28,7 +28,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "sys.h" // FIXME - header hacks -extern model_t *loadmodel; extern cvar_t gl_subdivide_size; static float speedscale; // for top sky and bottom sky @@ -145,7 +144,7 @@ can be done reasonably. ================ */ void -GL_SubdivideSurface(msurface_t *fa) +GL_SubdivideSurface(model_t *m, msurface_t *fa) { vec3_t verts[64]; int numverts; @@ -160,13 +159,11 @@ GL_SubdivideSurface(msurface_t *fa) // numverts = 0; for (i = 0; i < fa->numedges; i++) { - lindex = loadmodel->surfedges[fa->firstedge + i]; - + lindex = m->surfedges[fa->firstedge + i]; if (lindex > 0) - vec = loadmodel->vertexes[loadmodel->edges[lindex].v[0]].position; + vec = m->vertexes[m->edges[lindex].v[0]].position; else - vec = - loadmodel->vertexes[loadmodel->edges[-lindex].v[1]].position; + vec = m->vertexes[m->edges[-lindex].v[1]].position; VectorCopy(vec, verts[numverts]); numverts++; } diff --git a/common/model.c b/common/model.c index 302ccc3..4978a8f 100644 --- a/common/model.c +++ b/common/model.c @@ -34,7 +34,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "crc.h" #endif -model_t *loadmodel; +static model_t *loadmodel; static char loadname[MAX_QPATH]; /* for hunk tags */ static void Mod_LoadSpriteModel(model_t *mod, void *buffer); diff --git a/include/glquake.h b/include/glquake.h index d2c195a..eec3110 100644 --- a/include/glquake.h +++ b/include/glquake.h @@ -257,7 +257,7 @@ void GL_EnableMultitexture(void); // // gl_warp.c // -void GL_SubdivideSurface(msurface_t *fa); +void GL_SubdivideSurface(model_t *m, msurface_t *fa); void EmitBothSkyLayers(msurface_t *fa); void EmitWaterPolys(msurface_t *fa); void EmitSkyPolys(msurface_t *fa);