Commit graph

187 commits

Author SHA1 Message Date
Anders Jenbo
edeca6574d Replace tagRECT with SDL_Rect 2020-02-01 15:43:51 +01:00
Anders Jenbo
40ba1e7a6f Merge branch 'master' of github.com:diasurgical/devilution 2020-02-01 14:48:39 +01:00
Anders Jenbo
08aa6a860a Move generic helpers out of miniwin 2020-02-01 13:56:08 +01:00
Anders Jenbo
baf2d14440 Remove unused parts of miniwin 2020-01-31 01:20:10 +01:00
Gleb Mazovetskiy
ce5c1007a2 Controller improvements: START modifier and hints
1. Makes START a modifier key.
2. Main modifier actions are now displayed as hints while the modifier is pressed.
3. Mouse simulation now available on all controllers:
   SELECT + D-Pad to move mouse
   SELECT + Left/Right should button to click

 START +    | Action
 ---------- | ------
 SELECT     | Menu
 UP         | Menu
 DOWN       | Map
 LEFT       | Character info
 RIGHT      | Inventory
 B (Bottom) | Spell book
 Y (Left)   | Quest log

This makes all actions available on controllers without sticks and ZL/ZR.
2020-01-25 16:37:50 +01:00
qndel
6214779459 DrawZoom cleanup 2020-01-19 14:26:43 +01:00
Anders Jenbo
c3f283429b Fix high CPU load when game is minimized 2019-12-31 04:15:38 +01:00
Anders Jenbo
da03bae69d Merge branch 'master' of github.com:diasurgical/devilution 2019-12-25 20:38:25 +01:00
Anders Jenbo
0c90ad0527 Set bool values TRUE/FALSE 2019-12-22 23:57:10 +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
9a704ff2f0 Merge branch 'master' of github.com:diasurgical/devilution 2019-12-19 01:05:01 +01:00
Anders Jenbo
5fa0c5781b Backport cleanups from Hellfire branch 2019-12-15 06:14:57 +01:00
Anders Jenbo
0c75636db3 [controller] Automatically apply heal-other, resurect and disarm 2019-11-20 10:49:16 +01:00
Anders Jenbo
9e37eddfd0 Uncap FPS counter 2019-11-12 18:14:57 +01:00
Anders Jenbo
af0a7c0653 Apply SPANEL_WIDTH 2019-11-10 22:35:17 +01:00
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