Commit Graph

9588 Commits

Author SHA1 Message Date
Bill Currie dbdfdb6d28 Add support for PRT2 portal files.
These seem to be identical to PRT1-AM but with a different count order in
the header. Taken from tyrutils-0.5.
2013-03-07 18:51:32 +09:00
Bill Currie 0649fd7022 Correct some verbosity levels. 2013-03-07 18:51:23 +09:00
Bill Currie 4e87072d93 Fix a bunch of whitespace. 2013-03-07 14:31:00 +09:00
Bill Currie 4ccb4a4667 Make the test and vis set pointers const. 2013-03-07 14:28:15 +09:00
Bill Currie 281c5f185d Correct the "can see anything new" check.
I had the super-set and sub-set parameters backwards, but that's because I
had misinterpreted the old code.
2013-03-07 14:24:30 +09:00
Bill Currie cb025838aa Fix a silly error in QF/alloc.h's FREE.
FREE was effectively a nop :P This fixes the crazy memory leak in qfvis.
2013-03-07 14:11:51 +09:00
Bill Currie 81e4d3072c Plug a bunch of memory leaks.
Not that they really matter, but it makes reading valgrind's output a
little easier.
2013-03-07 13:42:19 +09:00
Bill Currie 9b4beaf3f8 Use a set for portalsee.
This removes the hard coding of the size of portalsee, which looks to have
been too small for some maps.
2013-03-07 11:35:08 +09:00
Bill Currie 299ff8f575 Use set functions for qfvis.
While noticeably slower than the previous expanded set manipulation code,
this is much easier to read. I can worry about optimizing the set code when
I get qfvis behaving better.
2013-03-07 11:06:55 +09:00
Bill Currie eb2828e11c Add a function to pre-allocate space for a large set.
When the maximum set size is large but constant, and members will be added
one at a time, growing the set dynamically is not very efficient.
2013-03-07 10:27:30 +09:00
Bill Currie 5950803462 Implement the sun lighting calculations.
The sun(s) won't work right now because the vectors aren't properly set up.
2013-03-07 09:11:23 +09:00
Bill Currie 4d4bcaf3a3 Make the Test functions const-correct. 2013-03-07 09:11:23 +09:00
Bill Currie 0e82b37001 Parse the sun information from the worldspawn entity. 2013-03-07 09:11:23 +09:00
Bill Currie f1a18742f1 Cache the worldspawn entity.
It is an error (for now) if there is not exactly one worldspawn entity.
2013-03-07 09:11:23 +09:00
Bill Currie 4f0a1df3c1 Implement sky tracing.
Again, this is from Jardrup's light tool. Sun data is not yet parsed, nor
are any sun lighting calculations done.
2013-03-07 09:11:23 +09:00
Bill Currie 7cd1894a6d Add the solid-sky option from Jardrup's light tool.
However, actual sky tracing is not yet implemented.
2013-03-07 09:11:23 +09:00
Bill Currie 32127d3ec7 Kill a sprintf.
While 16 chars is enough for any 32-bit int, if int ever changes to 64
bit... (need 21). Just avoid the issue with good old va :)
2013-03-07 09:11:23 +09:00
Bill Currie d2909cd4dd Clear the padding in the light data buffers.
Getting uninitialized memory in calloced space was interesting :P
2013-03-07 09:11:23 +09:00
Bill Currie 7c1d9d2b84 Make the angle and light hacks optional.
I'd forgotten that ED_ConvertToPlist mangled light into light_lev and
single component angle values into a vector. This fixes much of the
breakage in qflight (but not the light levels)
2013-03-07 09:11:23 +09:00
Bill Currie 26baa75a1b Remove a stray break.
Now qflight mostly works (its results are bogus, but at least it no longer
crashes or errors out)
2013-03-07 09:11:22 +09:00
Bill Currie 5fc8d1eb26 Split out the surface offset code.
This tidies up LightWorld a little.
2013-03-07 09:11:22 +09:00
Bill Currie 48809404b1 Use qfplist for light entities.
This removes a lot of redundant code from qflight (though it does become
dependent of libQFgamecode *shrug*). The nice thing is qflight now uses the
exact same code to load entities as does the server.
2013-03-07 09:11:22 +09:00
Bill Currie 675db274a6 Use Sys_Error instead of PR_Error in ED_ConvertToPlist.
ED_ConvertToPlist is now independent of the progs engine as its only use
for the progs_t * param was for PR_Error.
2013-03-07 09:11:22 +09:00
Bill Currie 7d2e938d37 Correct some error messages.
ED_ParseEntity has been ED_ConvertToPlist for a long time now.
2013-03-07 09:11:22 +09:00
Bill Currie 9e6477fdf0 Remove the leading _ from entity fields for properties.
Dealing with the _ in the properties code is a bit messy, and having to use
it in the properties list file is a pain.
2013-03-07 09:11:22 +09:00
Bill Currie 5fbe50a5e2 Remove some dead code. 2013-03-07 09:11:22 +09:00
Bill Currie b01986c3c5 Correct some white space. 2013-03-07 09:11:22 +09:00
Bill Currie c9b1c445a8 Move the properties docs into properties.h 2013-03-07 09:11:22 +09:00
Bill Currie 5720392f37 Begin documenting qflight. 2013-03-07 09:11:22 +09:00
Bill Currie cc92466725 Correct the calculation of halflife lighting.
The RBG values were taken from the wrong components of the array
(out-by-one).
2013-03-07 09:11:22 +09:00
Bill Currie b025e7ba9a Make sure all source files in qflight have (C) headers. 2013-03-07 09:11:22 +09:00
Bill Currie 4d0a08a052 Cope with 0 sized textures.
The most likely cause is missing texture data. Found while working on the
uv_layers bug for Hectate.
2013-03-04 11:04:47 +09:00
Bill Currie a6bc5e9d29 Use the correct method for finding the active uv layer.
Problem found by Hectate in #qc (thank you!).
2013-03-04 10:50:42 +09:00
Bill Currie 9992a08285 Make the timedemo related timers double.
Their being float didn't cause noticeable trouble when time was 0-based,
but with it 4Gs based, timedemo results got very weird.
2013-02-27 14:32:29 +09:00
Bill Currie 8e86ce9de9 Implement Sys_LongTime and wrap it with Sys_DoubleTime.
Sys_LongTime returns time in microseconds as a 64-bit int. Sys_DoubleTime
uses Sys_LongTime, converts to double and offsets 0 time by 4G (2**32).
This gives us consistent sub-microsecond precision for a very long time.

