Commit graph

41 commits

Author SHA1 Message Date
Andrei Alexeyev
7548e4892d
gamepad: direction snapping; more flexible configuration options
- The free/restricted axis distinction is gone; the joystick always
  operates in "free" mode.
- Added direction snapping functionality to help aid exact movement in
  cardinal and/or diagonal directions. The snapping angle can be
  adjusted from 0% (disabled) to 100% (similar to the old "restricted"
  mode). The snapping angle can also be biased towards cardinals or
  diagonals.
- When the maximum zone is less than or equals dead zone, moving
  the character will always move at maximum speed (as in the old
  "restricted" mode).
- Most of these settings are now visualized in the options menu and can
  be tested there.
2024-05-27 19:23:59 +02:00
Andrei Alexeyev
8b37d1cbf2
src: the great #include massacre of 2024 2024-05-17 14:11:48 +02:00
Andrei Alexeyev
be7905d6a3
src: run upkeep 2024-05-17 04:58:47 +02:00
Andrei Alexeyev
b57445900f
gamepad: overhaul analog stick handling
* Use correctly scaled radial deadzones instead of naive per-axis
  deadzones
* Option to adjust the "maximum zone" (upper deadzone)
* Option to remap square input into circular. Unfortunately there's no
  nice way to detect which type the controller reports. We assume
  circular by default.
* A more sensible sensitivity setting
* Use a larger minimum deadzone when emulating key presses (e.g. in
  menus)
