Commit Graph

603 Commits

Author SHA1 Message Date
Kevin Shanahan df9c82eb91 qbsp: improve a few error messages using new line number info
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2014-02-13 15:57:01 +10:30
Kevin Shanahan 06583de238 qbsp: save line number information when generating faces
To improve debug messages, save the line number of the faces as we
generate them and in the case of hull generation, save a pointer back
to the source brush.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2014-02-13 15:55:23 +10:30
Kevin Shanahan e40c68a8b8 qbsp: use explicit cast to short in ExportLeaf_BSP2 node bounds
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2014-02-13 15:00:05 +10:30
Kevin Shanahan fa48825cb5 qbsp: make transparent water the default for visibility calculations
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-12-24 19:08:46 +10:30
Kevin Shanahan f9d1f50cf3 qbsp: increase MAXEDGES from 32 to 64
Should still be enough stack space... I think.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-12-24 19:04:57 +10:30
Kevin Shanahan 88db6a79b1 qbsp: remember to ignore func_group entities for -onlyents compiles
Otherwise, we break the brush model names (numbering).

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-12-02 15:06:40 +10:30
Kevin Shanahan e8d1f59d11 qbsp: fix parsing of texture names containing curly braces
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-10-04 09:21:04 +09:30
Kevin Shanahan f6a3700301 TyrUtils v0.14
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-10-03 11:10:45 +09:30
Kevin Shanahan 456565d17f qbsp: add the -2psb command line option to output RMQ style BSP2
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-10-03 11:09:25 +09:30
Kevin Shanahan ff7c3a54a2 doc: document .map format compatibility
Include changelog entry for the new Quake 2 map compatibility.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-10-02 08:50:31 +09:30
Kevin Shanahan f972f19f39 qbsp: ignore leading path in texture names for Quake 2 compatibility
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-10-01 12:42:25 +09:30
Kevin Shanahan 1196dd8a82 qbsp: ignore extra surface flags found in Quake 2 map files
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-10-01 12:34:59 +09:30
Kevin Shanahan 4a487955c8 qbsp: add a PARSE_OPTIONAL parser flag
Enables us to check if there is extra data on the same line, without
advancing the parser past the end of line.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-10-01 12:34:01 +09:30
Kevin Shanahan 30ab46b752 TyrUtils v0.13
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-09-30 16:11:54 +09:30
Kevin Shanahan ae060bf0fe qbsp: add any extra animation frames for used textures
Search the WADs for extra frames on any animated textures used and add
them to the bsp.  This restores the old behaviour which was mistakenly
removed, but now we have the assurance that textures are added in
order and all lower numbered animation frames are added a warning is
printed if it is missing from the wad.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-09-30 13:09:45 +09:30
Kevin Shanahan 55d717d3fe qbsp: fudge miptex count to work around tiny maps with lots of animating textures
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-09-30 13:08:10 +09:30
Kevin Shanahan 543d177d66 qbsp: correctly handle func_groups with no solid brushes
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-09-30 12:29:41 +09:30
Kevin Shanahan 83686fe0f1 qbsp: consistently use strcasecmp to compare entity keys
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-09-30 12:27:53 +09:30
Kevin Shanahan 7019894003 common: output human readable version string in WriteBSP
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-09-30 12:26:56 +09:30
Kevin Shanahan d33aaba938 TyrUtils v0.12
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-09-29 16:58:14 +09:30
Kevin Shanahan 4f263d05ff update changelog
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-09-29 08:53:32 +09:30
Kevin Shanahan 509289efd3 bsputil: don't test < 0 on unsigned vertex and marksurf numbers
Now that our type constraints dictate they can never appear < 0.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-09-29 08:45:06 +09:30
Kevin Shanahan 125ee1f85f bsputil: fix printf format warning (long vs. int)
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-09-29 08:44:37 +09:30
Kevin Shanahan cb091642c7 qbsp: fix non-solid sky brushes in the collision hulls
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-09-29 08:40:07 +09:30
Kevin Shanahan 50b78f3d61 qbsp, common: support both DP and RMQ variants of the BSP2 format
Turns out there are two types of "BSP2" format - one that I think was
created by MH and implemented in the RMQ project (this is the one I
implemented previously) and one by LordHavoc which exteneded the
coordinate limits beyond 32k, implemented in Darkplaces.  The
Darkplaces version of BSP2 will get the name BSP2 and the RMQ version,
which is more limited, will get the name BSP2rmq.

