Mikołaj Piróg
15989609a8
Members' name changes and comments in Monster struct ( #4861 )
4 years ago
Gleb Mazovetskiy
6949a6f418
Monster: Remove MType/MData pointers
...
These pointers are redundant, replaces them with methods.
4 years ago
Gleb Mazovetskiy
d152d2c0fb
Add OptionalOwnedCelSprite
4 years ago
ephphatha
c68fcf3cb1
Apply MethodCase config to Rectangle::Contains
...
Also included Circle and VirtualButton classes due to the shared use.
4 years ago
Anders Jenbo
6d56058708
Move level generation to subfolder
4 years ago
Gleb Mazovetskiy
8e9c9e0238
Reduced the size of `OwnedCelSprite*` by 8 bytes
...
`OwnedCelSpriteWithFrameHeight`: 40 -> 32
4 years ago
Gleb Mazovetskiy
1fc8ecb6f6
Add fmt::runtime annotations for C++20 support
...
`fmt` requires non-contexpr format string arguments to be wrapped in
`fmt::runtime` in C++20.
4 years ago
qndel
354e329644
Players[MyPlayerId] -> MyPlayer
4 years ago
obligaron
bc15bdf3a9
Remove PANEL_ defines and replace them with GetMainPanel()
4 years ago
obligaron
70c5cf6cad
Fix item label text with open stash ( #4595 )
...
* Item labels: check if stash is open in IsMouseOverGameArea
* Add IsLeft/RightPanelOpen
4 years ago
ephphatha
64a2c41b2c
Set clang-tidy config for MethodCase option
...
Previously this was falling back to FunctionCase, leading to inconsistent casing of class methods throughout the codebase. Applied to Item as an example.
4 years ago
ephphatha
7e7798fd2b
Add function to mark an item as empty
4 years ago
ephphatha
026b428c7d
Add NewCursor(Item&) for setting the cursor based on a held item
...
The case for empty items should never be hit in the current code, but I've got a related PR that'll make use of that so adding it now.
4 years ago
Anders Jenbo
dc706e8ed5
Use HoldItem for determining if an item is held
...
This cleans up a bit of code and solves a few edge cases where an item
could be lost, the game be unresponsive, or miss fire an event during
lag cause of the cursor not reflecting the currently held item.
4 years ago
ephphatha
5b83f2a7c4
Remove SetICursor and unused globals
4 years ago
Gleb Mazovetskiy
a66ca44695
Zero-based frame indexing
...
Index frames starting at 0 instead of 1.
4 years ago
Anders Jenbo
66d7a3c222
[gamepad] Reuse repeat logic from mouse
4 years ago
Anders Jenbo
ee629e79e0
Fix crash from badly init stash
4 years ago
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
4 years ago
staphen
f68540f82a
Don't destroy hold item when setting cursor to hourglass
4 years ago
staphen
6a30cd3950
Add gamepad support for stash
4 years ago
Anders Jenbo
6d28810dc7
Change infostr from char[128] to std::string
4 years ago
Anders Jenbo
1409e604f5
Reduce string conversions
4 years ago
Anders Jenbo
718c46e7fe
Remove use of tempstr
4 years ago
Anders Jenbo
a48f89007d
Implement stash
4 years ago
Gleb Mazovetskiy
f4bce38875
Use `uint16_t` for sprite widths
4 years ago
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.
4 years ago
obligaron
234a053863
Change Missiles Array to std::list
4 years ago
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.
4 years ago
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
4 years ago
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
4 years ago
obligaron
677303cba9
Reduce use of view globals in game menu
4 years ago
Anders Jenbo
56170b3372
Clean up id normalization
4 years ago
Andrew James
796e2813cf
Use scoped enums for DungeonFlags/BFLAG ( #3135 )
4 years ago
obligaron
f7f02714fb
Tracking: Use BFLAG_LIT instead of BFLAG_VISIBLE (like cursor and drawing logic)
5 years ago
obligaron
388370163d
Don't track hidden monseters
5 years ago
obligaron
ada3b3daba
Adjust cursor position only when a action should be repeated (for example locking to a target).
5 years ago
obligaron
0818c55b88
Holding mouse when shift is held shouldn't lock to a target (Spells)
5 years ago
obligaron
10ef8e0c28
Holding mouse when shift is held shouldn't lock to a target (Melee & Ranged Attacks)
5 years ago
Anders Jenbo
e68c8cc834
Reuse EntranceBoundaryContains in portal logic
5 years ago
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.
5 years ago
Juliano Leal Goncalves
940a120bf9
♻️ Replace 'ViewX' and 'ViewY' globals with single 'ViewPosition'
5 years ago
Juliano Leal Goncalves
01823e1324
♻️ Replace 'cursmx' and 'cursmy' globals with single 'cursPosition'
5 years ago
Juliano Leal Goncalves
05d206720a
♻️ Replace 'icursW' and 'icursH' globals with single 'icursSize'
5 years ago
Juliano Leal Goncalves
317ebcdd3e
♻️ Replace 'icursW28' and 'icursH28' globals with single 'icursSize28'
5 years ago
Juliano Leal Goncalves
a469f7906e
♻️ Replace 'cursW' and 'cursH' globals with single 'cursSize'
5 years ago
qndel
c59950edc6
fix coords jumping when in inventory
5 years ago
BC Ko
b9927c7ceb
refactor CheckTown() and CheckRportal()
5 years ago
BC Ko
b1d9bfdbf8
cleanup manual value clamping: cursor.cpp CheckCursMove() ( #2563 )
5 years ago
Aaron Sun
3ee90ca629
Add options for sub-panel alignment
5 years ago