Commit graph

629 commits

Author SHA1 Message Date
Bill Currie
bd52e46adf Merge branch 'master' into win 2016-01-22 01:10:49 +09:00
Bill Currie
f163e35f21 Add a builtin to get keydown. 2016-01-10 13:33:05 +09:00
Bill Currie
9cb23ba67e Clean up some error messages.
The contractions took the emphasis off where it needed to be.
2016-01-04 16:12:36 +09:00
Bill Currie
aecea5c350 Document most of they key binding system. 2016-01-04 16:11:15 +09:00
Bill Currie
59f60d1ba7 Enable the Key_StringToKeynum builtin.
I don't know why I didn't do it earlier other than lack of need.
2016-01-04 16:10:22 +09:00
Bill Currie
7c16acf4aa Make Key_GetBinding take an imt instead of a name. 2016-01-04 16:06:48 +09:00
Bill Currie
331b054d4a Fix an inappropriate reuse of a variable.
Using "ax"is for the joystick "var"iable is a bit confusing.
2015-06-18 21:22:31 +09:00
Bill Currie
d1f1375df5 Increase number of supported joystick buttons.
Also fix a bug where despite supporting 32 buttons, only 18 were actually
supported, and a similar issue for the number of axes.

My saitek x52 has 34 buttons and 10 axes. Whee.
2014-08-17 11:35:40 +09:00
Bill Currie
f5501fbf24 Fix a pile of automake deprecation warnings.
s/INCLUDES/AM_CPPFLAGS/g