* Adjusted key repeat to be less aggressive
2023-07-12 00:13:19 +02:00
Andrei Alexeyev
a2aa88cb62
gamepad: add gamepad_initialized() 2023-06-20 01:13:50 +02:00
Andrei Alexeyev
4661c9609c
gamepad: support extra buttons 2022-01-08 18:22:44 +02:00
Andrei Alexeyev
8d2ee76710
replace include guards with #pragma once 2021-08-31 23:34:46 +03:00
Andrei Alexeyev
80b1026d08
Don't redefine standard complex macro; use a new cmplx typedef
This also introduces `float32`, `float64`, and `real` typedefs to be
used in place of `float` and `double` later. `real` is for game code and
other places where we don't particularly care about the precision and
format of the underlying type, and is currently defined to `double`.
`float32` and `float64` should replace `float` and `double` respectively
2019-11-22 05:38:48 +02:00
Andrei Alexeyev
383234efe7
random cleanup 2019-11-08 20:53:43 +02:00
Andrei Alexeyev
5a23fb95fc
make upkeep script preserve existing copyrights 2019-08-03 20:44:22 +03:00
Samuel P
469d6e2f48 Switch homebrew port (#173)
* Initial port

* Switch specific video modes

* Handle clean exit

* Hide option to disable gamepads, force it enabled

* Match buttons layout with Switch controllers

* Hide player name setting (to avoid getting stuck)

* Switch specific VFS setup instead of env bootstrap

* Clean up, get rid of warnings and a few ifdefs

* Add Switch specific build script and assets

* Make vfs setup mount packages

* Re-enable packaging on Switch

* Transpile shaders to es and install them

* Add applet warning and shader deps to README

* Remove script; instead using meson build scripts

* Strict prototypes

* Build script compat with project minimum meson ver

Refactor of pack.py exclude option

* Uniformise header inclusion on arch_switch.c

* Allow input for any dev; hide the option on Switch

* Silence unsused function warnings
2019-08-02 21:38:33 +03:00
Andrei Alexeyev
3055901998
update my email 2019-07-03 21:00:56 +03:00
Andrei Alexeyev
b3a0128be6
gamepad: support hotplug, any-device option 2019-04-19 14:28:32 +03:00
Andrei Alexeyev
4159ea1249
'upkeep' target for maintenance tasks; back to include guards; happy new year! 2019-01-23 22:10:43 +02:00
Andrei Alexeyev
59cf8f6300
Rendering system rewrite, tons of refactoring, optimizations, and other cool stuff (#116) 2018-04-12 17:08:48 +03:00
Andrei Alexeyev
b48248ef7a
gamepad: support input repeat for analog sticks as well as buttons 2018-01-18 11:13:25 +02:00
Andrei Alexeyev
d6cec62519
gamepad: attempt to improve analog input, especially restricted mode 2018-01-14 05:16:29 +02:00
Andrei Alexeyev
513d613387
Consistent indentation: indent with tabs, align with spaces (#104)
I would've preferred to just go with 4-spaces for indent and no tabs,
but lao is a bit conservative about it. :^)

Still, this is a ton better than mixing different styles all over the
place, especially within the same file.
2018-01-12 20:26:07 +02:00
Andrei Alexeyev
485c9a8ed6
Happy New Year! 2018-01-04 19:14:31 +02:00
Andrei Alexeyev
e6697306f9
fix build for SDL 2.0.5 2017-12-30 17:50:09 +02:00
Andrei Alexeyev
5b7de7d8a2
gamepad: basic support for trigger buttons (analog and digital) 2017-12-30 17:39:42 +02:00
Andrei Alexeyev
29acd5f58a meson: intel intrinsics, various improvements 2017-12-21 03:58:54 +01:00
makise-homura
2b35177cb4 Removed excess and added missing newlines at end of files 2017-10-10 21:10:35 +03:00
laochailan
03a2426012
update to use #pragma once 2017-09-27 14:14:53 +02:00
Andrei "Akari" Alexeyev
d9611b0831
player input, gamepad, and replay improvements
may break existing replays
2017-09-20 00:32:58 +03:00
Andrei "Akari" Alexeyev
dce663c5ed
fix qualified void return 2017-09-16 09:44:39 +03:00
Andrei "Akari" Alexeyev
7c9e54a71d
update copyright and credits 2017-09-12 04:28:15 +03:00
Andrei "Akari" Alexeyev
644757a65a
gamepad settings improvements
GUIDs are now used to identify devices. this allows reliable persistent
configuration on multi-gamepad systems.

changed the way the device listing in the options menu works. it's
inactive when the gamepad system is disabled, and dynamically updated
when it's enabled. as a result, the "bare" init state is now finally
gone. this should work with minimal or no changes when the hotplugging
events are properly handled.

the "enable gamepad support" toggle is now effective immediately. the
gamepad system is no longer restarted every time the user leaves the
gamepad menu, unless they have changed the device.
2017-08-28 14:56:43 +03:00
Andrei "Akari" Alexeyev
57a138c1d1
improved gamepad support using SDL GameController API
still WIP, but it's better than it was

todo (maybe):
    - handle hotplugging
    - enable gamepad support by default
    - treat analog triggers as buttons
    - better way of saving which device to use to the config, the index
    is virtually useless
2017-07-15 06:22:56 +03:00
Andrei "Akari" Alexeyev
22314f9582 converted SIGN into a function 2017-03-06 17:32:51 +02:00
Andrei "Akari" Alexeyev
671f3b8d3a gamepad options menu improvements 2017-02-28 00:58:47 +02:00
Andrei "Akari" Alexeyev
32f7edd24e Refactored config into a macro hell 2017-02-17 18:03:49 +02:00
Andrei "Akari" Alexeyev
9a7a874783 Use the standard bool type instead of that stupid enum
Also removed all of the annoying trailing tabs/whitespaces
2017-02-11 05:56:47 +02:00
Andrei "Akari" Alexeyev
71f57bab93 Improved handling of gamepad axis input and sensitivity 2017-02-04 15:41:15 +02:00
Andrei "Akari" Alexeyev
167e9e12f1 Initial migration to SDL2 (WIP) 2017-02-04 04:56:40 +02:00
Andrew "Akari" Alexeyew
536b5b7f09 "Fixed" a stupid input workaround. It doesn't depend on keyboard anymore. 2012-08-17 21:58:23 +03:00
Andrew "Akari" Alexeyew
3058c971f9 Some gamepad options. TODO: controls 2012-08-17 00:35:48 +03:00
Andrew "Akari" Alexeyew
4754e6c76e Optional free axis mode 2012-08-15 17:36:39 +03:00
Andrew "Akari" Alexeyew
d8ceb05757 better axis handling + more options 2012-08-15 15:33:32 +03:00
Andrew "Akari" Alexeyew
b4c8e82815 year fail 2012-08-15 03:48:19 +03:00
Andrew "Akari" Alexeyew
30befb3960 basic gamepad/joystick support 2012-08-15 03:41:21 +03:00