Gleb Mazovetskiy
032eaf7491
External iterators for player items
...
Implements external iterators for player items.
2021-08-29 07:28:21 +02:00
Robin
62a33c61d9
objects: deduplicate logic in OperateShrineGloomy using ForEachItem function
2021-08-27 11:41:45 +02:00
BC Ko
4df798808e
2435 refactor global variable Items part 2 ( #2673 )
2021-08-26 08:06:48 +02:00
Thomas Christlieb
8f92248250
don't play 'Uh uh' sound everytime you pick up the cathedral map. fixes #1354
2021-08-23 14:45:31 +02:00
Anders Jenbo
5ddcd90ff9
Make NetSendCmdQuest() take a quest structure as input
2021-08-20 12:13:17 +02:00
Anders Jenbo
4a7fecb9c1
Fix OOB in inventory code
2021-08-13 03:59:29 +02:00
BC Ko
a02eaeecda
use abs
2021-08-11 17:50:13 +02:00
BC Ko
a293abc2a6
cleanup manual value clamping: inv.cpp
2021-08-11 17:50:13 +02:00
Juliano Leal Goncalves
f64521a722
🐛 Centralize readied spell update on equipment change
...
This ensures all equipment changes will undergo the check to see if the readied spell needs to change, including auto-equipping items on pickup and with shift click.
2021-08-10 12:26:01 +02:00
Juliano Leal Goncalves
022502660d
♻️ Extract logic to ready spell from staff to player function
2021-08-10 12:26:01 +02:00
Anders Jenbo
8df8b940c4
Handle some clang-tidy issues
2021-08-07 16:30:14 +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
ephphatha
0575716eac
Rename UiFlags members to group related options
2021-07-31 20:22:40 +02:00
ephphatha
4ad53232a0
Convert the UiFlags enum to a scoped enum type
...
Replace operator&& with named function
2021-07-31 20:22:40 +02:00
Anders Jenbo
a19e7b2a3b
Remove some more use of miniwin
2021-07-17 23:54:13 +02:00
qndel
4f4bef623c
fix upper left inventory corner ( #2394 )
2021-07-16 08:54:06 +02:00
Anders Jenbo
77b72da276
♻️ Use monster by reference when possible
2021-07-14 20:22:35 -07:00
Anders Jenbo
35ccc8eb1c
Apply clang-tidy to code
2021-07-10 17:30:15 -07:00
Anders Jenbo
74b57558c9
🚚 Move local code to anonymous namespace
2021-07-10 17:30:15 -07:00
Anders Jenbo
903d4bd2e1
Scope all for loops
...
This caused 7 of the loops to be rewriteen using range by clang-tidy
2021-07-08 08:14:03 -07:00
Anders Jenbo
467b74dc06
Rename object 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
dce78dde62
Rename lighting 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
Anders Jenbo
bc59218d0d
More clang-tidy/Android Studio cleanups
2021-07-04 19:34:37 +02:00
Anders Jenbo
4eabc6024b
Apply various cleanups via Android Studio
2021-07-03 18:27:17 -07:00
Gleb Mazovetskiy
cb0dae8590
🚚 Rename CelOutputBuf to Surface and extract
2021-07-03 05:33:32 -07:00
Anders Jenbo
50aa3dce0d
Fix GCC warning in inv.cpp
2021-07-02 21:01:25 +02:00
qndel
fd3893190f
inv cleanup
2021-07-02 05:00:31 -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
Juliano Leal Goncalves
fd9f2099d0
♻️ Leverage 'Point' to represent mouse position
2021-06-27 16:37:59 +02:00
Anders Jenbo
790f42d078
Clang-tidy: readability-inconsistent-declaration-parameter-name
2021-06-27 01:06:00 +02:00
Andrew James
60a47caf1b
Refactor Draw* functions to use Rectangle and Point types
...
Added overload for DrawString taking a Point to avoid creating a rect for callers which only use position. This also documents the way DrawString operates when passed a clipping rectangle with a dimension of 0.
As part of this overload removed the logic for 0 width regions from DrawString. This does change the behaviour of the Rectangle version if called with a rect with width 0, all callers using that behaviour have been updated in this commit.
Using Rectangle/Size allowed simplifying the logic for certain calls where they could use DrawText alignment flags, previously this was manually aligning by calculating dimensions and offsetting the position. This also fixes #2169
Also includes a few instances where a temporary buffer was used to set the text to be drawn with unbounded sprintf calls, replaced those with snprintf as is recommended in modern C applications. Moving to C++ strings would be good in a future refactor.
2021-06-24 01:36:06 +02:00
Anders Jenbo
ee7b32d8f6
Player by reference part 3
2021-06-24 00:53:09 +02:00
Anders Jenbo
e670faac99
🔥 Remove unused code DrawInvMsg
2021-06-23 14:42:19 -07:00
Gleb Mazovetskiy
f98148484f
🐞 Fix inventory manipulation ( #2216 )
...
Fixes #2214
Co-authored-by: staphen <staphen@gmail.com>
2021-06-23 08:05:19 +02:00
Gleb Mazovetskiy
5cefb4a365
Fix -Wswitch in UseInvItem
...
Fixes a giant non-exhaustive switch warning in `UseInvItem`:
```
../Source/inv.cpp: In function ‘bool devilution::UseInvItem(int, int)’:
../Source/inv.cpp:2131:9: warning: enumeration value ‘IDI_GOLD’ not handled in switch [-Wswitch]
2131 | switch (item->IDidx) {
| ^
../Source/inv.cpp:2131:9: warning: enumeration value ‘IDI_WARRIOR’ not handled in switch [-Wswitch]
../Source/inv.cpp:2131:9: warning: enumeration value ‘IDI_WARRSHLD’ not handled in switch [-Wswitch]
../Source/inv.cpp:2131:9: warning: enumeration value ‘IDI_WARRCLUB’ not handled in switch [-Wswitch]
...
```
2021-06-21 01:37:26 -07:00
Gleb Mazovetskiy
e40b1963f9
🚚 engine.h: Extract CelSprite and file loading
2021-06-21 01:36:20 -07:00
Gleb Mazovetskiy
aa54675d83
🚚 engine.h: Extract Size
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
Juliano Leal Goncalves
572c3e632e
♻️ Leverage 'Point' in 'InvDrawSlotBack' implementation
2021-06-20 18:27:45 -07:00
Juliano Leal Goncalves
07a049f667
♻️ Replace 'INV_SLOT_SIZE_PX' macro with Size-based constexpr
2021-06-20 18:27:45 -07:00
Juliano Leal Goncalves
0e2d734bbb
♻️ Leverage 'Size' in 'CheckInvPaste' implementation
2021-06-20 18:27:45 -07:00
Juliano Leal Goncalves
4ab80d25f4
♻️ Leverage 'Size' in 'AddItemToInvGrid' function
2021-06-20 18:27:45 -07:00
Gleb Mazovetskiy
43bc08bd63
Hardware Cursor: Fall back to software on failure
2021-06-19 12:36:39 +01:00
Gleb Mazovetskiy
523d838bd4
Hardware Cursor: Use item hotpoint
...
For a hardware item cursor, set the hotpoint to the center
instead of manually setting the cursor position.
2021-06-19 12:36:39 +01:00