From 91f0c471281d882de4cd863529b7c9b18da601bd Mon Sep 17 00:00:00 2001 From: Jonathan Date: Sun, 12 Sep 2021 08:38:21 -0400 Subject: [PATCH] remove test code fix two errors --- bspinfo/bspinfo.cc | 35 ----------------------------------- qbsp/surfaces.cc | 2 +- qbsp/tjunc.cc | 2 +- 3 files changed, 2 insertions(+), 37 deletions(-) diff --git a/bspinfo/bspinfo.cc b/bspinfo/bspinfo.cc index 7c447cf3..b5f5bed0 100644 --- a/bspinfo/bspinfo.cc +++ b/bspinfo/bspinfo.cc @@ -21,39 +21,6 @@ #include #include -inline void PrintBSPInfo(const bspdata_t &bsp) { - printf("brushes:\n"); - for (int32_t i = 0; i < bsp.data.q2bsp.numbrushes; i++) { - printf(" %i: contents: %i, num sides: %i, first side: %i\n", i, bsp.data.q2bsp.dbrushes[i].contents, bsp.data.q2bsp.dbrushes[i].numsides, bsp.data.q2bsp.dbrushes[i].firstside); - } - - printf("brush sides:\n"); - for (int32_t i = 0; i < bsp.data.q2bsp.numbrushsides; i++) { - auto &plane = bsp.data.q2bsp.dplanes[bsp.data.q2bsp.dbrushsides[i].planenum]; - printf(" %i: { %i: %f %f %f -> %f }\n", i, plane.type, plane.normal[0], plane.normal[1], plane.normal[2], plane.dist); - } - - printf("leaves:\n"); - for (int32_t i = 0; i < bsp.data.q2bsp.numleafs; i++) { - auto &leaf = bsp.data.q2bsp.dleafs[i]; - - printf(" %i: contents %i, leafbrushes first %i -> count %i\n", i, leaf.contents, leaf.firstleafbrush, leaf.numleafbrushes); - } - - printf("nodes:\n"); - for (int32_t i = 0; i < bsp.data.q2bsp.numnodes; i++) { - auto &node = bsp.data.q2bsp.dnodes[i]; - auto &plane = bsp.data.q2bsp.dplanes[node.planenum]; - printf(" %i: { %i: %f %f %f -> %f }\n", i, plane.type, plane.normal[0], plane.normal[1], plane.normal[2], plane.dist); - } - - printf("models:\n"); - for (int32_t i = 0; i < bsp.data.q2bsp.nummodels; i++) { - auto &model = bsp.data.q2bsp.dmodels[i]; - printf(" %i: headnode %i (%f %f %f -> %f %f %f)\n", i, model.headnode, model.mins[0], model.mins[1], model.mins[2], model.maxs[0], model.maxs[1], model.maxs[2]); - } -} - int main(int argc, char **argv) { @@ -76,8 +43,6 @@ main(int argc, char **argv) LoadBSPFile(source, &bsp); PrintBSPFileSizes(&bsp); - PrintBSPInfo(bsp); - printf("---------------------\n"); } diff --git a/qbsp/surfaces.cc b/qbsp/surfaces.cc index a7dd6470..30590cdb 100644 --- a/qbsp/surfaces.cc +++ b/qbsp/surfaces.cc @@ -79,7 +79,7 @@ SubdivideFace(face_t *f, face_t **prevptr) tmp[1] = tex->vecs[axis][1]; tmp[2] = tex->vecs[axis][2]; - for (i = 0; i < f->w.numpoints; i++) { + for (int32_t i = 0; i < f->w.numpoints; i++) { v = DotProduct(f->w.points[i], tmp); if (v < mins) mins = v; diff --git a/qbsp/tjunc.cc b/qbsp/tjunc.cc index 226bfc65..0009ba92 100644 --- a/qbsp/tjunc.cc +++ b/qbsp/tjunc.cc @@ -381,7 +381,7 @@ FixFaceEdges(face_t *face, face_t *superface, face_t **facelist) __func__, MAX_SUPERFACE_POINTS); tjuncs++; - for (k = superface->w.numpoints; k > j; k--) + for (int32_t k = superface->w.numpoints; k > j; k--) VectorCopy(superface->w.points[k - 1], superface->w.points[k]); VectorMA(edge->origin, v->t, edge->dir, superface->w.points[j]); superface->w.numpoints++;