qbsp: remove hullnum global and pass to CreateSingleHull()

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
This commit is contained in:
Kevin Shanahan 2013-02-18 11:01:11 +10:30
parent 53e61c28ca
commit 746a210f2a
3 changed files with 10 additions and 23 deletions

View File

@ -38,7 +38,6 @@ const int rgcMemSize[GLOBAL + 1] = {
};
mapdata_t map;
int hullnum;
// Useful shortcuts
mapentity_t *pWorldEnt;

View File

@ -35,7 +35,7 @@ ProcessEntity
===============
*/
static void
ProcessEntity(mapentity_t *ent)
ProcessEntity(mapentity_t *ent, const int hullnum)
{
surface_t *surfs;
node_t *nodes;
@ -173,7 +173,7 @@ CreateSingleHull
=================
*/
static void
CreateSingleHull(void)
CreateSingleHull(const int hullnum)
{
int i;
mapentity_t *ent;
@ -183,7 +183,7 @@ CreateSingleHull(void)
// for each entity in the map file that has geometry
for (i = 0, ent = map.entities; i < map.numentities; i++, ent++) {
ProcessEntity(ent);
ProcessEntity(ent, hullnum);
if (!options.fAllverbose)
options.fVerbose = false; // don't print rest of entities
}
@ -200,28 +200,18 @@ CreateHulls(void)
{
PlaneHash_Init();
// commanded to create a single hull only
if (hullnum) {
CreateSingleHull();
exit(0);
}
// commanded to ignore the hulls altogether
if (options.fNoclip) {
CreateSingleHull();
return;
}
// create the hulls sequentially
/* create the hulls sequentially */
if (!options.fNoverbose)
options.fVerbose = true;
hullnum = 0;
CreateSingleHull();
hullnum = 1;
CreateSingleHull();
CreateSingleHull(0);
hullnum = 2;
CreateSingleHull();
/* ignore the clipping hulls altogether */
if (options.fNoclip)
return;
CreateSingleHull(1);
CreateSingleHull(2);
}

View File

@ -556,8 +556,6 @@ typedef struct options_s {
extern options_t options;
extern int hullnum;
//=============================================================================
// map.c