qbsp will only create the BSP29 or BSP2 formats, but will cope with a
BSP2rmq format file for an -onlyents compile.  The rest of the tools
can use any of the three formats.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-09-28 11:48:37 +09:30
Kevin Shanahan 7a110ff1f3 TyrUtils v0.11
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-09-25 15:25:54 +09:30
Kevin Shanahan 4b1e3aec1a light, vis, bsputil, bspinfo: Add BSP2 support
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>
2013-09-25 15:18:50 +09:30
Kevin Shanahan fbab3d4859 common: tidy up version check in LoadBSPFile
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-09-23 12:24:31 +09:30
Kevin Shanahan e970bea8c7 common: save the bsp version in the bspdata struct
Adjust the Load and Write API functions as appropriate.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-08-22 13:25:47 +09:30
Kevin Shanahan 89abf25218 common: convert all tools to instanced bsp data
Transition all tools to access the BSP data via the bspdata struct instead
of the shared globals.  Remove the compatibility code from bspfile which
copied the global values to/from the instanced bspdata struct.

Mostly the changes just involved passing along the bspdata struct to the
various functions which needed to reference the data.  TraceLine and
MakeTNodes in light got some extra changes so that we cache the node
dplane pointer and remove the need to pass the bspdata struct to every
trace operation!

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-08-22 11:01:08 +09:30
Kevin Shanahan d0617760f5 common: add the ability to pass an arg to spawned threads
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-08-20 19:27:40 +09:30
Kevin Shanahan 6ddb109dde light: convert WriteLitFile to use the bspdata struct
Avoids reference to global LightDataSize.  Need to move writing the lit
file above the call to WriteBSPFile, since that will do the byte swapping.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-08-20 15:23:04 +09:30
Kevin Shanahan 5facda6ff9 common: constify vec3_origin
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-08-20 13:30:05 +09:30
Kevin Shanahan 51419621ec common: add the bsp2/bsp29 data types
Rename the default bsp29 data types and add the bsp2 data types to
the common bspfile.h.  Propogate the bsp29 names into the other tools as
simple renames for now.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-08-20 13:25:16 +09:30
Kevin Shanahan 0092347789 common: use stdint types in the common bspfile.h
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-08-20 12:25:51 +09:30
Kevin Shanahan 69c86e59b8 common: move AMBIENT and MAXLIGHTMAP definitions
Keep the ambient sound definitions near the leaf and lightmaps limit near
the face definition.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-08-20 12:20:57 +09:30
Kevin Shanahan 42bcf2da7c common: rename HEADER_LUMPS -> BSP_LUMPS
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-08-20 09:30:26 +09:30
Kevin Shanahan 9a2cd81b8c common: add the bsp version defines to bspfile.h
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-08-20 09:18:26 +09:30
Kevin Shanahan 58c6335434 qbsp: don't bail out on 65535 verticies for bsp2 output
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-08-19 17:09:23 +09:30
Kevin Shanahan 85581b6c0c qbsp: output leafs, nodes and marksurfaces in bsp2 format
This completes the basic BSP2 support.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-08-19 17:09:10 +09:30
Kevin Shanahan ce26465f57 qbsp: output clipnodes in bsp2 format
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-08-19 16:39:24 +09:30
Kevin Shanahan 083dc9fda1 qbsp: add output of faces and edges using bsp2 format
Won't produce a working bsp2 file yet, but if you ask for bsp2 on the
command line now, faces and edges will be output in bsp2 format.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-08-19 16:20:55 +09:30
Kevin Shanahan 9c3613e47f qbsp: duplicate the MemSizes array for the two BSP formats
Kind of taking a step backwards here to where we were, but make the
MemSizes array dynamically changable so that we can switch out and
allocate BSP2 sized elements when we want to write a file in that format.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-08-19 14:36:40 +09:30
Kevin Shanahan bf3ea6374c qbsp: separate the lump numbering from the memory sizes array order
Some of the bsp2 data structures are bigger than the bsp29 structures, so
we need to know the difference in allocation size.  Stop using the data
structure enum for lump numbers.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-08-19 12:22:21 +09:30
Kevin Shanahan 2d65515d0f qbsp: add bsp2 data types to bspfile.h
In preparation for bsp2 support, add the data types for bsp2 structures
to bspfile.h and rename the bsp29 structures to properly differentiate them.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-08-19 10:25:17 +09:30
Kevin Shanahan 32973e6779 qbsp: re-format the memsize global array
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-08-19 10:13:11 +09:30
Kevin Shanahan 330d5270dd qbsp: separate out bspfile.h from qbsp.h
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-08-19 09:46:23 +09:30
Kevin Shanahan b403b6bd5e doc: note the vertex limit bug fix in changelog
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-08-18 17:19:10 +09:30
Kevin Shanahan d7d6c4939c qbsp: minor cleanup in FindFaceEdges
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-08-18 17:14:36 +09:30
Kevin Shanahan 876ac97cbe qbsp: small cleanups in GetVertex
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-08-18 17:01:24 +09:30