Commit Graph
792 Commits
Author SHA1 Message Date
obligaron f34cfeb565 Sync sign chest 2022-11-22 15:29:04 +01:00
obligaron 610e80f098 Sync break crux 2022-11-14 06:58:56 +01:00
obligaron 0711e6af4d Sync SpawnQuestItem (multiplayer quest items) 2022-11-12 19:27:36 +01:00
obligaron 5fe20e3d32 Make Lazarus quest map multiplayer compatible 2022-11-11 03:27:37 +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
Gleb Mazovetskiy 759ca7f055 WorldTileRectangle/Size
Adds a custom sized type for the world tile rectagle.

This allows us to better express intent.
It also allows us to make certain globals smaller, e.g. `THEME_LOC`.
2022-10-16 03:53:26 +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
ephphatha a5b5441794 Restore item seed when converting potions to rejuvenation potions 2022-10-11 11:39:47 +02: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
obligaron 37de526cb8 DeltaSyncOpObject: Add handling for shrine 2022-08-10 21:23:26 +02:00
ephphatha b4839dadcc Dedupe operate object network commands 2022-08-07 02:46:24 +02:00
ephphatha 8132d6a033 Take object by reference in OperateObject 2022-08-07 02:46:24 +02:00
Anders Jenbo 52780a3712 Do not count closed doors as blocked 2022-08-05 19:48:30 +02:00
qndel 3736b5c8fd fix interacting with lazarus books while not on circles 2022-08-04 14:01:24 +02:00
Anders Jenbo 2d9531f692 Remove redundant check for distance when operating doors
IsPlayerAdjacentToObject() is checked before calling OperateObject().
Previously teleFlag would ignore sendmsg which was likely a bug causing
the event to fire multiple times.
2022-08-04 01:37:03 +02:00
Anders Jenbo acab00652e Unify operate door logic 2022-08-04 01:37:03 +02:00
Anders Jenbo 3589744ed1 Fix crypt doors looking wrong after closing them 2022-08-04 01:37:03 +02:00
Anders Jenbo 37ad8a438a Remove some redundant door logic 2022-08-04 01:37:03 +02:00
Anders Jenbo 8dd8203a39 Add missing check to IsDoorClear 2022-08-04 01:37:03 +02:00
Anders Jenbo e1417be472 Reuse code for opening and closing doors 2022-08-04 01:37:03 +02:00
Anders Jenbo 6fdd756023 [hellfire] Fix blocked crypt door sound
Clean up blocked check in OperateL??Door
2022-08-04 01:37:03 +02:00
Anders Jenbo 52d9b69624 Reuse SetDoorStateClosed in AddDoor 2022-08-04 01:37:03 +02:00
Anders Jenbo e9702b4415 Move and rename door state functions 2022-08-04 01:37:03 +02:00
staphen 748bb1f84d Split delta trap operation from realtime trap operation 2022-08-03 07:39:25 +02: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
Anders Jenbo da5f392cfa Merge OpenDoor and DeltaSyncDoor 2022-08-01 12:09:26 +02:00
Anders Jenbo b9aa2959a6 Split deleta sync from operate door 2022-08-01 12:09:26 +02:00
Anders Jenbo 5f3acebe5e Merge operate door functions 2022-08-01 12:09:26 +02:00
Anders Jenbo 069a33749c Merge sync door functions 2022-07-31 11:01:03 +02:00
Anders Jenbo 70683bf9de Add door state enum 2022-07-31 11:01:03 +02:00
Anders Jenbo 3250472789 Clean up player references 2022-07-31 06:19:20 +02:00
Anders Jenbo e83c55d444 Clean up object references 2022-07-31 06:19:20 +02:00
ephphatha b234565f65 Inline functions which only set Object::_oRndSeed 2022-07-30 14:43:03 +02:00
Cesar Canassa f069cdc771 ♻️ Pass objects by reference (#5148) 2022-07-30 13:46:07 +02:00
ephphatha 0ce76a3f13 Add Object lookup method to mimic map::at() 2022-07-28 12:47:13 +02:00
ephphatha ed5d2d98e7 Simplify AddBookLever 2022-07-28 12:47:13 +02:00
ephphatha cdcccef47a Return pointer from AddObject
This allows removing the immediate lookup for call sites which need further initialisation.
2022-07-28 12:47:13 +02:00
Andrew James 24c57bf6c6 Simplify MonsterOperateDoor (#5100) 2022-07-23 13:14:47 +02:00
ephphatha 4a8f375011 Use position for operate object network commands
Only one remaining use of Object::getId for caching the target of a command requiring the player to path to an object.
2022-07-22 17:46:53 +02:00
ephphatha 50d292f8c6 Take references in operate door functions 2022-07-22 16:24:06 +02:00
Andrew James 9a09b07c4d Cleanup Object/Quest triggers which activate quests (#5081) 2022-07-22 14:16:38 +00:00
Andrew James 2786a65e7b Tidy up ActivateSkeleton and take monster by reference (#5080)
* Take reference in OperateSarcophagus
* Use monster reference instead of pointer in ActivateSkeleton
* Clean up ActivateSkeleton
2022-07-21 18:58:27 +02:00
Andrew James a075e5fe05 Take Object by reference in OperateContainer methods (#5079) 2022-07-20 14:24:07 +02:00
ephphatha de83d9440e Use position for break object network messages 2022-07-19 16:22:52 +02:00
Andrew James 986650afc8 Take Object by reference when operating quest objects (#5066) 2022-07-19 15:59:59 +02:00
ephphatha 9e76cd4ab7 Use object pointer for pcursobj 2022-07-19 13:20:24 +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
Cesar Canassa aa6ea3907e ♻️ Adds Missile::SourcePlayer and Missile::SourceMonster (#4999) 2022-07-17 18:50:29 +02:00