Commit graph

172 commits

Author SHA1 Message Date
Anders Jenbo
34a6615fed Only show level up icon when there is space for it
Thanks to @de4me for pointing this out and figuring out the height
2019-11-10 22:25:54 +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
Anders Jenbo
e590e6995a Implement recharge and fix cursor for repair 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
Anders Jenbo
215ff59e65 Merge branch 'master' of github.com:diasurgical/devilution 2019-11-01 00:06:53 +01:00
galaxyhaxz
67fedd9e99 Fix unknown struct field and drawpanflag 2019-10-31 22:57:15 +01:00
Anders Jenbo
5a65eec646 Merge branch 'master' of github.com:diasurgical/devilution 2019-10-28 04:31:30 +01:00
Anders Jenbo
048429b4cd Apply more constants 2019-10-28 04:29:39 +01:00
Anders Jenbo
8976e4fd39 Check if panels conver the screen before affecting the viewport 2019-10-28 03:31:26 +01:00
Anders Jenbo
d46ae517d0 Merge remote-tracking branch 'refs/remotes/devilution/master' 2019-10-28 03:14:06 +01:00
Anders Jenbo
71adfe509e Document more attributes 2019-10-28 03:05:40 +01:00
Anders Jenbo
9146e3ea35 Enable FPS meter for releases 2019-10-28 02:01:43 +01:00
Anders Jenbo
4e8a8d2157 Merge remote-tracking branch 'refs/remotes/devilution/master' 2019-10-26 13:43:28 +02:00
Anders Jenbo
92ab05ea13 Decompose more magic numbers 2019-10-26 00:24:55 +02:00
qndel
8ca4f545df
fix english (#389) 2019-10-24 14:22:48 +02:00
Anders Jenbo
5b95289440 Render FPS count using ingame font 2019-10-22 21:07:08 +02:00
Anders Jenbo
0e578ffb11 Enable assertions 2019-10-22 19:04:55 +02:00
Anders Jenbo
933262d701 Remove support for partial cel decoding
Since we no longer make use of this it should result in a small speed up
2019-10-22 01:31:14 +02:00
galaxyhaxz
8570d3bdfe Fix function order [dx.cpp] 2019-10-21 20:08:23 +02:00
Anders Jenbo
86bf1fe0d5 Correct spelling 2019-10-21 19:54:32 +02:00
Anders Jenbo
2348c3a8fd Documentations, enums and clean ups 2019-10-21 19:33:14 +02:00
Anders Jenbo
d354bd9767 Lock framerate at vsync instead of 20fps
Since most animations are still controlled by the game logic the only
real benefit is smoother mouse and scrolling text, but it's a start :)
2019-10-20 15:59:47 +02:00
Anders Jenbo
7d1b0f24f7 Eliminate overdraw in cell functions 2019-10-20 15:59:47 +02:00
Anders Jenbo
991f26f2c6 Deduplicate scrollrt.cpp 2019-10-20 15:59:47 +02:00
Anders Jenbo
3fe2d08940 Deduplicate monster drawing 2019-10-20 15:59:47 +02:00
Anders Jenbo
dfbce7b2ce Deduplicate drawing players 2019-10-20 15:59:47 +02:00
Anders Jenbo
305484156e Deduplicate drawign items, remove pBuff from scrollrt_draw_e_flag() 2019-10-20 15:59:47 +02:00
Anders Jenbo
8f916e4d1f Merge town_draw_town_all() with scrollrt_draw_dungeon() 2019-10-20 15:59:47 +02:00
Anders Jenbo
40fa2f6596 Merge east-flag functions 2019-10-20 15:59:47 +02:00
Anders Jenbo
16820106bc Merge town_draw() with scrollrt_draw()
This require calling DRLG_InitTrans() during CreateTown() to clear out
the transparancy flags after having been to the duntion. Else the
mausoleum will be transparent.
2019-10-20 15:59:47 +02:00
Anders Jenbo
f8c16a1dcb Only use safe blitting and set gpBufEnd to the correct relative values
This again allows us to only selectivly render the UI panel
This also eliminates the need for the BORDER_BOTTOM 10k memory saved!
2019-10-20 15:59:47 +02:00
Anders Jenbo
2079b67475 Drop dpiece_defs_map_1 memory access optimization
This also gets rid of IsometricCoord. They where used to map tiles in a
way that had a simpler access pattern when rendering the screen in
visual oriented rows.
See
https://github.com/diasurgical/devilution/pull/544#issuecomment-450968761
2019-10-20 15:59:47 +02:00
Anders Jenbo
bfe0a54f4a Merge T_DrawView and T_DrawGame with there scrollrt variants 2019-10-20 15:59:47 +02:00
Anders Jenbo
7ab68036f2 Remove extra flag and double call to draw function 2019-10-20 15:59:47 +02:00
Anders Jenbo
c4a7df80a7 Use CelDraw function for rendering instead of CelBlit
This leaves just town_special, scrollrt arches and left side of
two-handed weapons to be using direct blitting functions.
2019-10-20 15:59:47 +02:00
Anders Jenbo
337bc9b125 Render text in screen cordinates instead of buffer offsets 2019-10-20 15:59:47 +02:00
Anders Jenbo
ad7a621e5f Drop PitchTbl to avoid resolution restriction 2019-10-20 15:59:47 +02:00
Anders Jenbo
e695c0d9ea Combine zoomed and standard view 2019-10-20 15:59:47 +02:00
Anders Jenbo
d4e3b573d0 Allow for adjustable resolutions
The render is still only stable when height is a multiple of 32 and
width is a multiple of 64. 832x480 gives you close to 16:9 with the
original height.
2019-10-20 15:59:47 +02:00
Anders Jenbo
9e1b161bc0 Unify upper and lower screen rendering 2019-10-20 15:59:47 +02:00
Anders Jenbo
8ed4515727 Strip clipping from town and scroll 2019-10-20 15:59:47 +02:00
Anders Jenbo
11e8df8f6c Deduplicate missile rendering code 2019-10-20 15:59:47 +02:00
Anders Jenbo
a0baa92ef0 Merge branch 'master' of github.com:diasurgical/devilution 2019-10-13 19:59:26 +02:00
Anders Jenbo
feeae23076 Prevent infinit recursion in UiOkDialog 2019-10-13 14:48:28 +02:00
Anders Jenbo
6597688eac Rename cell functions 2019-10-13 13:31:56 +02:00
Anders Jenbo
02416d3fc7 Merge branch 'master' of github.com:diasurgical/devilution 2019-10-12 18:15:34 +02:00
galaxyhaxz
3c7a08a336
Fix function order [scrollrt.cpp] (#1800) 2019-10-12 06:27:58 -05:00
Anders Jenbo
d840f388c7 Merge branch 'master' of github.com:diasurgical/devilution 2019-10-08 22:05:10 +02:00
arczi84
1ab2fb2666 Endian madness 2019-10-08 02:28:03 +02:00
Anders Jenbo
ba9288c6cf Unify error dialogs, for looks and portability
- Use UiOkDialog() to display all error messages
- Add SDL simple message, and console fallbacks to UiOkDialog()
- Boot graphics early on to facilitate most error messages with build in
gui
- Some more miniwin clean ups
2019-10-06 01:27:11 +02:00