Commit graph

7956 commits

Author SHA1 Message Date
Bill Currie
16c8b2a18d Use the new demo imt.
There are some problems with menus and the console messing up the key_dest
state (they assume console/menu or game, nothing else), but otherwise
things seem to work.
2011-12-10 15:18:50 +09:00
Bill Currie
3ae17e4d37 Fix a silly omission.
Must not check for IMT_MOD bindings when using IMT_CONSOLE etc.
2011-12-10 14:49:56 +09:00
Bill Currie
81a16c925b Add IMT_DEMO for demo playback bindings.
This will allow special key bindings for use during demo playback without
interfering with normal keys.
2011-12-10 14:21:12 +09:00
Bill Currie
14d8e8669f Rework the legacy bind/unbind commands.
in_bind_imt is now gone. I guess mercury was right in that it was a poor
design. However, it was (and still is necessary) to support "bind" and
"unbind". Now, instead, they work only with the IMT_MOD table. IMT_MOD sits
below IMT_0 in the imt hierarchy. If the key is not bound in IMT_0+, then
IMT_MOD will be checked. This way, "bind" and "unbind" can never mess with
a user's more sophisticated binding setup.
2011-12-10 13:56:02 +09:00
Bill Currie
49451eea80 Use the new menu/console bingings.
Now, the console toggle will always work (so long as the console is
toggleable in the first place).
2011-12-10 13:24:32 +09:00
Bill Currie
d9d56760e1 Add cvars to control the keys for menus and console.
The backquote is not always usable for toggling the console, and the new
bind system doesn't automatically bind a key to both game and console imts
(by design). Thus create a cvar that allows the "always works" console
toggle to be specified in eg $fs_globalcfg. While I'm at it, do one for the
menus, too.
2011-12-10 13:24:32 +09:00
Jeff Teunissen
4f4d6b5675 OK, now import them...
Duh.
2011-12-09 22:42:43 -05:00
Jeff Teunissen
361255cf31 Ruamoko: New math constants, some new math functions
Also, switch all of the math builtins functions we use from Rua to the
ones that accept and return floats, avoiding conversions to/from double.
2011-12-09 22:36:41 -05:00
Bill Currie
054e52528e Revive the loading plaque.
At the request of scar3crow.
2011-12-09 18:41:52 +09:00
Bill Currie
8516891329 Edit the package version when building a release. 2011-12-09 11:27:46 +09:00
Bill Currie
2edac1a438 Nuke a sprintf. 2011-12-08 22:16:59 +09:00
Bill Currie
693d51859e Ignore the test programs. 2011-12-08 22:10:20 +09:00
Bill Currie
1c82956dd7 net_udp.c FIONREAD fix from Ozkan Sezer.
net_udp.c: Fixed FIONREAD ioctl to take an int* argument instead of an
unsigned long*.
2011-12-08 21:50:55 +09:00
Bill Currie
9e3db08fdd Update NEWS 2011-12-08 20:10:29 +09:00
Bill Currie
b4a387897b Expand the tabs. 2011-12-08 17:30:44 +09:00
Bill Currie
8aa5a8139c Split out the portal sanity tests.
With this, the portal code can be tested separately, including the freeing
of the portal information.
2011-12-08 14:59:35 +09:00
Bill Currie
f9877ce0e0 Add a function to free a hull's portal information. 2011-12-08 14:58:08 +09:00
Bill Currie
d3cf5c4b75 Beg for mmap access.
If the default sound device does not support mmap access, retry with
plughw. However, assume the user knows best and do not retry if snd_device
has been set to anything, including "default".

QF alsa support now works out of the box with pulseaudio.
2011-12-08 11:32:33 +09:00
Bill Currie
45288a1a7f Fix the ghastly sound quality.
Due to quake's original sound engine using a push model, the actual place
to which the sound data should be written is not necessarily where the
"hardware" dma cursor is, but rather where the last write finished off.
Thus, the correct output location is indicated by snd_paintedtime rather
than snd_shm->framepos.
2011-12-08 11:02:19 +09:00
Bill Currie
fceed07d0b Tidy up my diagrams. 2011-12-08 08:45:53 +09:00
Bill Currie
9f32004599 Add a fixme.
I've had enough of this for the moment, but I'm pretty sure the test needs
some more consideration, and I'll probably forget about it if I don't mark
it.
2011-12-07 17:27:13 +09:00
Bill Currie
2a27db146e Use a bit of epsilon in trace_contents().
All tests pass again.
2011-12-07 15:35:19 +09:00
Bill Currie
66dffef936 Get trace_to_leaf working a little better.
I think the recursion decision needs a little more work, but this gets the
current tests working (though there's still a failure due to fp math).
2011-12-07 15:31:33 +09:00
Bill Currie
ccbc69a7f5 Carve out some more cave and add some more tests.
One of them even breaks the code :)
2011-12-07 13:31:21 +09:00
Bill Currie
4ed8b69e24 Check the cross product length before testing its direction.
This fixes the bogus portal crossings.
2011-12-07 12:20:04 +09:00
Bill Currie
5af88d33fe Trace to the current portal rather than the portal's plane. 2011-12-07 12:17:51 +09:00
Bill Currie
9d2914474c Fix the edge vectors when bounding the portal points. 2011-12-07 12:16:58 +09:00
Bill Currie
6a4021517b Move the box face info into trace_state and init only once.
Then clean up the mess of excess function paramenters.
2011-12-07 10:54:37 +09:00
Bill Currie
fc14826cd6 Reorganize the code a little. 2011-12-07 10:42:39 +09:00
Bill Currie
4f13d19b7e Optimize edges_intersect().
I found wolfram's line-line intersection page and noticed their equation
for the time of intersection was rather different to mine. After analyzing
the differences, it turns out they produce exactly the same results (when
the lines are coplanar), but their method allows me to eliminate one dot
product (4->3). Not only that, but it turns out that their method works
equally well for skew lines (ie, non-coplanar).

