Commit Graph

645 Commits

Author SHA1 Message Date
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
Kevin Shanahan 0269ad8edb qbsp: show the error margin when non-convex faces are found
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-08-18 16:57:40 +09:30
Kevin Shanahan 1612d60a5f light: keep debug helper for dumping face info
Used this to help with debugging, but may as well keep it around for
future debugging rather than implement it all over again next time.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-08-18 16:52:19 +09:30
Kevin Shanahan aa4f577a6d qbsp: constify some more arguments to GetEdge
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-08-18 16:41:44 +09:30
Kevin Shanahan 33eff1ded9 bsputil: Check that face verticies lie on the face plane
Yet another consistency check.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-08-18 16:34:27 +09:30
Kevin Shanahan c2fbde6af7 bsputil: add --modelinfo option
Dump some info about the faces of internal bsp models.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-08-18 16:32:52 +09:30
Kevin Shanahan ad25768498 qbsp: exit with error if vertices exceed 65535
Unable to represent this in the bsp29 format, so let the user know instead
of silently corrupting the bsp.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-08-18 16:11:41 +09:30
Kevin Shanahan 0bf7fc3374 qbsp: remove ununsed c_tryedges variable
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-08-18 15:05:21 +09:30
Kevin Shanahan ca02e17b60 qbsp: minor cleanups to CheckFace
Print the length of the degenerate edge if one is detected,
Rename a few variables, etc.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-08-16 13:03:45 +09:30