Commit graph

151 commits

Author SHA1 Message Date
Kp 53761500f1 Qualify uses of std::array 2020-05-02 21:18:42 +00:00
Kp 5fa8c06914 Add experimental support for autosaves
Set autosave interval to 10 minutes, unless specified in the player's
configuration file.  Players can change the autosave to 0 minutes to
disable it.
2020-04-19 20:47:07 +00:00
Kp cc144647b5 Make kconfig.ui-table.cpp compile when freestanding
Special macros are used to pass information to
`generate-kconfig-udlr.py`.  Provide default definitions for these
macros in `kconfig.ui-table.cpp`, and override them in the one build
where they need to be special.  This enables `kconfig.ui-table.cpp` to
build cleanly when invoked from the command line in the compilation
database.
2019-12-22 05:34:08 +00:00
Kp f26d91bbe2 Change kconfig type/state fields to enums 2019-12-22 05:34:08 +00:00
Kp d2f2f98850 Use symbolic STATE_NONE for kconfig entries with no state bit 2019-12-22 05:34:08 +00:00
daivuk 74ef8b02e6 Added axis buttons
Each axis can act as two buttons in both ways.
For example, a player might map slide left and slide right to J1 -A1 and J1 +A1 as button presses instead of the slide L/R axis.

This is mostly to fix XBox 360 Controller Left and Right triggers. But it can work on every axis if the player wishes to bind them.
2019-09-01 13:11:14 -04:00
Kp d355ef4030 Pass font to various drawing functions 2018-05-19 23:21:42 +00:00
Kp 08446f0ab6 Pass font to gr_string,gr_printf 2018-05-19 23:21:42 +00:00
Kp 3796c46440 Improve default keybindings
Slide left/right: A/D
Slide up/down: C/X
Accelerate/reverse: W/S
Afterburner (D2 only): Left-Shift

This produces the more FPS-typical WASD layout for
forward/left/back/right movement, and maps the crouch/stand bindings to
slide up/down.  This ticket sat for longer than it should have (though
it never missed a release).  Several competing designs were suggested,
but only one could be made active.  After consideration, I used my own
bindings on the basis that, while some other bindings may be better,
every other configuration repurposed a classic weapons-fire key to
movement.  Returning players who get the "new defaults" on a newly
created pilot profile might be very surprised by having their fire keys
move.  Since these are only defaults, and can be rebound by the player
with a few minutes work, these defaults do not need to be perfect.  They
just need to be an improvement over original Descent.

Delete unexpand-cpp-kconfig-key.py.  It will likely never be needed, and
was added in the prior commit solely to have a file to recover if it
ever is needed.

Requested-by: Mako88 <https://github.com/dxx-rebirth/dxx-rebirth/issues/214>
2018-05-12 21:13:05 +00:00
Kp 1fd8c184fd Convert kconfig default keys to their CPP define equivalents 2018-05-12 21:13:05 +00:00
Kp e69e195a3a Remove useless static_cast<float> in kconfig
gcc-8 warns that static_cast<float>(float_var + 1) is useless.  Remove
the cast.