mine:
  CxA.CxA
  -------
  CxA.AxB

theirs:
  CxA.AxB
  -------
  AxB.AxB
2011-12-07 10:35:58 +09:00
Bill Currie
ff693a956a Avoid missed portals in trace_to_leaf(). 2011-12-06 22:09:40 +09:00
Bill Currie
8c840a7003 Sanitize trace_hits_plane().
While unit normals aren't needed, they were too big for sane math. Now
epsilon can be used for the distance tests. One of the two new tests passes
now :).
2011-12-06 22:06:25 +09:00
Bill Currie
2b65f81b72 Use a saner "infinity".
8e6 is just too big for reasonable floating point.
This fixes the bogus portals.
2011-12-06 20:50:09 +09:00
Bill Currie
632817fed5 Fail properly when the portals are bogus. 2011-12-06 20:48:31 +09:00
Bill Currie
f496f4d260 Whee, more tests that break things :) 2011-12-06 20:47:57 +09:00
Bill Currie
8fe703d747 Trace to adjoining leafs when necessary.
When the trace stradles a plane in the current leaf, check the other side
of the portal, too, as it is possible that leaf will restrict the movement
of the trace.

All current tests pass! However, I can think of some situations (and I
already have a solution) where things will fail, but that's next.
2011-12-06 17:27:05 +09:00
Bill Currie
4c17ca9583 Break out trace_hits_portal() from trace_enters_leaf(). 2011-12-06 08:46:04 +09:00
Bill Currie
9a9079a2b3 Correct the start-solid in a corner test.
It turns out that the box trace CAN get out of the solid from that location
(though a similar point trace can not). This is because of my decision to
allow non-points to touch a plane from either side without crossing the
plane, whereas a point touching a plane is always considered to be on the
front side of the plane as there is no further information to disambiguate
on which side of the plane the point is.
2011-12-05 22:11:58 +09:00
Bill Currie
4419d4c4ad Move the trace into the leaf before testing the contents.
The trace is moved as far into the leaf as possible without leaving the
other side of the leaf. This ensures that trace_contents is started from a
good location. There is currently a problem with traces that stradle a
plane getting, but this has cleared up all the current contents related
tests.
2011-12-05 22:11:58 +09:00
Bill Currie
c588d28b96 Clear contents flags before calling trace_contents. 2011-12-05 22:11:58 +09:00
Bill Currie
8307d9f233 Rename check_in_leaf to trace_enters_leaf. 2011-12-05 22:11:58 +09:00
Bill Currie
3bd029d599 Make the contents flags clear.
I got tired of not being able to remember which flag was which in the
output.
2011-12-05 22:11:47 +09:00
Bill Currie
8e512a087c More failing contents tests.
However, I have a plan :)
2011-12-05 09:03:04 +09:00
Bill Currie
b4a497baab Correctly restore the saved start point.
This fixes the point test failures.
2011-12-04 21:12:12 +09:00
Bill Currie
7da6df9dfb Use the "real" contents of the trace's location when visiting a leaf.
When visiting a leaf in box mode, use trace_contents() to get the highest
priority contents of any leafs touched by the box in the current location.
I'm now down to one failing test case, and it's an "allsolid" issue that
might be an incorrect assumption in my test case.
2011-12-04 19:14:35 +09:00
Bill Currie
053d801e92 Break out the leaf visit code into its own funciton. 2011-12-04 18:52:17 +09:00
Bill Currie
4e76aa3025 Don't split on a plane parallel to the motion.
This seems to improve the start/all solid cases a little, and it should
speed things up a little by avoiding unnecessary polygon tests.
2011-12-04 12:46:22 +09:00
Bill Currie
ed8e09608a Fix the negative fractions coming from edge_portal_dist().
I have a better fix in the works, but I wanted edge_portal_dist() to be
correct.
2011-12-04 12:11:27 +09:00
Bill Currie
e5903a60ff Put the mistaken test case back in. 2011-12-04 11:00:38 +09:00
Bill Currie
eb5d2720e4 Avoid a segfault when there's no split plane. 2011-12-04 10:55:46 +09:00