Commit Graph

36 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 a3b985e721 hexen2 support, patch from Spike 2015-10-16 21:18:53 -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
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 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 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 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 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 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 926cf8eb95 qbsp: return first face number from MakeFaceEdges and pass to ExportDrawNodes
Removes another global variable.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-03-05 15:17:40 +10:30
Kevin Shanahan 26c2789d7e qbsp: make planemap local to ExportNodePlanes{,_r}
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-03-05 15:11:31 +10:30
Kevin Shanahan 6dd0fbd085 qbsp: misc local variable naming changes for writebsp.c
Shouldn't be any functional changes to the code.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-03-05 14:54:04 +10:30
Kevin Shanahan fe89facbd0 qbsp: rename face->texturenum to texinfo
Since it is an index into the global texinfo, not miptex.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-03-05 14:34:02 +10:30
Kevin Shanahan 1432d99049 qbsp: cleanup texinfo flags before writing bsp
The TEX_SKIP flag isn't needed and although it *shouldn't* upset any
engines, better to not write it out at all.

Well, even better to not write anything about the skip texture to the BSP
file, but need to re-organise things a bit more before that can happen.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-03-05 14:13:23 +10:30
Kevin Shanahan 38722f9eab qbsp: don't output skip surfaces in the bsp file
* Don't create edges in MakeFaceEdges
* Don't output faces in GrowNodeRegions
* Don't output marksurfaces in CountLeaves/ExportLeaf

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-03-05 14:00:23 +10:30
Kevin Shanahan 53e61c28ca qbsp: pass hullnum into ExportClipNodes()
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-02-18 10:33:28 +10:30
Kevin Shanahan 44a22eaa38 qbsp: move global plane and miptex data into mapdata struct
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-02-17 17:04:03 +10:30
Kevin Shanahan 40034e28d0 qbsp: rename mapdata array members to remove rg prefix
It does make them somewhat less greppable, but makes the variable naming
style more consistent with the rest of the quake utilities.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-02-15 11:13:48 +10:30
Kevin Shanahan f163b35932 qbsp: get rid of map.iEntities
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-02-14 15:17:31 +10:30
Kevin Shanahan 76ba40f621 qbsp: pass entity into Export{Draw,Clip}Nodes
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-02-10 17:49:27 +10:30
Kevin Shanahan ee015abe53 qbsp: fix incorrect size for memset of planemapping
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-12-17 12:39:26 +10:30
Tyrann 3136594bc4 Create separate Error() function so it can be marked "noreturn"
Silences some false warnings from the compiler
2012-01-07 16:48:02 +10:30
Tyrann fba05c351a [PATCH] qbsp: Increase MAX_BSP_CLIPNODES
Offsets pointing to clipnodes were originally used as signed short (16-bit)
numbers, so that negative numbers could represent the various content types of
leaf nodes. However, only a small number of these types are required, so we
now make use of the rest of the clipnode range.

Signed-off-by: Tyrann <tyrann@disenchant.net>
2007-08-23 20:48:02 +09:30
Tyrann d5f000838f [PATCH] qbsp: Remove big mapentity_t union
Remove the big union in mapentity_t, collecting together the information for
each lump in a struct. Still not 100% sure where I'm going with this, but I
think this will help me with removing some of the reliance on globals further
along (which will be important once it comes to multi-threading).

Signed-off-by: Tyrann <tyrann@disenchant.net>
2007-08-21 23:18:56 +09:30
Tyrann 4464491807 [PATCH] qbsp: Use double-precision floating point
Set the vec_t type to "double" using the DOUBLEVEC_T preproccessor define. Fix
up hard-coded usages of float in various places throughout the code. Note that
texinfo_t is an on-disk structure, so that needs to stay as float and we work
around incompatibilities with the vector functions using a temporary vec3_t.

Signed-off-by: Tyrann <tyrann@disenchant.net>
2006-09-16 16:36:16 +09:30
Tyrann 073959d654 [PATCH 15/15] qbsp: writebsp.c statics
Signed-off-by: Tyrann <tyrann@disenchant.net>
2006-09-10 22:46:03 +09:30
Tyrann dcb6fa7c9b [PATCH] qbsp: Remove unnecessary casts from AllocMem calls
Now that we're compiling as C code, the memory returned by AllocMem no longer
needs to be explicitly cast when assigning to our typed pointers.

Signed-off-by: Tyrann <tyrann@disenchant.net>
2006-09-10 20:29:00 +09:30
Tyrann 293efefa26 [PATCH 4/9] qbsp: Remove default arguments from {Alloc,Free}Mem
More C++ removal. Just pass the default arguments explicitly.

Signed-off-by: Tyrann <tyrann@disenchant.net>
2006-09-10 17:38:32 +09:30
Tyrann a2c8785d81 [PATCH 3/3] qbsp: run indent over the source files
More source mangling; run indent over the source files to make it more
consistent with the rest of my utils code. Remove any trailing whitespace
while we're at it.

Signed-off-by: Tyrann <tyrann@disenchant.net>
2006-09-05 20:57:33 +09:30
Tyrann 950c8ab0de [PATCH 1/3] qbsp: add copyright notices and license info
Signed-off-by: Tyrann <tyrann@disenchant.net>
2006-09-05 20:56:57 +09:30
Tyrann d0a0c3c15c [PATCH] Import QBSP sources
Import QBSP sources from Greg Lewis' TreeQBSP version 1.62.
- http://www.yossman.net/~tree/

Thanks to Greg for allowing me to use his modified source code:

On Fri, Aug 25, 2006 at 04:28:24PM -0400, Tree wrote:
> I imagine you've already gone ahead with your plans, but feel free to do
> whatever you wish with the source for TreeQBSP; I have no interest in
> restricting anyone's access to it (and of course I was just modifying id's
> code anyway).  I'm just glad to see that it was of some use to you. :)
>
> Greg

The files are unmodified from the originals, apart from lower-casing the
filenames and removing ASCII CR characters from end of lines.

Signed-off-by: Tyrann <tyrann@disenchant.net>
2006-08-29 00:03:53 +09:30