Commit Graph

834 Commits

Author SHA1 Message Date
Kevin Shanahan a1e0f192c7 light: fix use of incorrect color for !nominlimit case
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-03-01 22:03:36 +10:30
Kevin Shanahan c458099ec7 light: implement the 4x4 oversampling option
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-03-01 17:26:44 +10:30
Kevin Shanahan 57a161afa2 light: place oversample points correctly around original
Looks like the original code biased these to one side, but the
oversampling will be more accurate if we evenly distribute the points
around the actual lightmap point.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-03-01 12:42:57 +10:30
Kevin Shanahan ad129c59da light: rename sunmangle variable as sunvec
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-03-01 11:58:50 +10:30
Kevin Shanahan f07007f8ad light: setup spotlight paramters once at load time
We were calculating these values for every light and for every surface,
which seems a little excessive... Also made the variable names a bit more
sensible - we had stored a direction vector, not the actual mangle values.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-03-01 11:50:57 +10:30
Kevin Shanahan 580b2912fb light: don't let negative lights on a new style count as a hit
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-03-01 10:58:11 +10:30
Kevin Shanahan a3ac989224 light: trivial VectorMA substituion
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-03-01 10:56:19 +10:30
Kevin Shanahan 8ce739fe3f light: remove bsp30 support and automatically generate .lit when needed
Check whether any of the entities have colored fields set and if so,
enable colored light output. Can still be overridden from the command line
if needed.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-03-01 10:07:53 +10:30
Kevin Shanahan 8f3d28c2ac light: implement delay 4 and 5 as in visbjp light
Implement the two extra light attenuation formulae that were added to
Benjt Jardrup's light util (http://user.tninet.se/~xir870k/readmevis.txt).

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-02-28 16:16:34 +10:30
Kevin Shanahan 725fffbd7a light: fix off-by-one error in MAX_LIGHTMAPS check
I guess this bug has been here a long time. This was preventing us from
using all four available lightmaps in most cases. Now fixed!

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-02-28 15:51:28 +10:30
Kevin Shanahan d8b7e08683 light: tidy up the FixMinlight function
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-02-28 14:31:33 +10:30
Kevin Shanahan 5c4e6d4f0b light: trivial, remove old comment
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-02-28 11:46:47 +10:30
Kevin Shanahan 70fceb5218 light: also pass colors into SingleLightFace
No more games with save/modify/restore on the entity->lightcolor.
Could have actually caused nasty races in the multithreaded case.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-02-28 10:44:05 +10:30
Kevin Shanahan e8764f5492 light: pass colors into SkyLightFace
Stop playing silly games with saving, modifying and restoring the global
sunlight_color. A couple of variable naming changes in lightface and use
an entity pointer instead of always indexing into the global array.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-02-28 10:32:30 +10:30
Kevin Shanahan 54a5890217 light: lift light entity field checks into separate function
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-02-27 21:13:53 +10:30
Kevin Shanahan 854c7b4bb9 light: trivial variable rename
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-02-27 21:13:12 +10:30
Kevin Shanahan 599742310b light: use an enum for light attenuation formulae
And warn if we are given a formula number we don't know about.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-02-27 17:13:53 +10:30
Kevin Shanahan 22ca3262f0 light: remove alloc argument to LightStyleForTargetname()
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-02-27 15:59:03 +10:30
Kevin Shanahan ea836f6b0b light: constify light's version of ValueForKey()
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-02-11 20:10:47 +10:30
Kevin Shanahan 8d4bbbe3dc light: use the common threads progress indicator
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-02-07 21:12:53 +10:30
Kevin Shanahan 3e20dae28e common: add start arg to RunThreadsOn to set initial progress
In case we are not starting work from 0, allow this to be set...

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-02-07 20:51:04 +10:30
Kevin Shanahan 853761d0d6 common: remove pacifier argument from RunThreadsOn
Set to true everywhere, just use it unconditionally.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-02-07 20:46:33 +10:30
Kevin Shanahan 7ee8bc183b light: use the common threads code
Make light use the common threads code.
The common progress indicator code is still not used.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-12-26 09:35:26 +10:30
Kevin Shanahan 1c8137d400 light: remove stale comment about MAXLIGHTMAPS
Yes, it really is 4.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-12-20 20:15:54 +10:30
Kevin Shanahan ef6c4c30c5 light: remove unused accounting variable
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-12-20 20:15:40 +10:30
Kevin Shanahan c51eb01291 light: remove workaround for old compiler bug
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-12-20 20:15:10 +10:30
Kevin Shanahan 6fab0a5358 light: make pthreads support work
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-12-20 20:14:39 +10:30
Tyrann ad964e7f28 trivial: remove some redundant assignments and unused variables 2012-01-06 21:34:47 +10:30
Tyrann bcb8e0990d [PATCH] light: increase MAX_TSTACK
Managed to hit this limitation recently, so bump it up.

Signed-off-by: Tyrann <tyrann@disenchant.net>
2008-01-19 21:21:20 +10:30
Tyrann 8a7304a54d [PATCH] TyrUtils v0.4
Quick release to fix the ongoing saga that is my crappy .lit coloured lighting
support. I really did test it this time...

I bumped the qbsp version as well, just to track the utils "package" version.

Signed-off-by: Tyrann <tyrann@disenchant.net>
2007-09-25 11:18:00 +09:30
Tyrann a97a880bd0 [PATCH] light: fix alignment (again) on lit data
I really should do more testing before I embarress myself by releasing stuff
so obviously broken. Use the right pointer to align lit_filebase against.

Signed-off-by: Tyrann <tyrann@disenchant.net>
2007-09-25 06:32:10 +09:30
Tyrann 20008a120a [PATCH] light: update version number
Signed-off-by: Tyrann <tyrann@disenchant.net>
2007-09-23 16:54:59 +09:30
Tyrann 9209eec0a1 [PATCH] light: Fix litfile memory allocation
Gah! Brown paper bag material here. Memory for the Lit data was never getting
allocated and writes were happening in no man's land off the end of the
lightdata area.

Signed-off-by: Tyrann <tyrann@disenchant.net>
2007-09-23 16:46:22 +09:30
Tyrann 2c2f3c8eb6 Import initial sources 2006-08-28 23:58:10 +09:30