Commit Graph

81 Commits

Author SHA1 Message Date
Eric Wasylishen 292d35879b build: restore mingw support 2016-08-05 04:07:01 -04:00
Eric Wasylishen 8429017ea4 common: add message to LoadBSPFile 2016-07-23 16:19:53 -06:00
Eric Wasylishen 335f54aa09 common: remove setting stack side for pthreads 2016-07-15 16:14:48 -06:00
Eric Wasylishen 78810fa765 common: fix COM_Parse const-ness 2016-07-06 17:06:28 -06:00
Eric Wasylishen afbc17d1ea qbsp, common: raise BOGUS_RANGE to 65536 2016-06-09 01:18:35 -06:00
Eric Wasylishen e0f8213cc9 common: add userinfo param to DiceWinding 2016-05-19 23:55:12 -06:00
Eric Wasylishen 4ea6b2ec00 common: fix broken WindingPlane 2016-05-19 23:53:14 -06:00
Eric Wasylishen 7715310afe common: add AllocWindingEdges, FreeWindingEdges, PointInWindingEdges 2016-05-19 22:02:45 -06:00
Eric Wasylishen 2cdc5e7c68 common: actually move WindingFromFace to polylib 2016-05-19 15:18:33 -06:00
Eric Wasylishen 45010089f3 light, common: move WindingFromFace to bspfile.c/h 2016-05-19 15:07:31 -06:00
Eric Wasylishen fff12697e5 light: move DicePatch to polylib.c 2016-05-19 15:03:21 -06:00
Eric Wasylishen f73b9de0b3 common: make VectorLength, VectorNormalize static inline 2016-05-13 21:10:00 -06:00
Eric Wasylishen bc0e76f959 common: polylib: add WindingBounds from q2 tools. Add missing consts 2016-04-19 01:39:37 -06:00
Eric Wasylishen 901e56f375 common: WriteBSPFile: log the filename being written 2016-03-31 18:12:11 -06:00
Eric Wasylishen e2dbd45b4f all: fix infinite loop in LoadFilePak when map can't be found 2016-02-25 14:08:00 -07:00
Eric Wasylishen b0777c2075 suppress compile warnings 2016-02-15 16:20:29 -07:00
Eric Wasylishen 1da64c0db4 Fix bspx lump padding logic 2016-02-15 16:20:29 -07:00
Eric Wasylishen 1630b8756e tyrutils-ericw-spike rebased on to 998c9d3acb 2016-02-15 16:16:37 -07:00
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 c149ed2bf6 build: VS2015 support 2015-12-07 14:23:13 -07:00
Eric Wasylishen a3b985e721 hexen2 support, patch from Spike 2015-10-16 21:18:53 -06:00
Eric Wasylishen 44bd1c4943 light: show execution time with tenths of a second 2015-09-12 18:54:26 -06:00
Eric Wasylishen 3005504fe5 vis, light: set low process priority on windows 2015-08-05 12:10:17 -06:00
Eric Wasylishen 985271f689 bsputil: display number of models 2015-04-29 16:07:14 -06:00
Eric Wasylishen 02196e2efa Makefile/CMakeLists.txt: factor out stack size setting to here. 2015-04-25 17:29:23 -06:00
Eric Wasylishen 15a4e160f2 threads.c: re-enable code to set the stack size on posix. Default stack size on OS X 10.10 isn't large enough 2015-02-05 11:39:15 -07:00
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 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 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 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 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 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 d14793f7ab common: make LoadBSPFile take a bspdata struct
No longer update the globals in this function - make the callers do it
instead.

bspinfo no longer refers to the globals at all.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-04-20 16:51:45 +09:30
Kevin Shanahan 35024bfa7d common: make dtexdata a union
Just having one base pointer was kind of annoying because you have to cast
to get to the lump offsets, then cast to byte * to find the miptex, etc.
Now we can access the same pointer using the correct types in each case.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-04-20 16:34:30 +09:30
Kevin Shanahan 37a3a98eff common: make WriteBSPFile take a bspdata struct as input
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-04-20 15:52:31 +09:30
Kevin Shanahan 6bf97a2cb0 common: convert PrintBSPFileSizes to use the bspdata struct
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-04-20 13:27:25 +09:30
Kevin Shanahan 3e660b291a common: zero the bsp structure before calling CopyLump
Stops CopyLump from trying to free using random pointers.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-04-20 13:24:09 +09:30
Kevin Shanahan bc0de585ff common: fix use after free in LoadBSPFile
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-04-20 13:23:34 +09:30
Kevin Shanahan 23d938a822 common: fix reference to plane data in SwapBSPFile
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-04-20 13:22:31 +09:30
Kevin Shanahan d4aba2ce58 common: convert LoadBSPFile to work on a bspdata struct internally
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-04-20 12:44:48 +09:30
Kevin Shanahan 00850d9db8 common: convert SwapBSPFile to work on a bspdata_t struct
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-04-20 12:02:09 +09:30
Kevin Shanahan 89074e10e9 common: create a struct for instanced bsp data
I'd like to be able to control visibility of the global bsp data as well
as having the ability to load two bsp files and do comparisons, etc.  Set
up a structure to hold all the bsp data and a couple of helper functions
to enable a smooth transition for the utils.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-04-20 12:00:07 +09:30