Commit graph

315 commits

Author SHA1 Message Date
Anders Jenbo
ca2c2ba5e7 🚨 Handle a bunch of warnings from CLang 2021-03-29 06:26:31 +02:00
Anders Jenbo
bb7d0368d0 🐛 Correctly initialize empty objects 2021-03-29 02:19:01 +02:00
Anders Jenbo
2362ff82f7 Add black text color 2021-03-27 23:04:19 +01:00
Juliano Leal Goncalves
800dbce066 ♻️ Move options-related structs to new 'options.h' file 2021-03-27 03:26:44 +01:00
Anders Jenbo
38fdf34c14 💄 Apply code style 2021-03-20 20:39:28 +01:00
Anders Jenbo
1d537e0a93 🚨 Add missing cases to most switches 2021-03-20 20:39:28 +01:00
Gleb Mazovetskiy
70d1d633bd Get rid of SCREEN_X / SCREEN_Y
GlobalOutputBuffer() now returns a clipped subregion
2021-03-17 23:37:58 +01:00
Gleb Mazovetskiy
cd59a1c323 Completely replace gpBuffer with CelOutputBuffer
`CelOutputBuffer` now contains an `SDL_Surface` and an `SDL_Rect`.

We now have access to SDL surface manipulation functions.

`gpBuffer` and `gpBufEnd` are completely gone 🧹