See http://randomascii.wordpress.com/2012/02/13/dont-store-that-in-a-float/
2013-02-27 14:29:28 +09:00
Bill Currie 32b76b3576 Do not try to create directories that already exist.
It seem that solaris will return EACCESS instead of EEXIST if the user
doesn't have write permission in the parent directory.
2013-02-20 14:03:03 +09:00
Bill Currie a611ad57de Add Sys_isdir. 2013-02-20 13:59:31 +09:00
Bill Currie ad7834631c Clean out some dead code and vars from the registered checks.
The data needed for the checks has been gone from QF for a very long time
(since Jan 2000), and good riddance to it, really: I suspect it's in
violation of id's copyright on the game data (ok, it might be fair use, but
still...).
2013-02-19 13:39:09 +09:00
Bill Currie 6d7f747577 Add timerefresh to the glsl renderer.
Also, tweak the formatting of the output for the other renderers (%g
instead of %f) and make gl's timerefresh output unconditional.
2013-02-18 13:57:45 +09:00
Bill Currie f6966f89ec Add DL_LIBS to the -x11 targets.
Something is funny with Ubuntu such that -ldl needs to be specifically
added even though QFutil's .la specifies it. I don't know if it's a libtool
issue or not, but this does work.

More will probably be necessary, but this was sufficient to get prover to
the point where qfcc segged building qwaq (0.7.2).
2013-02-14 09:54:36 +09:00
Bill Currie 7137783e47 Disable svga support for now.
It is suffering some bitrot and I don't feel like fixing it right now, but
it causes problems for people trying to build QF. This should be ok because
it's one of those "if uncertain, say no" things.
2013-02-14 09:37:25 +09:00
Bill Currie 4e7e7c3ab0 Rename Sys_FileTime to Sys_FileExists.
The function never did anything but check the readability of the file.
2013-02-07 15:43:26 +09:00
Bill Currie 9047c3e4ad Fix the invalid keydest errors.
Once and for all: remove the default and move the Sys_Error outside the
switch (changing appropriate breaks to returns). Now gcc will let me know
when I forget to update the switch statements.
2013-02-02 15:22:09 +09:00
Bill Currie bc12567572 Clean out a leftover from the 128 dlight change.
I'd missed a set of bit->lightnum conversions that resulting in lightnum
becoming much greater than 128 and thus trashing memory when the surface
was marked.
2013-01-31 22:39:23 +09:00
Bill Currie 6edf8133aa Handle hipnotic demos when checking for .dem.
hipdemo1.dem has a single leading space. They probably did "%2d" for the
track number, as there is no space before the minus sign in the other
hipnotic demos.
2013-01-31 17:03:59 +09:00
Bill Currie 0cc90a75e3 Fix a snafu in do_precache.
It seems I copied the code from precache_sound, but forgot to change
MAX_SOUNDS to max.
2013-01-31 17:03:49 +09:00
Bill Currie 9d418379bf Use the correct type when allocating flow node edges.
sizeof (struct) vs sizeof (struct *). Ouch.
2013-01-30 18:08:59 +09:00
Bill Currie 6a3c775270 Correct the emission of meta class ivars.
type_obj_class is no longer a class, so its ivars are not stored in
type_obj_class.t.class->ivars but rather type_obj_class.t.symtab.

This fixes the segfault Spirit and Randy were experiencing.

In passing, correct the unneeded emission of meta class ivars for non-root
classes. This should make for much smaller progs that use classes.
2013-01-30 18:06:48 +09:00
Bill Currie 831f84a47b Add my vkb config script.
It's a bit ugly, but it does nicely demonstrate what can be done with QF's
input system.
2013-01-29 16:40:46 +09:00
Bill Currie 37dfad8e04 Add a command to simulate typing.
It doesn't support backspace or enter yet, but it got the job done for now.
2013-01-29 14:44:33 +09:00