I <3 sed :)
2013-11-24 13:11:50 +09:00
Bill Currie
0f75bdce17 Set the default joystick preamp to 0.01.
At the request of johnnyonflame. I probably should have done this when I
removed the builtin 1/100 scaling from the joystick code.
2013-04-19 13:54:30 +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
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
Bill Currie
8de4db0e2d Fix some sizeof snafus.
I'd failed to notice these earlier.
2013-01-28 21:52:18 +09:00
Bill Currie
bc2fa38468 Provide support for axis names.
x/y/z and pitch/yaw/roll (or p/y/r). Johnny's numbers still work, too, of
course.
2013-01-28 21:09:21 +09:00
Bill Currie
9a24c99cf6 Remove the force 1/100 scaling.
That's part of amp's (or preamp's) job.
2013-01-28 19:37:48 +09:00
Bill Currie
5c08e97b0b Ensure the axis button's state starts at 0.
realloc doesn't do that for us.
2013-01-28 19:37:12 +09:00
Bill Currie
1811d00568 Use the correct index for pressing an axis button.
Oops.
2013-01-28 19:36:25 +09:00
Bill Currie
4163a3a8f2 Reduce the default deadzone to 500.
12500 seems a tad high when the range is +/- 32767.
2013-01-28 18:10:49 +09:00
Bill Currie
0ff66268e7 Redo the button axis setup to use key names.
Johnny's number->J_AXISn mapping is preserved, but I had intended for any
key to be supported (J_AXISn was just to ensure free keys were available).
This gives both methods (and some range checking on the axis button
number).
2013-01-28 18:06:30 +09:00
Bill Currie
42c2666036 Clear out some old cruft.
With the new joystic axis system, those cvars are no longer needed.
2013-01-28 18:06:06 +09:00
Bill Currie
475d90e96f Expose Key_StringToKeynum. 2013-01-28 16:34:29 +09:00
Bill Currie
2336b0bcc8 Do some more code split-up. 2013-01-28 16:02:33 +09:00
Bill Currie
3e27689ca8 Begin splitting the code into more easily digested chunks.
While MH's code certainly does the job, it's rather hard to follow with
functions doing different jobs on different calls.
2013-01-27 20:04:34 +09:00
Bill Currie
1740e14d2a Do a const-correctness run on palettes. 2013-01-27 19:57:40 +09:00
Bill Currie
173af3a992 Tweak the deadzone code to work better with pre-amp.
Everthing was fine with pre-amp == 1, but if it was anything else, the
offset would become invalid.
2013-01-27 14:30:13 +09:00
Bill Currie
f5e1983e0f Produce prettier floats in the output. 2013-01-27 14:09:48 +09:00
Bill Currie
dfbb68d573 Terminate the option arrays.
Before they terminate QF.
2013-01-27 14:08:01 +09:00
Bill Currie
1a33d2f682 Do a whitespace run.
Just for long-term sanity's sake.
2013-01-27 14:05:24 +09:00
Johnny on Flame
e3e0d6aaa9 Add menu commands + fixes 2013-01-27 13:17:13 +09:00
Johnny on Flame
ee436d89f6 More in-game console command documentation for in_joy 2013-01-27 13:17:13 +09:00
Johnny on Flame
86e7392e7a A few fixes + boundary checks 2013-01-27 13:17:12 +09:00
Johnny on Flame
637d751aa7 Saves axes behaviours on the config file. 2013-01-27 13:17:12 +09:00
Johnny on Flame
4f92bceb4f Joystick configuration commands. 2013-01-27 13:17:12 +09:00
Bill Currie
c56a075199 Get MH's vid_win.c mostly working for sw and sw32.
There are still a great many problems, but pixels get to the screen in the
right place (for windowed mode, anyway).
2013-01-27 12:53:58 +09:00
Bill Currie
a35f6cadf7 Use the cvar's int_val rather than coverting its value.
Let the cvar system to its job :)
2013-01-25 16:36:00 +09:00
Bill Currie
b3a7ed8a62 Use vid_win.c from engoo as a basis.
Thanks to leilei being a diehard sw quake fan, and MH being the hacker he
is, engoo's vid_win.c drops Scitech's MGL :) (I really did not want to
resurrect that). However, I've modified it so it /compiles/ in QF: ripped
out the menu code, ripped out the input handling (that's in in_win.c) and
started trying to get it to work for vid_render. The clients at least link,
but I'm certain they'll segfault (GPF?).
2013-01-24 21:11:33 +09:00
Bill Currie
d6766a07c5 Use a saner default video resolution.
320x200 is way too small these days.
2013-01-24 15:43:04 +09:00
Bill Currie
4d6fe3694d Add the missing function required for -win.
They're just stubs for now, but nq-win.exe and qw-client-win.exe build. I'm
99.999% certain they won't work, though :P
2013-01-24 12:36:14 +09:00
Bill Currie
d7e98dcd6d Build libvid_win.la.
Now libQFwin.la builds. Once I get nq-win and qw-client-win building, the
"fun" begins.
2013-01-24 12:36:14 +09:00
Bill Currie
bd537ac1b1 Fix vid_win.c compilation.
It will not work yet.
2013-01-24 12:36:14 +09:00
Bill Currie
b0ec63ac56 Remove a dead var.
vid_colormap died with the vid_render plugin birth.
2013-01-24 12:36:14 +09:00
Bill Currie
ae6dfd8cb6 Move the mouse activation/deactivation into in_win.c.
It now gets handled by the keydest callback (I hope it still works).
2013-01-24 12:36:14 +09:00
Bill Currie
40af4bb986 Make vid.width/height unsigned and clean up the mess. 2013-01-24 12:36:14 +09:00
Bill Currie
8153646eda Use a callback for in-game keystate detection.
Yay bitrot :P
2013-01-24 12:36:14 +09:00
Bill Currie
23bd3d99f8 Fix the two unsigned/signed comparison warnings.
Now just for the real error in in_win.c: key_dest.
2013-01-24 12:36:14 +09:00
Bill Currie
d14da7f34a Enable the "win" clients.
The win clients are the native windows (NOT sdl!! *twitch*). Things are
already looking on the up: only three errors in in_win.c. I'm not looking
forward to vid_win.c (ex vid_wgl.c), though.
2013-01-24 12:36:14 +09:00
Bill Currie
b2e92c2864 Rewrite joy_axis and JOY_Move for axis buttons.
First, this completely smashes joystick input: it will not work (though it
doesn't crash). This is because there is, as of yet, no means to configure
the system.

Each joystick axis has:
    - per-axis amplification (both pre and post).
    - per-axis offset (offset applied after pre-amp but before post amp)
    - selectable destination:
        - linear delta: position and angles (as before)
        - axis button: if the value crosses the threshold, the given key is
          pressed or released as appropriate.

The axis amplification still uses joy_amp and joy_pre_amp (and
in_amp/in_pre_amp), but now also has the per-axis settings.

The per-axis offset is most useful for axis buttons. For example, the xbox
360 controller triggers are analong but go "all the way to negative on 0
state". Offsetting the input keeps axis button thresholds simple.

Amplification and offset is applied before anything is done with the axis
value. The formula is:

    joy_amp * in_amp * axis-amp *
        (offset + value * joy_pre_amp * in_pre_amp * axis-pre_amp)

Axis button thresholds are very simple: if the sign of the value is the
same as the sign of the threshold and abs(value) >= abs(threshold), the
button is pressed. While multiple thresholds and keys can be placed on an
axis, only one can be pressed at a time. The threshold furthest from 0
wins.
2013-01-23 13:15:02 +09:00
Bill Currie
35edfae2a0 Add keys for joystick axis buttons.
The idea is to allow a joystick axis to be mapped to button presses. These
allow the buttons to be bound without consuming other possibly valid keys.
2013-01-23 13:15:02 +09:00
Bill Currie
e27d7cbd2d Handle alloca "correctly".
Use AC_FUNC_ALLOCA and the #ifdef mess suggested by the autoconf docs
(hidden in qfalloca.h).
2013-01-22 21:02:50 +09:00
Bill Currie
22ca96ea46 Put the key_dest default back to key_console.
For now, anyway. This is a quick emergency fix for qw-client crashing when
a key is pressed while the client is waiting at the console on startup.
2013-01-19 12:17:57 +09:00