Add BSP2 support to the remaining utils. Since these share the common
bspfile.[ch] files, it was more effort than is justifiable to break this
into multiple staged patches - so you just get this disgustingly big
commit instead. Here is basically what was done:
* Modify the bspdata_t struct with a union of the two bsp formats
* Modify the tools to use bsp2_t for all internal processing
* Split out the byte swapping routines for the different bsp data types
* Add simple (although verbose) code to convert bsp29 <-> bsp2
Hundreds of lines added to bspfile.c, but mostly trivial stuff. The tools
internally had little modification except to substitute the bsp2 type
names.
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
Normally we build a fast, unoptimized bsp tree for the world before
culling outside surfaces. This command line switch forces the use of
the more expensive algorithm for this processing stage. Seems to have
a positive effect on the final BSP in terms of reduced marksurfaces
and smaller file size, at the expense of longer processing time.
Marked experimental for now, as it may be removed later (either by
making this behaviour the default or removing it altogether).
Credit to Rebb from func_msgboard for implementing this tweak first in
his qbsp util.
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
If brushes in the map are textured with alt-animations, and the second
character (i.e. the 'a' in +abutton) is lower case then we have the
lowercase texture name in the miptex list, but when we add alt textures we
use the uppercase, so it gets duplicated. Duplicated animating textures
cause most engines to exit with an error.
Since the map file could use uppercase texture names as well, really we
should either be normalizing texture names to upper or lower case, or we
need to do case-insensitive matching - so I just changed to
case-insensitive matching.
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
Since the newskip.exe tool leaves the faces in the bsp but removes
references, we will just skip over lighting such faces.
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
We don't want to terminate the recursion in ClusterContents when we reach
a non-detail separator because we need to know the contents of the leafs!
This was working okay for simple cases but fails when the detail clusters
become more complex.
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
Don't count skip surface verticies at all in CountData_r because this
count actually gets used as the surfedge count and we need that to be
precise.
Don't try to save memory be allocating less verticies than edges, even
though many will probably be shared. The saving is not that significant
anyway.
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
First pass, checks most of the data structures actually reference within
the valid ranges. Will add more soon...
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>