bsputil: add --modelinfo option

Dump some info about the faces of internal bsp models.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
This commit is contained in:
Kevin Shanahan 2013-08-18 16:32:48 +09:30
parent ad25768498
commit c2fbde6af7
1 changed files with 15 additions and 0 deletions

View File

@ -22,6 +22,7 @@
#include <common/cmdlib.h>
#include <common/bspfile.h>
#include <common/mathlib.h>
/* FIXME - share header with qbsp, etc. */
typedef struct {
@ -93,6 +94,18 @@ ExportWad(FILE *wadfile, bspdata_t *bsp)
}
}
static void
PrintModelInfo(const bspdata_t *bsp)
{
int i;
for (i = 0; i < bsp->nummodels; i++) {
const dmodel_t *dmodel = &bsp->dmodels[i];
printf("model %3d: %5d faces (firstface = %d)\n",
i, dmodel->numfaces, dmodel->firstface);
}
}
static void
CheckBSPFile(const bspdata_t *bsp)
{
@ -270,6 +283,8 @@ main(int argc, char **argv)
printf("Beginning BSP data check...\n");
CheckBSPFile(&bsp);
printf("Done.\n");
} else if (!strcmp(argv[i], "--modelinfo")) {
PrintModelInfo(&bsp);
}
}