Commit Graph

87 Commits

Author SHA1 Message Date
Eric Wasylishen 7e429c560c bsputil: add --convert option 2017-10-02 18:27:20 -06:00
Eric Wasylishen 8813d272cb common, light, vis: change from bsp2_t to mbsp_t 2017-10-01 22:32:20 -06:00
Eric Wasylishen 7236e47ef4 bsputil: print used lighstyles 2017-06-25 16:40:06 -06:00
Eric Wasylishen 989f0305ba bsputil: add checks for degenerate faces, unused planes/texinfo/verts,
clipnodes
2017-06-21 16:36:12 -06:00
Eric Wasylishen 13922a2b92 bsputil --check: add some stats on visleafs and vis clusters 2017-06-21 13:24:05 -06:00
Eric Wasylishen c1a9b01c44 bsputil: print BSP node heights for the first few levels of the tree
to check if it's decently balanced
2017-06-13 17:19:42 -06:00
Eric Wasylishen 8a4d1ff218 common: add 4x4 (from mesa) and 2x2 matrix inverse 2017-04-23 15:58:51 -06:00
Eric Wasylishen 880ad3b381 bpsutil, common, light, vis: bounds check bsp->dfaces access 2017-03-18 16:31:52 -06:00
Eric Wasylishen a6468984bf all: finish c++ification 2016-10-17 19:52:17 -06:00
Eric Wasylishen 299e68e7e5 build: support Ubuntu 14.04 2016-09-23 15:13:58 -06:00
Eric Wasylishen 9340ce223a build: clean up request for C++11. require cmake 3.1 (which introduced CMAKE_CXX_STANDARD) 2016-08-09 16:00:09 -06:00
Eric Wasylishen 939778bd23 build: add snprintf wrapper from QuakeSpasm (vs2013 compat) 2016-08-06 15:47:40 -07:00
Eric Wasylishen b087f0f010 build: specify c99 2016-04-18 14:22:33 -06:00
Eric Wasylishen 8773e0bb15 build: fix build error on Linux due to missing target_link_libraries(qbsp ) 2016-03-16 10:48:00 -06:00
Eric Wasylishen 99d5a4d4f9 build: setup CPack to package binaries in a zip file 2015-12-09 16:23:36 -08: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 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
Kevin Shanahan bdd2ac6127 bsputil: fix wad export from bsp with missing textures
We need to skip over the textures with missing data lumps in the BSP,
i.e. having data offset -1.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2014-02-21 09:21:35 +10: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 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 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 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 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 a9cfbbc3dc trivial: fix missing newline at end of usage output
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-04-24 14:26:21 +09:30
Kevin Shanahan 4a49552904 bsputil: add missing stdint.h include
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-04-22 12:51:33 +09:30
Kevin Shanahan 195f5869e2 bsputil: add --check option to check internal consistency
First pass, checks most of the data structures actually reference within
the valid ranges.  Will add more soon...

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-04-20 21:11:21 +09:30
Kevin Shanahan 264f613760 bsputil: pass bspdata_t into ExportWad
No longer require the bspfile globals.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-04-20 17:22:10 +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 7b36c6fd2f build: query git for version info and print consistently for each util
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-03-07 14:26:14 +10:30
Tyrann 2e4a4a917f [PATCH] bsputil: Attempt correct byte-swapping in bsp -> wad export
Untested, but this should be all that is required.

Signed-off-by: Tyrann <tyrann@disenchant.net>
2006-10-09 13:02:07 +09:30
Tyrann 6027e5aeb3 [PATCH] bsputil: Add texture extraction
Add the ability to extract texture information from a BSP file and write it
out as a WAD file. Not very robust in the face of errors or corrupt BSP files,
but it does the job for now.

Signed-off-by: Tyrann <tyrann@disenchant.net>
2006-10-03 08:53:05 +09:30
Tyrann 2c2f3c8eb6 Import initial sources 2006-08-28 23:58:10 +09:30