Commit Graph

378 Commits

Author SHA1 Message Date
Eric Wasylishen 420125cc67 replace tabs with spaces.
for FILE in $(find . -name "*.h" -or -name "*.c"); do cat $FILE | expand > temp; cat temp > $FILE; done
2015-12-07 15:08:48 -07:00
Eric Wasylishen 0ec1c96a06 build: fix warning 2015-12-07 14:40:44 -07:00
Eric Wasylishen c149ed2bf6 build: VS2015 support 2015-12-07 14:23:13 -07:00
Eric Wasylishen 5face9dd51 qbsp: round texture vector values that are within ZERO_EPSILON of integers,
to attempt to attempt to work around corrupted lightmap sizes in DarkPlaces
(it uses 32 bit precision in CalcSurfaceExtents)
2015-12-04 15:49:23 -08:00
Eric Wasylishen fee62faa24 qbsp: Print coordinates in "CheckFace: too few points" error 2015-11-20 17:15:59 -07:00
Eric Wasylishen a5a2de6c6f qbsp: add coordinates to "New portal was clipped away" warning, from txqbsp-xt 2015-10-26 13:42:42 -06:00
Eric Wasylishen fddb87287a qbsp: DividePlane: always use bugfix from 7e7d851 regardless of maxNodeSize setting 2015-10-23 17:22:05 -06:00
Eric Wasylishen 0bc85020d2 qbsp: ChooseMidPlaneFromList: mark detail separators on the final SolidBSP pass. 2015-10-19 20:19:25 -06:00
Eric Wasylishen 44e1eccca6 qbsp: change detail handling, from qbsp-xt.
MidSplit now does two passes (structural/detail), like ChoosePlaneFromList.
Now, the first pass will pick among planes that have at least one structural face, and zero or more detail faces.
The second pass will pick among planes that have no structural faces, and zero or more detail faces.

This fixes the hull 1 leak in telefragged.map introduced when I added txqbsp's maxNodeSize feature,
and also reduces the cluster and portal count in jam6_ericwtronyn.map a bit.
2015-10-18 14:28:36 -06:00
Eric Wasylishen ddfa2c7ad5 merge: don't merge detail and non-detail 2015-10-18 00:21:09 -06:00
Eric Wasylishen a596187841 hexen2 support: fix "qbsp -onlyents" which broke with the hexen2 patch 2015-10-17 01:38:24 -06:00
Eric Wasylishen a3b985e721 hexen2 support, patch from Spike 2015-10-16 21:18:53 -06:00
Eric Wasylishen a75de817b1 qbsp: add -epsilon option to set ON_EPSILON, from txqbsp-xt 2015-09-27 00:53:55 -06:00
Eric Wasylishen 7e7d851fdb qbsp: DividePlane: add missing recalculation of surface bbox for the parallel case.
Thanks to rebb for the idea, txqbsp has the workaround in SelectPartition that recomputes the surface bbox; I think this fixes the underlying bug though.

Note: this makes telefragged.map (from the RRP devkit) leak in hull 2.
However, the point file starts at a func_detail staircase that, if turned into func_wall, fixes the leak.
2015-09-16 22:49:33 -06:00
Eric Wasylishen 3322ffb8f3 qbsp: add -maxnodesize option from txqbsp-xt. Defaults to on, nodes with a bbox with any dimension exceeding 1024. 2015-09-16 21:31:44 -06:00
Eric Wasylishen 20901a5a7d qbsp: update usage text 2015-08-09 13:45:30 -06:00
Eric Wasylishen 3877a213a0 qbsp: use -oldaxis by default 2015-08-09 13:36:13 -06:00
Eric Wasylishen a7b1ae851b qbsp: make degenerate edge error in tjunc.c into a warning. from txqbsp-xt. 2015-08-01 20:07:51 -06:00
Eric Wasylishen 9fd7305479 qbsp: make "mixed face contents" error non-fatal if one of the leafnode or face is CONTENTS_EMPTY. from txqbsp-xt.
Fixes an issue necros was having.
2015-07-30 18:33:52 -06:00
Eric Wasylishen 3a109ac84d build: split up cmake build system into subprojects.
-DDOUBLEVEC_T now correctly used for qbsp only.
2015-05-05 12:34:39 -06:00
Eric Wasylishen 67cec03ac8 qbsp: fix broken -onlyents option by moving model allocation from map.c to ExportDrawNodes 2015-04-29 16:07:14 -06:00
Eric Wasylishen ed66ed112e qbsp: fix texture offset on rotate_object, so they match in the editor. Added "-oldrottex" flag to revert to old behaviour. From txqbsp-xt. 2015-04-29 16:07:07 -06:00
Eric Wasylishen d77a7d768c qbsp: switch to hardcoded MAX_MAP_PLANES. counting unique planes was slow 2015-04-25 23:09:35 -06:00
Eric Wasylishen 28e460be9a qbsp: MakeFaceEdges: accelerate with a hash table to avoid slow O(n^2) search for edges 2015-04-25 22:49:40 -06:00
Eric Wasylishen 1812734037 qbsp: ChooseMidPlaneFromList: fix off-by-one error in axial plane test. On the first SolidBSP pass, gives fewer split nodes on bbin1.map (128k vs 199k) 2015-04-25 21:01:49 -06:00
Eric Wasylishen 5111c5485c qbsp: account for miptex struct in wad3 lump disksize
Here's another little tyrutils patch: in qbsp, I believe the
calculation of the "disksize" field of the miptex lumps when using
WAD3 textures is missing the size of the dmiptex_t struct (40 bytes),
causing the resulting bsp file to be slightly truncated.

I noticed this because one of Tronyn's levels (jam2_tronyn.bsp) was
crashing Quakespasm for me; it turned out the engine was trying to
read 40 bytes past the end of the file when loading the last texture
in the bsp. I got him to send over his map source, wads, and compiler;
he was using tyrutils 0.15 and wad3 format textures, and I confirmed
that this patch fixes the engine crash.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2014-10-30 12:54:36 +10:30
Kevin Shanahan 90aa616866 qbsp: fix coordinates in degenerate edge error in tjunc.c
The error message was actually displaying the edge vector, which is
always going to be ~(0,0,0).  Pass in the edge end points and then we
can display both the length of the edge and the location of one end
point.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2014-05-06 20:30:15 +09:30
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 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 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 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 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 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 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 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