model: pass loadmodel down into GL_SubdivideSurface

Last external user of loadmodel, so can mark it static

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
This commit is contained in:
Kevin Shanahan 2012-10-28 11:57:30 +10:30
parent 6a87e89544
commit 41b71e27a5
5 changed files with 10 additions and 13 deletions

View File

@ -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);

View File

@ -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);
}
}
}

View File

@ -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++;
}

View File

@ -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);

View File

@ -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);