qbsp: writebsp: delete dead code
This commit is contained in:
parent
382a725f2b
commit
bc5e743817
244
qbsp/writebsp.cc
244
qbsp/writebsp.cc
|
|
@ -281,62 +281,6 @@ ExportClipNodes(mapentity_t *entity, node_t *nodes, const int hullnum)
|
|||
|
||||
//===========================================================================
|
||||
|
||||
#if 0
|
||||
/*
|
||||
==================
|
||||
CountLeaves
|
||||
==================
|
||||
*/
|
||||
static void
|
||||
CountLeaves(mapentity_t *entity, node_t *node)
|
||||
{
|
||||
face_t **markfaces, *face;
|
||||
|
||||
entity->lumps[LUMP_LEAFS].count++;
|
||||
for (markfaces = node->markfaces; *markfaces; markfaces++) {
|
||||
if (map.mtexinfos.at((*markfaces)->texinfo).flags & TEX_SKIP)
|
||||
continue;
|
||||
for (face = *markfaces; face; face = face->original)
|
||||
entity->lumps[LUMP_MARKSURFACES].count++;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
==================
|
||||
CountNodes_r
|
||||
==================
|
||||
*/
|
||||
static void
|
||||
CountNodes_r(mapentity_t *entity, node_t *node)
|
||||
{
|
||||
int i;
|
||||
|
||||
entity->lumps[LUMP_NODES].count++;
|
||||
|
||||
for (i = 0; i < 2; i++) {
|
||||
if (node->children[i]->planenum == -1) {
|
||||
if (node->children[i]->contents != CONTENTS_SOLID)
|
||||
CountLeaves(entity, node->children[i]);
|
||||
} else
|
||||
CountNodes_r(entity, node->children[i]);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
==================
|
||||
CountNodes
|
||||
==================
|
||||
*/
|
||||
static void
|
||||
CountNodes(mapentity_t *entity, node_t *headnode)
|
||||
{
|
||||
if (headnode->contents < 0)
|
||||
CountLeaves(entity, headnode);
|
||||
else
|
||||
CountNodes_r(entity, headnode);
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
==================
|
||||
ExportLeaf
|
||||
|
|
@ -382,108 +326,6 @@ ExportLeaf_BSP29(mapentity_t *entity, node_t *node)
|
|||
static_cast<int>(map.exported_marksurfaces.size()) - dleaf->firstmarksurface;
|
||||
}
|
||||
|
||||
#if 0
|
||||
static void
|
||||
ExportLeaf_BSP2(mapentity_t *entity, node_t *node)
|
||||
{
|
||||
struct lumpdata *leaves = &entity->lumps[LUMP_LEAFS];
|
||||
struct lumpdata *marksurfs = &entity->lumps[LUMP_MARKSURFACES];
|
||||
uint32_t *marksurfnums = (uint32_t *)marksurfs->data;
|
||||
face_t **markfaces, *face;
|
||||
bsp2_dleaf_t *dleaf;
|
||||
|
||||
// ptr arithmetic to get correct leaf in memory
|
||||
dleaf = (bsp2_dleaf_t *)leaves->data + leaves->index;
|
||||
leaves->index++;
|
||||
map.cTotal[LUMP_LEAFS]++;
|
||||
|
||||
dleaf->contents = RemapContentsForExport(node->contents);
|
||||
AssertVanillaContentType(dleaf->contents);
|
||||
|
||||
/*
|
||||
* write bounding box info
|
||||
* (VectorCopy doesn't work double->float)
|
||||
*/
|
||||
dleaf->mins[0] = node->mins[0];
|
||||
dleaf->mins[1] = node->mins[1];
|
||||
dleaf->mins[2] = node->mins[2];
|
||||
dleaf->maxs[0] = node->maxs[0];
|
||||
dleaf->maxs[1] = node->maxs[1];
|
||||
dleaf->maxs[2] = node->maxs[2];
|
||||
|
||||
dleaf->visofs = -1; // no vis info yet
|
||||
|
||||
// write the marksurfaces
|
||||
dleaf->firstmarksurface = map.cTotal[LUMP_MARKSURFACES];
|
||||
|
||||
for (markfaces = node->markfaces; *markfaces; markfaces++) {
|
||||
face = *markfaces;
|
||||
if (map.mtexinfos.at(face->texinfo).flags & TEX_SKIP)
|
||||
continue;
|
||||
|
||||
/* emit a marksurface */
|
||||
do {
|
||||
marksurfnums[marksurfs->index] = face->outputnumber;
|
||||
marksurfs->index++;
|
||||
map.cTotal[LUMP_MARKSURFACES]++;
|
||||
face = face->original; /* grab tjunction split faces */
|
||||
} while (face);
|
||||
}
|
||||
dleaf->nummarksurfaces =
|
||||
map.cTotal[LUMP_MARKSURFACES] - dleaf->firstmarksurface;
|
||||
}
|
||||
|
||||
static void
|
||||
ExportLeaf_BSP2rmq(mapentity_t *entity, node_t *node)
|
||||
{
|
||||
struct lumpdata *leaves = &entity->lumps[LUMP_LEAFS];
|
||||
struct lumpdata *marksurfs = &entity->lumps[LUMP_MARKSURFACES];
|
||||
uint32_t *marksurfnums = (uint32_t *)marksurfs->data;
|
||||
face_t **markfaces, *face;
|
||||
bsp2rmq_dleaf_t *dleaf;
|
||||
|
||||
// ptr arithmetic to get correct leaf in memory
|
||||
dleaf = (bsp2rmq_dleaf_t *)leaves->data + leaves->index;
|
||||
leaves->index++;
|
||||
map.cTotal[LUMP_LEAFS]++;
|
||||
|
||||
dleaf->contents = RemapContentsForExport(node->contents);
|
||||
AssertVanillaContentType(dleaf->contents);
|
||||
|
||||
/*
|
||||
* write bounding box info
|
||||
* (VectorCopy doesn't work since dest are shorts)
|
||||
*/
|
||||
dleaf->mins[0] = (short)node->mins[0];
|
||||
dleaf->mins[1] = (short)node->mins[1];
|
||||
dleaf->mins[2] = (short)node->mins[2];
|
||||
dleaf->maxs[0] = (short)node->maxs[0];
|
||||
dleaf->maxs[1] = (short)node->maxs[1];
|
||||
dleaf->maxs[2] = (short)node->maxs[2];
|
||||
|
||||
dleaf->visofs = -1; // no vis info yet
|
||||
|
||||
// write the marksurfaces
|
||||
dleaf->firstmarksurface = map.cTotal[LUMP_MARKSURFACES];
|
||||
|
||||
for (markfaces = node->markfaces; *markfaces; markfaces++) {
|
||||
face = *markfaces;
|
||||
if (map.mtexinfos.at(face->texinfo).flags & TEX_SKIP)
|
||||
continue;
|
||||
|
||||
/* emit a marksurface */
|
||||
do {
|
||||
marksurfnums[marksurfs->index] = face->outputnumber;
|
||||
marksurfs->index++;
|
||||
map.cTotal[LUMP_MARKSURFACES]++;
|
||||
face = face->original; /* grab tjunction split faces */
|
||||
} while (face);
|
||||
}
|
||||
dleaf->nummarksurfaces =
|
||||
map.cTotal[LUMP_MARKSURFACES] - dleaf->firstmarksurface;
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
==================
|
||||
ExportDrawNodes
|
||||
|
|
@ -548,92 +390,6 @@ ExportDrawNodes_BSP29(mapentity_t *entity, node_t *node)
|
|||
Q_assert(dnode->children[0] != dnode->children[1]);
|
||||
}
|
||||
|
||||
#if 0
|
||||
static void
|
||||
ExportDrawNodes_BSP2(mapentity_t *entity, node_t *node)
|
||||
{
|
||||
struct lumpdata *nodes = &entity->lumps[LUMP_NODES];
|
||||
bsp2_dnode_t *dnode;
|
||||
int i;
|
||||
|
||||
dnode = (bsp2_dnode_t *)nodes->data + nodes->index;
|
||||
nodes->index++;
|
||||
map.cTotal[LUMP_NODES]++;
|
||||
|
||||
// VectorCopy doesn't work double->float
|
||||
dnode->mins[0] = node->mins[0];
|
||||
dnode->mins[1] = node->mins[1];
|
||||
dnode->mins[2] = node->mins[2];
|
||||
dnode->maxs[0] = node->maxs[0];
|
||||
dnode->maxs[1] = node->maxs[1];
|
||||
dnode->maxs[2] = node->maxs[2];
|
||||
|
||||
dnode->planenum = ExportMapPlane(node->planenum);
|
||||
dnode->firstface = node->firstface;
|
||||
dnode->numfaces = node->numfaces;
|
||||
|
||||
// recursively output the other nodes
|
||||
for (i = 0; i < 2; i++) {
|
||||
if (node->children[i]->planenum == -1) {
|
||||
if (node->children[i]->contents == CONTENTS_SOLID)
|
||||
dnode->children[i] = -1;
|
||||
else {
|
||||
dnode->children[i] = -(map.cTotal[LUMP_LEAFS] + 1);
|
||||
ExportLeaf_BSP2(entity, node->children[i]);
|
||||
}
|
||||
} else {
|
||||
dnode->children[i] = map.cTotal[LUMP_NODES];
|
||||
ExportDrawNodes_BSP2(entity, node->children[i]);
|
||||
}
|
||||
}
|
||||
|
||||
Q_assert(!(dnode->children[0] == -1 && dnode->children[1] == -1));
|
||||
Q_assert(dnode->children[0] != dnode->children[1]);
|
||||
}
|
||||
|
||||
static void
|
||||
ExportDrawNodes_BSP2rmq(mapentity_t *entity, node_t *node)
|
||||
{
|
||||
struct lumpdata *nodes = &entity->lumps[LUMP_NODES];
|
||||
bsp2rmq_dnode_t *dnode;
|
||||
int i;
|
||||
|
||||
dnode = (bsp2rmq_dnode_t *)nodes->data + nodes->index;
|
||||
nodes->index++;
|
||||
map.cTotal[LUMP_NODES]++;
|
||||
|
||||
// VectorCopy doesn't work since dest are shorts
|
||||
dnode->mins[0] = node->mins[0];
|
||||
dnode->mins[1] = node->mins[1];
|
||||
dnode->mins[2] = node->mins[2];
|
||||
dnode->maxs[0] = node->maxs[0];
|
||||
dnode->maxs[1] = node->maxs[1];
|
||||
dnode->maxs[2] = node->maxs[2];
|
||||
|
||||
dnode->planenum = ExportMapPlane(node->planenum);
|
||||
dnode->firstface = node->firstface;
|
||||
dnode->numfaces = node->numfaces;
|
||||
|
||||
// recursively output the other nodes
|
||||
for (i = 0; i < 2; i++) {
|
||||
if (node->children[i]->planenum == -1) {
|
||||
if (node->children[i]->contents == CONTENTS_SOLID)
|
||||
dnode->children[i] = -1;
|
||||
else {
|
||||
dnode->children[i] = -(map.cTotal[LUMP_LEAFS] + 1);
|
||||
ExportLeaf_BSP2rmq(entity, node->children[i]);
|
||||
}
|
||||
} else {
|
||||
dnode->children[i] = map.cTotal[LUMP_NODES];
|
||||
ExportDrawNodes_BSP2rmq(entity, node->children[i]);
|
||||
}
|
||||
}
|
||||
|
||||
Q_assert(!(dnode->children[0] == -1 && dnode->children[1] == -1));
|
||||
Q_assert(dnode->children[0] != dnode->children[1]);
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
==================
|
||||
ExportDrawNodes
|
||||
|
|
|
|||
Loading…
Reference in New Issue