From 1432d9904916b3f38865c30c873fbdb133d87a0b Mon Sep 17 00:00:00 2001 From: Kevin Shanahan Date: Tue, 5 Mar 2013 14:13:20 +1030 Subject: [PATCH] qbsp: cleanup texinfo flags before writing bsp The TEX_SKIP flag isn't needed and although it *shouldn't* upset any engines, better to not write it out at all. Well, even better to not write anything about the skip texture to the BSP file, but need to re-organise things a bit more before that can happen. Signed-off-by: Kevin Shanahan --- qbsp/writebsp.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/qbsp/writebsp.c b/qbsp/writebsp.c index 417fe99a..121474e5 100644 --- a/qbsp/writebsp.c +++ b/qbsp/writebsp.c @@ -445,6 +445,20 @@ BeginBSPFile(void) map.cTotal[BSPLEAF]++; } +/* + * Remove any extra texinfo flags we added that are not normally written + * Standard quake utils only ever write the TEX_SPECIAL flag. + */ +static void +CleanBSPTexinfoFlags(void) +{ + texinfo_t *texinfo = pWorldEnt->lumps[BSPTEXINFO].data; + const int num_texinfo = pWorldEnt->lumps[BSPTEXINFO].index; + int i; + + for (i = 0; i < num_texinfo; i++, texinfo++) + texinfo->flags &= TEX_SPECIAL; +} /* ================== @@ -468,6 +482,7 @@ FinishBSPFile(void) planes->count = map.cTotal[BSPPLANE]; PrintBSPFileSizes(); + CleanBSPTexinfoFlags(); WriteBSPFile(); options.fVerbose = options.fAllverbose;