Commit Graph
641 Commits
Author SHA1 Message Date
obligaron b87711bc08 Reintroduce Player::spellFrom to seperate teleport cursor from queued spell 2023-04-17 03:22:50 +02:00
qndel ce2ce86070 inspect players command 2023-04-14 02:40:17 +02:00
obligaron c4388b0d41 Remove unused pnum from UseInvItem 2023-04-14 02:40:17 +02:00
obligaron 1522dc7031 Multiplayer: Add arena potions 2023-04-13 21:20:53 +02:00
obligaron 590c990c80 Introduce Item::getName 2023-04-13 00:07:00 +02:00
ephphatha 94c646ef8f Use rectangles for inventory/belt hit areas 2023-03-25 14:22:57 +01:00
obligaron 6e364f2167 Telekenisis respects Disable Crippling Shrines Setting 2023-03-02 10:01:05 +01:00
obligaron 44de539afb Introduce CronerStoneStruct::isAvailable() 2023-03-02 01:23:59 +01:00
staphen 5e832e75d9 Fix alignment for 2x2 armor sprite in the chest slot 2023-02-18 21:15:27 +01:00
obligaron 715e689ecb Introduce Item::isUsable() 2023-02-10 22:28:52 +01:00
Gleb Mazovetskiy ebcd6b222d Optimize SpellData size: 40 bytes -> 24 2023-02-10 10:51:06 +00:00
KPhoenix a1fbf5253f enum talk_id -> enum class TalkID 2023-02-09 13:04:01 +01:00
obligaron 2d4e84c561 Multiplayer: Enable Black Mushroom Quest 2023-02-07 08:02:38 +01:00
Gleb Mazovetskiy b61dac853b Add GetSpellData(SpellID) 2023-02-05 12:12:48 +00:00
KPhoenix d813f13700 enum spell_id -> enum class SpellID 2023-02-05 10:24:58 +00:00
Gleb Mazovetskiy 1788d2f8ec Remove miniwin
Event handling code moved to `engine/events.{hpp,cpp}`.
2023-02-01 16:06:57 +00:00
obligaron a935066180 Multiplayer: Enable Halls of the Blind Quest 2022-12-28 10:05:45 +01:00
Gleb Mazovetskiy 4f9e9e04b1 Fix ConsumeScroll
Fixes #5617
2022-12-18 20:34:13 +00:00
obligaron 600cb656fb Multiplayer: Enable Arkaine's Valor Quest 2022-11-27 18:27:06 +01:00
obligaron a45ba2895e Multiplayer: Enable Anvil of Fury Quest 2022-11-27 07:19:40 +01:00
Gleb Mazovetskiy 3afef6299f Level renderer: Remove cel_transparency/foliage_active globals 2022-11-25 15:00:04 +01:00
obligaron d912babc91 Multiplayer: Enable Magic Rock Quest 2022-11-15 23:51:30 +01:00
Gleb Mazovetskiy 680ab5ec40 Overhaul backbuffer state handling
When rendering directly to the output buffer, we need to maintain the
state of what has been drawn and what needs redrawing per-buffer.

We previously tried to do it implicitly by checking `SDL_DOUBLEBUF` and
other flags. The previous implementation was broken in several
ways, resulting in rendering issues on devices that support 8-bit output
directly.

Changes this mechanism to explicitly maintain buffer state per output
buffer. The new mechanism doesn't require knowledge of the number of
buffers, and thus also works correctly with triple-buffering.

