90 Commits
Author SHA1 Message Date
Gleb Mazovetskiy 5bf0b8bc96 Add more missing <cstdint> includes
https://github.com/diasurgical/devilutionX/pull/6095 only added includes
for `uint32_t`, this PR also adds the includes for the remaining
integral types.
2023-05-10 16:29:27 +01:00
staphen fa0147cfa5 Handle window focus events when svid movie is playing 2023-04-26 13:25:09 +02:00
Gleb Mazovetskiy 1788d2f8ec Remove miniwin
Event handling code moved to `engine/events.{hpp,cpp}`.
2023-02-01 16:06:57 +00:00
Gleb Mazovetskiy b48d4b2900 Remove uses of blank.wav
blank.wav is a 22 KiB 1-second silence that is not needed with
our sound engine.
2023-01-21 14:09:02 +00:00
Gleb Mazovetskiy 624589b3ec Fix cursor glitch after playing an in-game movie
Clears backbuffer state after a movie has been played.
2022-12-17 11:08:55 +00:00
staphen b66b6c611b Produce multiple controller button events for SDL_JOYHATMOTION events 2022-12-05 05:05:07 +01:00
Gleb Mazovetskiy 680ab5ec40 Overhaul backbuffer state handling
When rendering directly to the output buffer, we need to maintain the
state of what has been drawn and what needs redrawing per-buffer.

We previously tried to do it implicitly by checking `SDL_DOUBLEBUF` and
other flags. The previous implementation was broken in several
ways, resulting in rendering issues on devices that support 8-bit output
directly.

Changes this mechanism to explicitly maintain buffer state per output
buffer. The new mechanism doesn't require knowledge of the number of
buffers, and thus also works correctly with triple-buffering.

Fixes #5447
2022-11-01 02:43:24 +00:00
staphen 0f74370a99 Move gamepad logic from FetchMessage() to GameEventHandler() 2022-10-17 01:01:21 +02:00
Gleb Mazovetskiy ba34bafb3f Use SDL events directly
Removes redundant miniwin events and queue, using SDL events directly instead.

Demo migrated using this script: https://gist.github.com/glebm/8a73b04f695de96f344cc2e35151e03e
2022-08-03 03:50:19 +02:00
Gleb Mazovetskiy a4ac41cece Replace DVL_VK virtual key codes with SDLK 2022-07-17 10:00:06 +01:00
Gleb Mazovetskiy f9f6949af2 Clean up effects_play_sound, gfnSoundFunction 2022-07-16 10:59:40 +01:00
Anders Jenbo 3ae834148a Split event handeling from general miniwin features 2022-07-10 21:13:39 +02:00
Anders Jenbo 2d21fc372e Remove more miniwin code 2022-07-10 21:13:39 +02:00
Anders Jenbo 99181fd709 Move more files to the engine folder 2022-06-24 11:08:15 +02:00
Gleb Mazovetskiy 79c7eee10a Mouse/Gamepad fixes
Introduces a `ControlDevice` global which is distinct from `ControlMode`
in that it is set to `Gamepad` even when simulating a mouse.

This allows us to avoid a number of edge cases related to mode changes.

