Commit Graph
251 Commits
Author SHA1 Message Date
staphen f68540f82a Don't destroy hold item when setting cursor to hourglass 2022-03-31 11:45:16 +02:00
staphen 6a30cd3950 Add gamepad support for stash 2022-03-30 23:12:09 +02:00
Anders Jenbo 6d28810dc7 Change infostr from char[128] to std::string 2022-03-20 14:23:30 +01:00
Anders Jenbo 1409e604f5 Reduce string conversions 2022-03-20 11:04:15 +01:00
Anders Jenbo 718c46e7fe Remove use of tempstr 2022-03-19 06:03:19 +01:00
Anders Jenbo a48f89007d Implement stash 2022-03-18 06:01:53 +01:00
Gleb Mazovetskiy f4bce38875 Use uint16_t for sprite widths 2022-03-06 04:49:13 +01:00
Gleb Mazovetskiy 7fede6c4cb Clean up owned/unowned CelSprite ambiguity
Makes `CelSprite` unowned and adds a new `OwnedCelSprite` class for
owned sprites.

This clarifies ownership and makes the code cleaner in a number of
places.

Additionally, because the `CelSprite` class is now tiny (1 less
pointer), we can pass it by-value instead of by-reference, removing a
pointer indirection in the rendering functions.
2022-03-06 04:49:13 +01:00
obligaron 234a053863 Change Missiles Array to std::list 2022-01-20 23:12:48 +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 be2d89efaa Refactor code for highlighting an object with a cursor
Reduces the use of Objects and removes the uses of dObjects in this file
2021-12-29 04:57:57 +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
obligaron 677303cba9 Reduce use of view globals in game menu 2021-11-20 21:57:32 +01:00
Anders Jenbo 56170b3372 Clean up id normalization 2021-11-07 23:15:10 +01:00
Andrew James 796e2813cf Use scoped enums for DungeonFlags/BFLAG (#3135) 2021-11-07 03:11:16 +01:00
obligaron f7f02714fb Tracking: Use BFLAG_LIT instead of BFLAG_VISIBLE (like cursor and drawing logic) 2021-09-28 01:17:58 +02:00
obligaron 388370163d Don't track hidden monseters 2021-09-28 01:17:58 +02:00
obligaron ada3b3daba Adjust cursor position only when a action should be repeated (for example locking to a target). 2021-09-27 11:58:51 +02:00
obligaron 0818c55b88 Holding mouse when shift is held shouldn't lock to a target (Spells) 2021-09-27 11:58:51 +02:00
obligaron 10ef8e0c28 Holding mouse when shift is held shouldn't lock to a target (Melee & Ranged Attacks) 2021-09-27 11:58:51 +02:00
Anders Jenbo e68c8cc834 Reuse EntranceBoundaryContains in portal logic 2021-09-12 02:51:34 +02:00
ephphatha 87a33097a0 Rename ScrollDirection enum to follow convention
Pretty sure the backing type can be left to the default as well but I haven't had the time to investigate where it's used fully.
2021-09-12 02:27:47 +02:00
Juliano Leal Goncalves 940a120bf9 ♻️ Replace 'ViewX' and 'ViewY' globals with single 'ViewPosition' 2021-09-04 18:06:28 -04: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
qndel c59950edc6 fix coords jumping when in inventory 2021-08-26 07:37:21 +02:00
BC Ko b9927c7ceb refactor CheckTown() and CheckRportal() 2021-08-19 01:09:50 +02:00
BC Ko b1d9bfdbf8 cleanup manual value clamping: cursor.cpp CheckCursMove() (#2563) 2021-08-11 00:36:40 +02:00
Aaron Sun 3ee90ca629 Add options for sub-panel alignment 2021-08-07 16:09:32 +02:00
4aron5un 4c8210df21 Center the sub-panels (Quest, Character, Spell and Inventory) (#2498) 2021-08-05 21:27:07 +02:00
Anders Jenbo ab8afa7cd7 Fix edge cases in mouse action tracking code (#2452)
Fixes #2431

Also:
- Track spell targets
- Merge repeat walk in to the new repeat action code
- Avoid time based repeats (use action frame instead)
2021-07-25 03:57:42 +00:00
Anders Jenbo 9c4e34f988 Player by reference 2021-07-20 01:35:56 +02:00
Anders Jenbo 3ffedb7a69 💄 Apply code style to src 2021-07-17 16:57:21 +02:00
FluffyQuack ba60907853 Hold mouse button to keep attacking (Diablo 2-style) (#2349) 2021-07-16 15:01:01 +01:00
Anders Jenbo 467b74dc06 Rename object globals 2021-07-08 02:01:14 -07:00
Anders Jenbo 9ae908f947 Rename missile globals 2021-07-08 02:01:14 -07:00
Anders Jenbo 9b8bf92575 Rename quest globals 2021-07-08 02:01:14 -07:00
Anders Jenbo 96bf75b502 Rename player globals 2021-07-08 02:01:14 -07:00
Anders Jenbo c8870dbd1f Rename item globals 2021-07-08 02:01:14 -07:00
Anders Jenbo 07ad083fda Rename monster globals 2021-07-08 02:01:14 -07:00
Gleb Mazovetskiy cb0dae8590 🚚 Rename CelOutputBuf to Surface and extract 2021-07-03 05:33:32 -07:00
qndel a1710ff51e pass item to CelDrawItem (#2265)
pass item to CelDrawItem
2021-06-29 18:09:54 +02:00
Juliano Leal Goncalves cbb84199c2 ♻️ Replace Point addition with 'Point + Displacement' 2021-06-28 20:37:44 -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
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
Anders Jenbo 22b632f04a ♻️Clean up implicit bool conversions 2021-06-26 08:57:59 -07:00