Commit Graph

720 Commits

Author SHA1 Message Date
Eric Wasylishen 2cd885729a light: MatchTargets: disable copying 'style' key/value to the targeting entity. Don't see any reason why that would be done. 2015-03-27 00:33:32 -06:00
Eric Wasylishen f57070b1e0 Add .gitignore 2015-03-27 00:33:14 -06:00
Eric Wasylishen 024b188744 Revert "light manual: Fix typo (_mincolor -> _minlight_color)"
This reverts commit 275800ca23.
2015-02-24 22:35:39 -07:00
Eric Wasylishen 1d05f97769 Makefile: support building in a path containing spaces 2015-02-22 20:35:57 -07: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
Eric Wasylishen c51326e8b0 trace.c: Undo part of cc36d8e that flipped the signs of ON_EPSILON for one of the checks in the TraceLine.
This fixes cracks in sunlight shadows spotted by Lunaran, and greatly improves the AO quality
2015-02-05 11:36:59 -07:00
Eric Wasylishen 11678eaa74 trace.c: fix bug in determining hitpoint->point 2015-02-05 11:35:15 -07:00
Eric Wasylishen 275800ca23 light manual: Fix typo (_mincolor -> _minlight_color) 2015-02-05 11:34:31 -07:00
Eric Wasylishen 24c6b9524a _color support: support values in the range 0-1 by automatically scaling them to 0-255 2015-02-05 11:33:21 -07: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
Eric Wasylishen 4df394f9fe light: Increase precision of lightmap extents calculations
This bug is a counterpart to this bug in quakespasm:
   https://sourceforge.net/p/quakespasm/patches/15/

If the precision of the calculation in WorldToTexCoord done by ‘light’
is significantly different than the precision of the same calculation
in the engine, you can get corrupted lightmaps. The problem affects
light when it’s built as something other than vanilla 32-bit
x86. (e.g. x86_64 on a mac).

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2014-06-30 12:58:30 +09: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 191bc63267 build: bump the fallback version number in Makefile
Should add this to the release checklist, haven't done it in a while!

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2014-02-21 12:00:32 +10:30
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 063880eeda TyrUtils v0.15
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2014-02-16 20:44:07 +10:30
Kevin Shanahan 2726819a54 doc: catch up some changelog entries
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2014-02-16 20:43:49 +10:30
Kevin Shanahan d68748d1d8 light: fix minlight clamping for coloured lights
Colours need to be scaled correctly by the light intensity.
Thanks to Mechtech for reporting this issue.

Reported-by: Paul R <automan1001@yahoo.com>
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2014-02-15 18:56:44 +10: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 f6a3700301 TyrUtils v0.14
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-10-03 11:10:45 +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 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