References: <https://github.com/dxx-rebirth/dxx-rebirth/issues/388>
2018-05-05 22:33:55 +00:00
Kp 2571081962 Rewrite UI table to use symbolic constants for positioning 2018-02-01 05:38:47 +00:00
Kp 22fe81666a Unify some control_info fields 2018-01-29 01:56:40 +00:00
Kp 66b0f6bf37 Compile out unused joystick entries
Presently, user profiles are not portable between a build with
max_axes_per_joystick=0 and one with max_axes_per_joystick!=0.
Attempting to do so causes some buttons to be assigned to the wrong
action.  Since the intended use case for max_axes_per_joystick=0 and
similar is to completely remove joystick support on a system that will
never use a joystick, this is acceptable for now.  A future overhaul to
improve storage of user kconfig settings may fix this.
2017-12-24 00:28:35 +00:00
Kp f73b783095 Generate kconfig udlr relations at build time 2017-12-24 00:28:35 +00:00
Kp 0106833538 Move kconfig ui tables to separate file 2017-12-24 00:28:35 +00:00
Kp 0a95ecc3a6 Mark changed values in kconfig UI 2017-12-15 04:47:30 +00:00
Kp 7311712399 Compile out joystick key settings when DXX_MAX_JOYSTICKS=0 2017-12-05 05:29:55 +00:00
Kp 35bd791d32 Remove obsolete kconfig TABLE_CREATION code
It generates code different from the current definitions, even when no
logical changes are present.  This code has not been used in at least 2
years, since commit bc7c469ab2 ("Use
array<> for more globals") changed the definitions of some variables
that this code regenerates, and this code still generates the old
definition.  Future changes will cause further deviation.
2017-12-05 05:29:55 +00:00
Kp d049f738c8 Convert various gr_set_current_canvas calls to reference form 2017-11-05 20:49:08 +00:00
Kp 49c0cdae2e Simplify calls to gr_set_default_canvas
Rather than use an inline wrapper and rely on the compiler optimizer to
redirect gr_set_current_canvas(nullptr) to gr_set_default_canvas,
rewrite all relevant calls directly in the source.

git grep -l 'gr_set_current_canvas' | xargs sed -i -e 's:gr_set_current_canvas(\s*NULL\|nullptr\s*);:gr_set_default_canvas();:'
2017-11-05 20:49:08 +00:00
Kp 170d0ac777 Pass canvas &to nm_draw_background 2017-04-08 16:48:20 +00:00
Kp d5ed019014 Add experimental MP-aware mouselook 2017-03-25 19:34:02 +00:00
Kp f1d65f6b46 Cache canvas in kconfig_mouse 2017-03-10 01:22:33 +00:00
Kp 10522fd1ff Cache canvas in kconfig_draw 2017-03-10 01:22:32 +00:00
Kp 98463f506e Pass canvas to kc_drawinput 2017-03-10 01:22:29 +00:00
Kp ed2cb63abb Pass canvas to kc_drawquestion 2017-03-10 01:22:29 +00:00
Kp 357099d81e Pass font to get_item_height 2017-03-10 01:22:29 +00:00
Kp 4dd4e49fd1 Pass canvas to kc_gr_2y_string 2017-03-10 01:22:29 +00:00
Kp 6f81d13c41 Pass canvas to gr_set_curfont 2017-02-11 21:42:38 +00:00
Kp ae33aaafc1 Pass canvas to gr_set_fontcolor 2017-02-11 21:42:32 +00:00
Kp 5da784dbed Pass canvas to gr_{,u}string 2017-01-08 22:32:00 +00:00
Kp 1ef6b9d5bc Pass font to gr_get_string_size 2017-01-08 22:31:59 +00:00
Kp 0480ba8030 Pass canvas to gr_string(int,int,const char*,int,int) 2017-01-08 22:31:59 +00:00
Kp 0905aefa0a Pass canvas to gr_rect 2017-01-01 00:45:45 +00:00
Kp 794dcce327 Pass canvas to gr_urect 2017-01-01 00:45:44 +00:00
Kp 10aa2e5106 Move some kconfig symbols into namespace dsx 2016-12-22 05:21:16 +00:00
Kp 0109355ae0 Switch kconfig_handler to D2 mouse button semantics
Presumably, D2 switched to EVENT_MOUSE_BUTTON_UP for a good reason.
Switch D1 to that rule too.
2016-12-22 05:21:16 +00:00
zico 8bd3eaad4c Fixed misleading indentations. 2016-10-31 11:36:48 +01:00
Kp 902e242194 Remove redundant store in kconfig_read_controls
Adjust the value as a local, then write it back when finished.
2016-10-28 03:39:40 +00:00
Kp a0d614e6b0 Use clamp_symmetric_value in kconfig_read_controls
Avoid open-coding the test.
2016-10-21 02:16:48 +00:00
Kp 01f2932824 Pass grs_canvas &to window_create 2016-10-15 00:53:20 +00:00
Kp e05603b0d7 Fold kconfig_draw gr_string label calls 2016-10-15 00:53:15 +00:00
Chris Taylor 60ac1eaad3 Replace delete dcx::window kludge with a better solution
Replace delete dcx::window kludge with a better solution: instead of requiring every handler to delete the window, add a window_event_result::deleted, which gets returned if the window was deleted by the handler, so window_close knows not to attempt to delete it again.
2016-10-04 14:05:44 +08:00
Chris Taylor 87617e8ac9 Allow dcx::window struct to be subclassed - step 3
Allow dcx::window struct to be subclassed step 3. This step adds the window destructor and both requires and implements the window to be deleted by the event handler/client in all cases.
2016-10-02 17:49:19 +08:00
Kp 4894117d70 Rename MAX_HATS_PER_JOYSTICK to DXX_MAX_HATS_PER_JOYSTICK
Rename symbol MAX_HATS_PER_JOYSTICK to DXX_MAX_HATS_PER_JOYSTICK
to show that it is a DXX symbol, not one inherited from a library.

git grep -lzw MAX_HATS_PER_JOYSTICK -- SConstruct '*.h' '*.cpp' | xargs -0 sed -i -e 's/\<MAX_HATS_PER_JOYSTICK\>/DXX_&/g'
2016-09-25 04:52:49 +00:00
Kp 94937de128 Rename MAX_BUTTONS_PER_JOYSTICK to DXX_MAX_BUTTONS_PER_JOYSTICK
Rename symbol MAX_BUTTONS_PER_JOYSTICK to DXX_MAX_BUTTONS_PER_JOYSTICK
to show that it is a DXX symbol, not one inherited from a library.

git grep -lzw MAX_BUTTONS_PER_JOYSTICK -- SConstruct '*.h' '*.cpp' | xargs -0 sed -i -e 's/\<MAX_BUTTONS_PER_JOYSTICK\>/DXX_&/g'
2016-09-25 04:52:49 +00:00
Kp 7d38a9f0be Rename MAX_AXES_PER_JOYSTICK to DXX_MAX_AXES_PER_JOYSTICK
Rename symbol MAX_AXES_PER_JOYSTICK to DXX_MAX_AXES_PER_JOYSTICK to show
that it is a DXX symbol, not one inherited from a library.

git grep -lzw MAX_AXES_PER_JOYSTICK -- SConstruct '*.h' '*.cpp' | xargs -0 sed -i -e 's/\<MAX_AXES_PER_JOYSTICK\>/DXX_&/g'
2016-09-25 04:52:49 +00:00
Kp f24e9f836c Rename MAX_JOYSTICKS to DXX_MAX_JOYSTICKS
Rename symbol MAX_JOYSTICKS to DXX_MAX_JOYSTICKS to show that it is a DXX
symbol, not one inherited from a library.

git grep -lzw MAX_JOYSTICKS -- SConstruct '*.h' '*.cpp' | xargs -0 sed -i -e 's/\<MAX_JOYSTICKS\>/DXX_&/g'
2016-09-25 04:52:48 +00:00
Kp 62b58e9890 Move OGL to dxxsconf.h; rename to DXX_USE_OGL
Rename symbol OGL to DXX_USE_OGL to show that it is a DXX
symbol, not one inherited from a library.  Move it to dxxsconf.h to
shorten the command line.

This is a mostly automated transform, but the changes to SConstruct were
manual.

git grep -lzw OGL -- '*.h' '*.cpp' | xargs -0 sed -i -e 's/\(\s*#\s*if\)def\s*OGL/\1 DXX_USE_OGL/' -e 's/\(\s*#\s*if\)ndef OGL/\1 !DXX_USE_OGL/' -e 's/\(\s*#\s*if !\?\)defined(OGL)/\1DXX_USE_OGL/'
2016-09-24 18:06:11 +00:00