Commit graph

46 commits

Author SHA1 Message Date
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
Gleb Mazovetskiy
076b0c0c05 Overhaul tests
1. Adds a `libdevilution_so` target when tests are enabled.
2. Each test file is now a separate binary target linked against `libdevilutionx_so` (can now run tests in parallel).
3. Tests are now defined in a separate `test/CMakeLists.txt` file.
4. Building the tests is now controlled by the standard `BUILD_TESTING` option (defined by CTest).
5. Tests are now built by default.
6. On CI, test errors are now reported.

Also:

* `.clang-format`: Enable SortIncludes in tests
* `path_test.cpp`: Fix -Wsign-compare
2021-12-16 20:26:51 +00:00
Juliano Leal Goncalves
01823e1324 ♻️ Replace 'cursmx' and 'cursmy' globals with single 'cursPosition' 2021-08-30 06:45:51 +02:00
Juliano Leal Goncalves
05d206720a ♻️ Replace 'icursW' and 'icursH' globals with single 'icursSize' 2021-08-30 06:45:51 +02:00
Juliano Leal Goncalves
317ebcdd3e ♻️ Replace 'icursW28' and 'icursH28' globals with single 'icursSize28' 2021-08-30 06:45:51 +02:00
Juliano Leal Goncalves
a469f7906e ♻️ Replace 'cursW' and 'cursH' globals with single 'cursSize' 2021-08-30 06:45:51 +02:00
Gleb Mazovetskiy
cb0dae8590 🚚 Rename CelOutputBuf to Surface and extract 2021-07-03 05:33:32 -07:00
Anders Jenbo
0f2ad469ea ♻️Clean up variable initialization 2021-06-27 14:58:51 -07:00
Anders Jenbo
e7f0ce2764 Apply cleanups to codec, control, and some of cursor 2021-06-27 07:47:15 -07:00
Gleb Mazovetskiy
e40b1963f9 🚚 engine.h: Extract CelSprite and file loading 2021-06-21 01:36:20 -07:00
Juliano Leal Goncalves
a983792880 ♻️ Replace 'pair<int, int>' with 'Size' in 'GetItemSizeOnSlot' and 'GetInvItemSize' 2021-06-20 18:27:45 -07:00
Gleb Mazovetskiy
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 <vluchits@gmail.com>
2021-06-19 01:03:40 +02:00
Gleb Mazovetskiy
34b4ed759a 🐞 Clean up and fix inventory sprite handling 2021-05-02 04:01:03 +02:00
Gleb Mazovetskiy
1b8b62a8c2 ♻️ Store CEL width with the sprite itself
Instead of passing the CEL sprite width when drawing, store the CEL
width at load time in the new `CelSprite` struct.

Implemented for most sprites except towners, missiles, or monsters.
2021-05-01 20:51:55 +02:00
Jmgr
c33182d6de Modernize deprecated headers 2021-04-25 02:50:31 +02:00
Anders Jenbo
c89bd9c001 🚨 Fix remaning warnings for clang and gcc 2021-04-19 02:44:39 +02:00
Anders Jenbo
5fdb9ce459 🎨 Format code 2021-04-19 00:37:33 +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
e7ae8ddd04 🚚 Move all enums to there respective headers 2021-04-10 16:30:00 +02:00
Anders Jenbo
61244c4d93 ♻️ Rearange and apply more enums 2021-04-10 05:24:01 +02:00
Anders Jenbo
433edc63ea ♻️ Consistently use pragma once to guard the headers 2021-04-06 15:21:25 +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
d20eddf48e Unifcy a chunk of Hellfire's code pathts 2020-12-28 01:11:25 +01:00
Anders Jenbo
4794c8357c Merge branch 'master' of github.com:diasurgical/devilution 2020-11-02 03:59:47 +01:00
Anders Jenbo
2baa93ccde Clean up cursor.h 2020-11-02 02:44:06 +01:00
Anders Jenbo
2d6c1efeab Merge branch 'master' of github.com:diasurgical/devilution 2020-10-12 10:46:28 +02:00
Joel Falcou
c4223d4c29 Per file basis use of extern C 2020-04-22 13:15:29 +02:00
Joel Falcou
64d26a7934 Sanitize use of namespace
Wrap individual headers in dvl namespace to prevent
including standard header in another namespace.
2020-04-22 13:15:29 +02:00
Anders Jenbo
c384711a5f Backport cleanups from hellfire branch 2020-04-08 20:16:32 +02:00
Anders Jenbo
b040c04a18 Merge branch 'master' of github.com:diasurgical/devilution into hellfire 2020-04-04 07:56:06 +02:00
Anders Jenbo
f7e2283702 Reorder globals 2020-03-12 04:33:58 +01:00
Anders Jenbo
3c276a3cd3 Add documentation
- Add file documentation to about 1/4 of the files in Source
- Copy over a lot of the documentation from the sanctuary/notes repo
- Standardise all the existing documentation
- Create a configuration for Doxygen
- Add more documentation (engine.cpp is now fully documented)
2020-03-01 22:18:00 +01:00
galaxyhaxz
38c748b6fd
Add network commands and cursors (#1967) 2020-01-17 13:37:22 -06:00
qndel
6689a19e3e [hellfire] InitCursor and FreeCursor bin exact 2019-08-31 16:57:14 +02:00
Anders Jenbo
6fba17eec5 Correct GLOBAL types based on PSX SYM 3 2019-07-21 04:10:31 +02:00
Anders Jenbo
7883043adc Clean up files with dirty headers 2019-07-08 04:28:31 +02:00
galaxyhaxz
00e8417f98 CheckCursMove bin exact (#961) 2019-04-16 04:08:37 +02:00
galaxyhaxz
4e01e03711 Cleanup default calling conventions 2019-04-09 12:04:00 +02:00
Robin Eklind
e915623726 rename SetCursor to SetCursor_ to avoid collision with windows.h
Translation done automatically using:
	$ find . -type f -name '*.h' | xargs -I '{}' sar -i "([ \t])(SetCursor)[(]" '${1}${2}_(' '{}'
	$ find . -type f -name '*.h' | xargs -I '{}' sar -i "([ \t])(SetCursor)[(]" '${1}${2}_(' '{}'
2018-12-30 03:19:10 +01:00
Anders Jenbo
27b23b4186 Format ingame UI 2018-10-22 01:31:21 +02:00
galaxyhaxz
38b498ac4b
Add 'const' to data to match original binary (#200) 2018-09-09 15:40:23 -05:00
galaxyhaxz
49a6f4f9fc
Add include guards, prepare for XRef (#28)
Add definitions, other junk.
2018-06-20 05:17:44 -05:00
galaxyhaxz
bb01c6f084
Remove the "fear factor" (#21)
Snakes, spiders, Demons, what scares you?
2018-06-18 19:16:32 -05:00
galaxyhaxz
dde68ff89e
Add files via upload 2018-06-06 21:25:54 -05:00