Commit Graph
47 Commits
Author SHA1 Message Date
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
Gleb Mazovetskiy df8d7a1f46 Compatibility with SDL v2.0.3
RG350 and GCW0 devices have an ancient version of SDL2.
2019-10-15 01:56:09 +02:00
Anders Jenbo 0929cdd9ac Ignore SDL_KEYMAPCHANGED event 2019-10-12 23:29:39 +02:00
Anders Jenbo b35a886846 Limit verbose info level debug to _DEBUG mode 2019-10-08 23:52:57 +02:00
Anders Jenbo fb01349343 Ignore uninteresting SDL events 2019-10-08 23:14:03 +02:00
Anders Jenbo 5eacf0ed8e Implement GetAsyncKeyState (enables two debug features)
- When started with -^ you can scroll the screen by holding shift and
moving the mouse.
- Holding menu will disable transparency.
2019-10-08 23:05:37 +02:00
Gleb Mazovetskiy 4f6c5791a7 Fix some compiler warnings 2019-09-27 08:54:49 +02:00
Anders Jenbo 18532e7c9b Format SourceX and SourceS
Fixes #262
2019-09-26 01:28:27 +02:00
Gleb Mazovetskiy 85295838a4 An option to use SDL1 instead of SDL2
Adds a USE_SDL1 build option to use SDL v1 instead of v2.

This is useful for porting Diablo on devices that don't support SDL2,
such as the RetroFW / OpenDingux devices (e.g. RG300 Retro Gaming Handheld)

Not yet supported:
* Fullscreen
* Upscaling
* Audio
2019-09-23 01:42:05 +02:00
Robin Eklind deb187be9b miniwin: remove comment for unused SDL key-codes
Should we later notice that there are more keys
not being translated, we can refer back to this
commit for the remaining SDL key-codes.
2019-07-11 00:54:36 +02:00
Robin Eklind 929be99acf miniwin: fix keycode translation of SDLK_MENU 2019-07-11 00:54:36 +02:00
Robin Eklind 2e9f835205 miniwin: map additional keycodes
Prior to this commit, several keyboard keys would
not be translated, as detailed by the following
debug message:

	DUMMY: translate_sdl_key : unknown key: name== sym=0x3D scan=46 mod=0x0

With this commit, all keys on regular US keyboards
should be translated correctly.
2019-07-11 00:54:36 +02:00
Pyr0Byt3 0e2a44dbab fix automap zoom 2019-07-09 10:26:31 +02:00
lkk7 70a64c7de0 small typos 2019-07-01 22:04:50 +02:00
Anders Jenbo 3f9691bf2c Enable building with MSVC 2017 (#75) 2019-04-06 15:08:20 +02:00
Xadhoom f00e427ed2 Remove pch.h 2019-03-17 18:28:37 +00:00
Xadhoom 8f30698c75 Reorganize miniwin headers, part 1 2019-03-14 19:50:58 +00:00