Fixes #4242
2022-04-03 23:06:36 +01:00
Anders Jenbo b0252b3339 Make Gamepad cursor independant of hardware mouse
The gamepad cursor (inventory, spells etc) no longer relies on warping a
real mouse cursor. This should make things work better on platforms that
do not support this, like Wayland.
2022-01-02 11:37:38 +01:00
ephphatha 1abc617e1a Consistently trigger menu/movie transitions on mouse up instead of down
Keypresses still occur on keydown to allow for repetition (e.g. when scrolling)
2021-12-28 04:34:26 +01:00
Siddharth singh chouhan ba161f623e Move documentation from implementations to declarations. (#2858) 2021-09-13 15:45:38 +02:00
Anders Jenbo 7cb73a6717 Minimize impact of NOSOUND 2021-08-30 10:57:59 +02:00
obligaron 77f9bded9e Introduce demo namespace 2021-08-19 00:03:58 +02:00
Gleb Mazovetskiy 502b2684c9 🐞 Disable hardware cursor during video playback
Fixes #2448
2021-08-03 19:31:23 +02:00
Anders Jenbo eda4a5061e Implement demo recording and playback
This records all keyboard and mouse events to a file and lets you play
it back at a later point with a differen game speed.
2021-07-31 20:12:31 +02:00
Anders Jenbo 74b57558c9 🚚 Move local code to anonymous namespace 2021-07-10 17:30:15 -07:00
Anders Jenbo bc0d1f7ac0 clang-tidy/Android Stuidio cleanups 3 2021-07-04 16:09:32 -07:00
Anders Jenbo a7c7fa0030 Fully apply clang-tidy/format to all files 2021-07-03 16:41:43 -07:00
Anders Jenbo ecea12fc15 Clang-tidy: ParameterCase 2021-07-03 15:46:39 -07:00
Anders Jenbo 8e07ef8fe5 Clang-tidy: misc-unused-parameters 2021-06-27 17:34:32 +02:00
Juliano Leal Goncalves fd9f2099d0 ♻️ Leverage 'Point' to represent mouse position 2021-06-27 16:37:59 +02:00
Anders Jenbo f167bd4dfb Clang-tidy: llvm-include-order 2021-06-27 01:45:49 +02:00
Gleb MazovetskiyandVictor Luchits f9d20b44d6 🎉 Hardware cursor (SDL2-only)
Disabled by default because of these known issues:

1. When clicking on inventory item, it briefly appears a bit shifted (in the wrong coordinates).

   This issue can happen with software cursor as well, but is a lot more
   obvious with the hardware cursor.

2. Cursor is scaled with nearest-neighbour scaling, which may look a bit different from
   how the rest of the graphics are scaled.

See also previous attempt: https://github.com/diasurgical/devilutionX/pull/955 by @viciious

Co-authored-by: Victor Luchits <[email protected]>
2021-06-19 01:03:40 +02:00
Gleb Mazovetskiy c770ae676f 🎉 Stream videos on Linux and FreeBSD
Previously, we always loaded entire videos in memory before playing them.

`libsmacker` does not provide a streaming API but it does provide a
`FILE *` file pointer API.

We now take advantage of the `FILE *` API by streaming the videos on
platforms that support `fopencookie`.

This means faster startup and less memory usage on these platforms.
2021-05-02 00:23:05 +02:00
Anders Jenbo 3b04f67194 🔥 Remove a chunk of miniwin types 2021-04-29 23:04:56 +02:00
Gleb Mazovetskiy 57172e48ed 🔨 ⚙️ CMake: Add NOSOUND option
This option completely disables all audio handling, including audio
loading code and dependencies.

Dialog text length is estimated to be somewhere between
Cain and Griswold speed.
2021-04-29 19:43:45 +02:00
Anders Jenbo a32ac83090 🎨 cleanup trivial trype comparisons 2021-04-23 02:48:25 +02:00
Gleb Mazovetskiy 362f24e9a7 🚚 Move SVid code to its own file 2021-04-19 11:53:44 +02:00
Anders Jenbo 8c821e98d3 🚚 Restructure files 2021-04-16 03:57:22 +02:00
Anders Jenbo 997c1dba55 🚚 Split up all.h in to proper header relations 2021-04-16 01:04:54 +02:00
Anders Jenbo 6e1a106a38 🚚 Move header we implement into the project 2021-04-16 01:04:54 +02:00
Anders Jenbo 67a7ff98c5 🚨 Clean up compiler warnings 2021-04-16 01:04:54 +02:00
Anders Jenbo 20186e0370 🎨 Replace TRUE/FALSE with true/false
fix


Fix


fix
2021-04-09 15:13:02 +02:00
Anders Jenbo 93d42b62b8 ♻️ Change BOOL to bool 2021-04-09 15:13:02 +02:00
Anders Jenbo bfb3c11c2b 🎨 Change namespace to devilution 2021-04-06 15:21:25 +02:00
Anders Jenbo 630e507f63 🚚 Apply namespace 2021-04-06 15:21:25 +02:00
Anders Jenbo 12658a0b3d 🐛 Fix console output on Windows and SDL1 targets
Fixes #921
2021-03-12 15:31:09 +01:00
Anders Jenbo 72e2637061 Merge branch 'master' of github.com:diasurgical/devilution 2020-10-25 17:38:06 +01:00
Gleb Mazovetskiy ec329e645c Fix all "no-write-strings" warnings 2020-10-25 15:37:51 +01:00
Anders Jenbo 893efd51ea Merge branch 'master' of github.com:diasurgical/devilution 2020-09-27 03:34:42 +02:00
Anders Jenbo 31ac716c3d 99 lines of documentation (#2058) 2020-07-07 19:36:18 +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 d008af43b0 Semantic code style cleanups 2020-04-11 15:22:40 +02:00