This results in some FPS loss (250 -> 195) recovered in a subsequent
commit.
2021-03-13 05:13:26 +01:00
Gleb Mazovetskiy
764781e111 Migrate InvDrawSlotBack away from gpBuffer 2021-03-13 02:26:11 +01:00
Juliano Leal Goncalves
95ae8fd5c6 Autoequip items on purchase 2021-03-12 07:19:55 +01:00
Juliano Goncalves
53e1d6b50d Equip & unequip items with shift click. 2021-03-12 03:02:27 +01:00
Juliano Goncalves
68de2388cb ♻️ Leverage C++ references in 'CheckInvCut' 2021-03-12 03:02:27 +01:00
Juliano Goncalves
8166dfa137 ♻️ Generalize 'moveToFromBelt' variable name to 'automaticMove'
This will allow better reuse of this flag for new behavior.
2021-03-12 03:02:27 +01:00
Juliano Goncalves
fc1d9b684f Allow shift+click moving to inventory 2021-03-11 19:18:22 +01:00
Juliano Goncalves
5287d6e329 Allow shift+click moving to belt 2021-03-11 05:24:59 +01:00
Juliano Goncalves
15f48da070 ♻️ Extract function for inventory placement logic 2021-03-11 05:24:59 +01:00
Juliano Goncalves
a7cd58e670 ♻️ Reuse belt logic inside 'AutoGetItem' 2021-03-11 05:24:59 +01:00
Anders Jenbo
d6ec6395e0 ♻️ change QuestTalkData in to an array of _speech_id
This gets rid of casting QuestTalkData to DWORD/int in various parts of
the code.
2021-03-11 01:40:13 +01:00
Juliano Leal Goncalves
6ec679319e 🚩 Add ini toggle for auto-equip item sounds. Disabled by default. 2021-03-10 21:40:42 +01:00
Juliano Leal Goncalves
d67cfe1cca Play item sound on auto-equip 2021-03-10 21:40:42 +01:00
Juliano Leal Goncalves
103cde53ff ♻️ Make options struct hierarchical 2021-03-10 10:11:42 +01:00
Juliano Leal Goncalves
eef97eaabb 🚩 Add ini toggle for auto-equipping jewelry. Disabled by default. 2021-03-10 00:28:45 +01:00
Juliano Leal Goncalves
8bf5ef131e 🚩 Add ini toggle for auto-equipping shields. Disabled by default. 2021-03-10 00:28:45 +01:00
Juliano Leal Goncalves
08eff92412 🚩 Add ini toggle for auto-equipping helms. Disabled by default. 2021-03-10 00:28:45 +01:00
Juliano Leal Goncalves
70db53644e 🚩 Add ini toggle for auto-equipping armor. Disabled by default. 2021-03-10 00:28:45 +01:00
Juliano Leal Goncalves
b8a6e0ebfe 🚩 Add ini toggle for auto-equipping weapons. Enabled by default. 2021-03-10 00:28:45 +01:00
Juliano Leal Goncalves
08ffaa978c ♻️ Extract 'ItemStruct.isEquipment' method 2021-03-10 00:28:45 +01:00
Anders Jenbo
1284333765 ♻️ Use explicit types and remove globals from save file logic 2021-03-09 22:27:11 +01:00
Andi
7368778cb2
Remove items dropping before entering level (#1010) 2021-03-06 10:57:29 +01:00
Juliano Leal Goncalves
5862451e3b Autoequip all items on pickup
Extend behavior of weapons to all items types except for Monk, which will still not auto-equip weapons.
2021-03-06 10:34:56 +01:00
Gleb Mazovetskiy
9ca1fd8996 Migrate CelBlitOutline to CelBlitOutlineTo 2021-03-06 09:55:14 +01:00
Gleb Mazovetskiy
242341c0b3 Migrate CelClippedDraw to CelClippedDrawTo 2021-03-06 09:55:14 +01:00
Gleb Mazovetskiy
2f68e8e74e Migrate CelDrawLightRed to CelDrawLightRedTo 2021-03-06 09:55:14 +01:00
Gleb Mazovetskiy
88bf59f355 Migrate CelClippedBlitLightTrans to CelClippedBlitLightTransTo 2021-03-06 09:55:14 +01:00
Gleb Mazovetskiy
b43325028f Migrate CelDraw to CelDrawTo 2021-03-06 09:55:14 +01:00
Juliano Leal Goncalves
37466890e0 ♻️ Extract 'ItemStruct.isEmpty()' function 2021-03-05 03:52:11 +01:00
Gleb Mazovetskiy
d55a1c8a7d
Pass CelOutputBuffer to game text printing (#1095)
* Pass CelOutputBuffer to game text printing
* DrawHalfTransparentRectTo: minor cleanup
2021-03-03 18:20:24 +01:00
Anders Jenbo
ee3cbdc6ee 🐛 Clear item before reusing it in all cases
This will undoubtly also fix some issues with original items contaning
garbage data that could lead to morphing
2021-03-03 01:43:24 +01:00
Anders Jenbo
a85ffabc25 Fix Monk inventory in release versions of the game
Fixes #1081
2021-03-01 10:47:56 +01:00
Gleb Mazovetskiy
0a6640397b Fix two-handed weapons in inventory
Fixes #1070
Follow-up to #964
2021-03-01 01:35:05 +01:00
Juliano Leal Goncalves
68f31ef0f6 🐛 Block buying "red" consumables with full inventory 2021-02-28 02:22:33 +01:00
Juliano Leal Goncalves
3de338e5b6 ♻️ Pass item referece on SpecialAutoPlace
This simplifies and decouples the logic for determining the size of the
item from ambient variables and makes the function easier to use.
2021-02-28 02:22:33 +01:00
Anders Jenbo
f87bc0ca8b Clea up some duplicate item code 2021-02-27 23:04:06 +01:00
Gleb Mazovetskiy
8283f85e24 Engine: Functions to render to any buffer
Refactor the rendering functions to allow rendering to any output
buffer.

New functions that accept a buffer have the `To` suffix.

The functions that render to the global buffer now always accept
coordinates.
2021-02-27 17:49:39 +01:00
Anders Jenbo
70ca20b59f Clean up Hellfire special cases 2021-02-25 05:50:24 +01:00
Anders Jenbo
60d3e9ceb1 Clean up rendering 2021-02-19 03:05:12 +01:00
Anders Jenbo
772d51c126 [diablo] Fill gold stacks before creating new ones
Before if you had a stack of 4990 and picked up 12 gold you would end up
with one of 4990 and one of 12. Now you will have one of 5000 and one of
2.
2021-02-19 02:56:53 +01:00
qndel
ab9911064f unify checks for single and multiplayer 2021-02-18 22:32:01 +01:00
Anders Jenbo
7d39c4c9d1 Remove checks for duplicate items
- We fixed the normal way of duplicating items.
- Legit items can be seen as duplicates in some instances.
- It doesn't fix the issue since the player has to drop both for it to
trigger.
2021-02-18 21:11:46 +01:00
Anders Jenbo
c08a10e44b Unify calculation of gold icon 2021-02-18 20:52:07 +01:00