Make CheckStack return an error code if we have recursed and print
some information about the offending leaf/portals before continuing.
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>
Also do a quick sweep of the source and consistently use %d instead of
%i (no real difference, but just pick one).
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
Not too intrusive, since the Message() layer still acts as a shim
here. Most of the changes are for the Makefile. Qbsp now links to
the threading code as a result, but no thread support... yet!
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
Qbsp now uses exactly the same Error() function spec, so just hack
around clashes in the cmdlib.h header for now by defining Error()
locally and removing the cmdlib.h include.
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
The only thing used by log.c was the qboolean definition, so just use
stdbool internally instead.
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
Carry over some correctness fixes from recent changes to vis into the
qbsp versions of ClipWinding and make the implementations more
consistent overall.
Most importantly:
* Ensure we always have allocated one extra dists/sides slot for wrap around
* Check we have space for a new vertex every time we try to add one
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
Factor out some of the processing involved with parsing a brush. When
checking for duplicate planes, use the same "PlaneEqual" functions as
used in brush.c.
Replace the enum style errors with the new Error_ function for all of
map.c so the error string is at the call site.
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>
Call it Error_() for now while I work on transitioning away from the
arrays of global strings hidden away by error enums.
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>
Just in case unsigned long isn't big enough to capture the pointer
offsets. Also, cast STACK_WINDINGS to the correct type before doing the
comparison.
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>