Commit Graph

720 Commits

Author SHA1 Message Date
Kevin Shanahan 523f927b8e qbsp: trivial cleanups in FaceSide
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-06-23 10:56:41 +09:30
Kevin Shanahan 550b883de2 qbsp: more tjunc cleanups; braces and comments
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-06-22 20:59:42 +09:30
Kevin Shanahan 46c990c617 qbsp: trivial cleanups in SplitFaceForTjunc
Rename 'v' local to 'angle' and re-format some comments.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-06-22 20:58:31 +09:30
Kevin Shanahan e4367bc970 Merge branch 'master' of ssh://tuon.disenchant.net/~/scm/tyrutils 2013-05-08 11:34:58 +09:30
Kevin Shanahan 31cdb99ac6 vis: make leaf recursion a warning in LeafFlow
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>
2013-05-08 11:33:35 +09:30
Kevin Shanahan 9ea5aaa1db vis: tidy up definitions of LogLeaf/LogWinding
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-05-08 11:32:57 +09:30
Kevin Shanahan c0d03cba32 vis: constify source argument to copy winding
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-05-08 11:32:12 +09:30
Kevin Shanahan 8939d1f6db qbsp: fix adding animated textures for alt-anim textured brushes
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>
2013-04-25 21:43:59 +09:30
Kevin Shanahan 59f53cf2fa bump version post-release
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-04-25 21:43:32 +09:30
Kevin Shanahan 2e74b15a08 TyrUtils v0.10
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-04-25 08:13:09 +09:30
Kevin Shanahan 54e0e55113 vis: fix missing vertex on clipped portals (argh!!!)
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-04-25 07:58:43 +09:30
Kevin Shanahan 7caeafb714 trivial: pad counts to 8 digits, sizes to 10 in output
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>
2013-04-24 15:18:01 +09:30
Kevin Shanahan 414d3dda51 qbsp: add fflush back for msgScree
Otherwise progress output doesn't show on unix terminals.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-04-24 15:05:07 +09:30
Kevin Shanahan 47d2b9841b qbsp: use 5 spaces instead of tab to pad msgStat
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-04-24 15:04:35 +09:30
Kevin Shanahan a78115fa2c doc: add documentation for bspinfo and bsputil
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-04-24 14:29:12 +09:30
Kevin Shanahan a9cfbbc3dc trivial: fix missing newline at end of usage output
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-04-24 14:26:21 +09:30
Kevin Shanahan 0ad7bac1d3 build: only move tar archive to target name on success
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-04-24 12:22:06 +09:30
Kevin Shanahan 45fa5a6e39 build: add a target for building source tarball from git
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-04-24 11:37:51 +09:30
Kevin Shanahan fc38e25074 post-release version bump
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-04-24 09:33:57 +09:30
Kevin Shanahan d42b6a062c TyrUtils v0.9
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-04-24 09:05:15 +09:30
Kevin Shanahan 723a3f140e common: fix missing stdarg include in log.h
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-04-24 09:02:20 +09:30
Kevin Shanahan 280df62f55 qbsp: fix MidpointWinding bug, which fixes the bad leak lines!
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-04-24 08:54:26 +09:30
Kevin Shanahan 653daa111a qbsp: invert sense of fillnode side initialisation
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-04-24 07:02:38 +09:30
Kevin Shanahan 1e39a7e614 qbsp: factor out leafnode intersection from LineIntersect_r
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-04-24 07:01:37 +09:30
Kevin Shanahan 4543817f59 qbsp: use a memset to simplify leakstate initialization
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-04-24 07:00:34 +09:30
Kevin Shanahan 4c6142e97f qbsp: use the common logfile code
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>
2013-04-23 15:48:32 +09:30
Kevin Shanahan 75666712e7 common: create logprint_silent to replace qbsp's msgFile
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-04-23 14:59:37 +09:30
Kevin Shanahan b1650d0036 common: temporary hack for Error() definition in threads.c
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>
2013-04-23 14:46:15 +09:30
Kevin Shanahan bbbb3ff859 common: use stdbool in threads.c, log.c so cmdlib isn't needed
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>
2013-04-23 14:44:14 +09:30
Kevin Shanahan bf9bc549d2 qbsp: remove unneccessary extern from function declarations
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-04-23 14:41:54 +09:30
Kevin Shanahan c3bf54e494 common: add printf attribute to Error() declaration in cmdlib.h
Fix a number of warnings now generated as a result.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-04-23 14:39:44 +09:30
Kevin Shanahan 37f87a28be vis, qbsp: improve robustness of ClipWinding/DivideWinding
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>
2013-04-23 14:00:31 +09:30
Kevin Shanahan dddae057d6 TyrUtils v0.8
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-04-23 09:40:05 +09:30
Kevin Shanahan 347020879d qbsp: rename Error_() to Error()
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-04-22 20:21:17 +09:30
Kevin Shanahan 51bed53570 qbsp: remove remaining enum errors
Remove the enum Error() function and global error strings as well.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-04-22 20:15:09 +09:30
Kevin Shanahan ea5e46f9df qbsp: replace error enums in surfaces.c, solidbsp.c
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-04-22 19:16:53 +09:30
Kevin Shanahan b9fa895988 qbsp: replace enum errors in portals.c
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-04-22 18:47:36 +09:30
Kevin Shanahan 15da0d818a qbsp: replace enum errors in parser.c
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-04-22 18:40:13 +09:30
Kevin Shanahan 0e586916b1 qbsp: replace error enums in outside.c, merge.c
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-04-22 18:32:52 +09:30
Kevin Shanahan c01397ed5b qbsp: replace enum errors in file.c and wad.c
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-04-22 18:23:24 +09:30
Kevin Shanahan 02e81df39b qbsp: replace error enums in csg4.c
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-04-22 18:20:02 +09:30
Kevin Shanahan 58b33cc3d4 qbsp: remplace error enums in bspfile.c
Overlapped with outside.c and portals.c for some of the file errors.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-04-22 18:15:38 +09:30
Kevin Shanahan 7203d3407b qbsp: replace enum errors in brush.c
One shared message in surfaces.c replaced as well.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-04-22 17:59:36 +09:30
Kevin Shanahan d5adbcd8ca qbsp: replace enum errors in qbsp.c
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-04-22 17:39:56 +09:30
Kevin Shanahan 30caae09e5 qbsp: re-factor ParseBrush into smaller pieces
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>
2013-04-22 17:33:16 +09:30
Kevin Shanahan 5082e3ffaa light: reduce "no model has face" to a warning
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>
2013-04-22 13:11:22 +09:30
Kevin Shanahan 4a49552904 bsputil: add missing stdint.h include
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-04-22 12:51:33 +09:30
Kevin Shanahan 39ccae145a qbsp: create an Error() function similar to the other tools
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>
2013-04-22 11:40:22 +09:30
Kevin Shanahan bb02e6d20a qbsp: fix portal generation mixed water/empty detail clusters
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>
2013-04-21 13:05:11 +09:30
Kevin Shanahan d3a75f6c1a vis: use uintptr for FreeStackWinding index check
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>
2013-04-21 10:17:40 +09:30