Fixes #5447
2022-11-01 02:43:24 +00:00
KPhoenix 069ba7f1d4 [QOL] Colored slot backs (#5266) 2022-10-31 11:11:52 +01:00
staphen 21bd760bfa Bypass CMD_PUTITEM when triggering CMD_OPENHIVE or CMD_OPENGRAVE 2022-10-25 07:14:03 +02:00
obligaron d59a7e2794 Combine SyncDropItem and SyncPutItem 2022-10-23 10:09:54 +02:00
obligaron ba65d5fbff SyncPutItem: Always use passed coordinates for item position 2022-10-23 10:09:54 +02:00
staphen 3049421008 Include runes in CanUseScroll() validation 2022-10-17 22:19:24 +01:00
Gleb Mazovetskiy 41f43ea3f5 Support unpacked MPQs from devilutionx-mpq-tools
https://github.com/diasurgical/devilutionx-mpq-tools produces an unpacked MPQ
with all the graphics converted to CLX and the unused files removed.
This is primarily useful on RAM-constrained platforms, such as PS2,
because it eliminates the MPQ overhead.

Adds a build option to load from such unpacked directories instead of the MPQ.

These directories are searched for in the same locations
where the MPQs would be searched for otherwise.

Example directory layout:

* /usr/local/share/diasurgical/devilutionx/diabdat/ -- unpacked and converted diabdat.mpq
* /usr/local/share/diasurgical/devilutionx/hellfire/ -- unpacked and converted hellfire MPQs (all of them merged into 1 directory)
* /usr/local/share/diasurgical/devilutionx/fonts/ -- unpacked fonts.mpq
* /usr/local/share/diasurgical/devilutionx/pl/ -- unpacked pl.mpq

These directory structure is produced by calling `unpack_and_minify_mpq`
2022-10-11 18:00:57 +01:00
ephphatha ea3ecbd619 Use _item_indexes type where appropriate 2022-10-11 18:51:13 +02:00
staphen 8b6db3a678 Get rid of panelstr, pnumlines, and ClearPanel() 2022-10-02 08:51:24 +02:00
qndel 810f229388 fix oob access (#5349) 2022-09-17 01:11:00 +02:00
staphen 8854135137 Fix error syncing item swap in inventory 2022-09-08 06:11:36 +02:00
staphen 147a13d66c Synchronize gold in player's inventories 2022-09-08 06:11:36 +02:00
staphen e28a8065e9 Sync more item data with TCmdChItem 2022-09-08 06:11:36 +02:00
staphen 73028ec04a Define network struct for ears 2022-09-08 06:11:36 +02:00
obligaron b3aa08589b Don't use MyPlayer in UnPackItem and dependend methods 2022-08-26 18:18:40 +02:00
Anders Jenbo 872456ae5d Use size_t for a select few pnum variables 2022-08-26 13:22:04 +09:00
Gleb Mazovetskiy 6327e713e0 Lowercase all file paths
We want to be able to use unpacked MPQs on low-end platforms
(PS2/rg99/etc).

This is tricky on case-sensitive filesystems. Avoids case issues by
lowercasing all paths in the code (then we'll just need lowercased
listfiles).
2022-08-20 23:49:23 +01:00
Stephen C. Wills a06dd25d17 Synchronize player inventories (#5217)
* Synchronize item placement in player's backpack

* Synchronize item remove from player's backpack

* Synchronize item placement and removal from player's belt

* Set up loopback network provider for failing tests
2022-08-20 16:30:40 +00:00
Gleb Mazovetskiy 961866e1c4 CLX: A new graphics format
The format is almost identical to CL2, except it uses the frame header
to store frame width and height instead of 5 32-line offsets.

This means we always have access to frame dimensions, so we can use it
as an on-disk format for our graphics as well.

Additionally, we may be able to optimize the rendering even more
in the future now that we have guaranteed knowledge of frame dimensions.
2022-08-03 02:38:55 +02:00
obligaron 439a9926e5 Clean up spell usage function names
Rename UseMana -> ConsumeSpell
Rename RemoveCurrentSpellScroll -> ConsumeScroll and remove unused return value
Rename UseStaffCharge -> ConsumeStaffCharge
Rename UseScroll -> CanUseScroll
2022-08-02 03:05:46 +02:00
obligaron 6804221199 Store scroll/rune location in SpellCastInfo.spellFrom and remove the scroll/rune only after the spell is casted 2022-08-02 03:05:46 +02:00
obligaron 279e92e69c Checks conditions for spell again, cause initial check was done when spell was queued 2022-08-02 03:05:46 +02:00
obligaron 1cfd1ca99d Fix double casting bug - use separated info for casted and queued spells 2022-08-02 03:05:46 +02:00
ephphatha 9e76cd4ab7 Use object pointer for pcursobj 2022-07-19 13:20:24 +02:00
ephphatha 0c08980c71 Combine Telekinesis with other object network commands 2022-07-19 12:50:00 +02:00
Gleb Mazovetskiy 8ca71272b8 Load all CEL as CL2
Convert CEL files to CL2 at load time. CL2 format is more efficient and is about as fast to render.

CEL vs CL2 sizes, on dLvl 5: https://gist.github.com/glebm/9bbdd76962abcd4fd2405ecd3379af97

Memory:

* Peak memory (while loading): -300 KiB
* Memory in-game (dLvl5): -700 KiB
* RG99 binary size: -15 KiB (1333096 -> 1317192)

Performance on rg99:

* On average, -1 FPS in town.
* Same FPS in dungeon (20 FPS on dLvl 1).
2022-07-19 10:59:35 +02:00
Anders Jenbo 56915974d6 Minimize passing of player indexes 2022-07-18 11:15:50 +02:00
Anders Jenbo ac2bf9aaac Limit what gets called in headless mode 2022-07-13 18:54:36 +02:00