Commit Graph
66 Commits
Author SHA1 Message Date
Anders Jenbo 8726e80199 Make controller enums C++03 compatible 2020-05-19 17:19:50 +02:00
Anders Jenbo dc8be6c0ab C++03 compatibility (#736)
* Use C++03 compatible constructors
* Remove conflicting definitions
2020-05-17 01:37:19 +02:00
Anders Jenbo 0da3461d35 Use explicit types instead of auto 2020-05-14 11:44:15 +02:00
Gleb Mazovetskiy 6e449b9411 Allow re-mapping keyboard keys
Adds a `REMAP_KEYBOARD_KEYS` CMake option.
This remapping applies wherever Game or Menu controls apply.

Uses it to map the Power button to the menu on RG350.
2020-05-02 18:13:10 +02:00
Anders Jenbo 3c5982083f Merge branch 'master' of github.com:diasurgical/devilution 2020-04-06 12:05:13 +02:00
Anders Jenbo 25993b4043 Merge branch 'master' of github.com:diasurgical/devilution 2020-02-14 23:03:31 +01:00
Anders Jenbo 118e3668b4 Remove unused code 2020-02-01 16:45:07 +01:00
Anders Jenbo 08aa6a860a Move generic helpers out of miniwin 2020-02-01 13:56:08 +01:00
Anders Jenbo 67c58583d8 Implement fullscreen toggeling via alt+enter 2020-02-01 13:55:21 +01:00
Anders Jenbo cc4d6b57d8 Remove unused miniwin IO 2020-01-31 22:30:13 +01:00
Anders Jenbo baf2d14440 Remove unused parts of miniwin 2020-01-31 01:20:10 +01:00
Anders Jenbo 534ed2d3ff Make shift+0-9 behave as on US keyboards
Fixes #532
2020-01-04 17:02:09 +01:00
Anders Jenbo d04e0e44bb Implement scroll wheel navigation
up/down/left/right = arrow keys
ctrl+up/down = zoom automap in/out
2019-12-31 06:29:02 +01:00
Anders Jenbo 150f7e805d Update debug code 2019-12-27 09:24:53 +01:00
Anders Jenbo f2133b6e2b Fix exiting movie
- Replaying the intro would translate the exter and then interupt the
movie immediately.
- It was not possible to exit the application while a movie was playing.
2019-12-26 01:40:47 +01:00
Anders Jenbo eb0f899c90 [controller] Hot spells via mod+A/B/X/Y, quest log/spellbook via mod+L2/R2 2019-12-24 04:34:57 +01:00
Anders Jenbo 50ca153f24 [controller] Fix switching focuse between inv and char 2019-12-23 00:42:36 +01:00
Anders Jenbo 7273e6a32d Fix mouse clicks not registering on 0x* and *x0
Fixes #507
2019-12-22 19:35:45 +01:00
Anders Jenbo 4610b50d1e [controller] Handle edge cases for cursor state 2019-12-21 21:11:35 +01:00
Anders Jenbo 9d4bb70913 [controller] Only close inventory if cursor is clean 2019-12-18 23:07:42 +01:00
Anders Jenbo 046064fcfe Fix PostMessageA an remove more unused event code 2019-12-04 01:37:04 +01:00
Anders Jenbo e847108b78 Clean up event handeling 2019-12-03 01:59:13 +01:00
Anders Jenbo f9d4073620 Detect when gamepads are added or removed 2019-12-03 01:59:13 +01:00
Anders Jenbo 1d500497da Ignore clicks ouside game
Fixes #91
2019-11-30 13:10:51 +01:00
rsn8887 c1237b53dd Correctly handle window size and docking/undocking on Switch 2019-11-24 15:22:59 +01:00
rsn8887 dd569bf8e0 Implement touch controls 2019-11-23 20:06:43 +01:00
Anders Jenbo d94b245497 [controlls] Prioritize spell targets
Spells will now target either the apropriate highlighted actor or the
current direction.
2019-11-20 10:49:16 +01:00
Gleb Mazovetskiy 2acb87c743 SDL1: Set video mode flags and BPP via CMake 2019-11-17 23:45:55 +01:00
Gleb Mazovetskiy 24f7b080a5 Work around RG350 joystick mode kernel bug 2019-11-17 23:45:04 +01:00
Anders Jenbo 448c01a969 Make all movies escapable using ESC
Fixes #175
2019-11-17 01:55:51 +01:00
Anders Jenbo bc88560b41 Disable rendering when minimized
This recovers the original use of gbActive
2019-11-17 01:55:07 +01:00
Anders Jenbo d50485b119 Silence some SDL events that we do not use 2019-11-13 23:32:36 +01:00
Gleb Mazovetskiy efd9056b2b PeekMessageA: Fix false_avail for some events 2019-11-13 01:28:53 +01:00
Anders Jenbo 54bbb4b29a Better fake event handeling 2019-11-12 23:24:04 +01:00
Anders Jenbo c5bca03e5a Fix redrawing panel on unminimizing 2019-11-12 20:26:34 +01:00
Anders Jenbo 0092aa66f0 [ctlr] Fix closing inventory via quickbook 2019-11-07 20:09:31 +01:00
Gleb Mazovetskiy ddce870dda Handle scaling for SDL1 (#370)
Only some handheld devices support auto-scaling.
On desktop and some handhelds we need to downscale manually.

Hardware auto-scaler check for jz4760 provided by @jbanes and @scooterpsu
2019-11-07 00:54:55 +01:00
Anders Jenbo 1571769478 Fix controller focuse when opening char 2019-11-06 19:49:21 +01:00
Anders Jenbo dbc91ae036 Correct mouse interactions for game controller 2019-11-06 02:13:07 +01:00
Anders Jenbo c86cec3c5f Prioritize controller navigation
Only do one type of navigation at any one time.
Priority: Inventry, Stats, Spells, Walk.
2019-11-06 02:13:07 +01:00
Anders Jenbo 45844b71ae Make controls more responsive
- Fix double events
- Fix ignored events
- Allow moving diagonal in the inventory
- Fix mouse wobbling in inventory when scalling
- Make controler actions cursor independants
- Make sure secoundery and primery key doesn't fire each others events
- Highlight both primary and secondary target
- Automatic switch between controller and keyboard+mouse
- Allow the user to change facing direction when blocked
- Make code event based instead of relying on time outs
2019-11-06 02:13:07 +01:00
Gleb Mazovetskiy b949b77d53 Drop held item when closing inventory
Previously the item was just destroyed instead
2019-11-06 02:13:07 +01:00
Gleb Mazovetskiy 7c4284fc4c Controls: Map top button to use inv item 2019-11-06 02:13:07 +01:00
Gleb Mazovetskiy b7d53bb5f8 Controller support: README docs 2019-11-06 02:13:07 +01:00
Gleb Mazovetskiy 882e9f0fbf Game controller: Fix spell selection 2019-11-06 02:13:07 +01:00
Gleb Mazovetskiy 113ef2e283 Fix item flickering 2019-11-06 02:13:07 +01:00
Gleb Mazovetskiy 6f3cc2a440 SDL1 fixes 2019-11-06 02:13:07 +01:00
Gleb Mazovetskiy 93203fa445 Controller: implement spellcasting 2019-11-06 02:13:07 +01:00
Gleb Mazovetskiy a2e821d241 Game controller support
Initial game controller support.

Actions are based on the Switch branch but the controller code itself is
implemented differently, allowing for easy remapping and minimizing
changes to the Source/ directory.

Many subtle and not so subtle controller bugs have been fixed
in this implementation, including:

1. Smoother & more responsive movement with the joysticks.
2. Consistent controls for all the menus in the game (stores, quest log,
etc).
3. Cursor appearance / disappearance at appropriate times.

Low-level controls are abstracted and 3 SDL interfaces are supported:
game controller, joystick, and keyboard. See SourceX/controls/ for more
details on this.

Wishlist for the future:

1. Primary button and use button should attack continously.
   This is hard as it requires checking the cooldowns / attack speed.
2. Quick spell menu navigation is very buggy. It is also buggy in the
   switch branch. I haven't had a change to investigate.
2019-11-06 02:13:07 +01:00
Gleb Mazovetskiy aa816b43e2 GetAsyncKeyState: Implement more keys 2019-10-16 11:39:27 +02:00