Commit Graph
892 Commits
Author SHA1 Message Date
obligaron d2d96f988c Make TalktoMonster multiplayer compatible 2022-11-22 15:29:04 +01:00
obligaron c8c3f9366c Play skeleton kings speech only once and also in multiplayer 2022-11-14 06:58:56 +01:00
obligaron 7980a5a890 Make debug god mode damage multiplayer compatible 2022-11-11 03:27:37 +01:00
obligaron eca1a68bec AnimationInfo: Use fixed point math for fractions 2022-11-06 12:31:40 +00: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 0498d7d3a7 Fix compilation warnings 2022-10-29 13:41:23 +01: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
obligaron 795a43dd89 Add Arena Support 2022-10-14 16:25:30 +02: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
Gleb Mazovetskiy ec12d7ce44 Player: Optimize to save 40 bytes 2022-10-11 10:17:01 +01:00
obligaron a2ec22667f Use AnimationInfo::isLastFrame in more places 2022-09-04 18:00:16 +02:00
obligaron 925e13d22a Introduce AnimationInfo::isLastFrame and use it instead of _pXYZFrames 2022-09-04 18:00:16 +02:00
obligaron 5b6beac375 Introduce Player::getAnimationFramesAndTicksPerFrame 2022-09-04 17:58:18 +02:00
Gleb Mazovetskiy 188dc79f6e Make Players a vector 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
qndel 5dc95550ce Add TRN debug command and support for optional class TRNs 2022-08-11 01:02:36 +02:00
Vladimir Olteanu 58ae9169f1 Item effect cleanup (#5229) 2022-08-11 01:00:38 +02:00
obligaron 9e0cdfe022 StartNewLvl: Only update setlvlnum for the local player 2022-08-10 19:48:14 +02:00
qndel 8e137f5305 close help panel while talking to NPCs 2022-08-07 18:54:20 +02:00
staphen f9e01f25c4 Consistently send network messages when monsters are damaged 2022-08-07 03:34:57 +02:00
ephphatha 8132d6a033 Take object by reference in OperateObject 2022-08-07 02:46:24 +02:00
staphen 4115c8ce29 Ensure valid animation state when loading death animation in InitPlayer() 2022-08-06 08:08:07 +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
obligaron 2493f06116 ActorPosition: Remove offset, offset2 and velocity 2022-08-03 21:25:21 +02:00
obligaron 5913783826 Add walking offset calculation to ActorPosition (and validate it) 2022-08-03 21:25:21 +02:00
obligaron acfa8ed022 Reduce use of position.offset in PmChangeLightOff 2022-08-03 21:25:21 +02:00
obligaron a410e989bf Remove ScrollInfo 2022-08-03 21:25:21 +02:00
Gleb Mazovetskiy ba34bafb3f Use SDL events directly
Removes redundant miniwin events and queue, using SDL events directly instead.

Demo migrated using this script: https://gist.github.com/glebm/8a73b04f695de96f344cc2e35151e03e
2022-08-03 03:50:19 +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
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
Cesar Canassa 1bdee4523b ✨ Adds ignoreMovingMonsters to MonsterAtPosition (#5118) 2022-08-01 01:20:47 +02:00
ephphatha 0ce76a3f13 Add Object lookup method to mimic map::at() 2022-07-28 12:47:13 +02:00
Cesar Canassa 1d08d6b974 ♻️ Replace dMonster usage on DoAttack (#5137) 2022-07-28 00:39:29 +02:00
DakkJaniels 9403084d41 Fix ModifyPlrMag
Used BaseStr instead of BaseMag
2022-07-27 22:29:29 +02:00
Gleb Mazovetskiy 2ca6a3e8eb Player#getGraphic: Remove MyPlayer check
We always have `_pSpell` when this function is called.
2022-07-26 11:13:51 +02:00
Gleb Mazovetskiy b21ebffaf2 Clean up player graphic loading 2022-07-24 18:25:12 +02:00
Anders Jenbo 56915974d6 Minimize passing of player indexes 2022-07-18 11:15:50 +02:00
Anders Jenbo d1189388f5 Use user by reference 2022-07-17 18:41:05 +02:00
Mikołaj Piróg 262fa9ac2d Rename MonsterData members (#5000) 2022-07-15 16:20:13 +02:00
Anders Jenbo ac2bf9aaac Limit what gets called in headless mode 2022-07-13 18:54:36 +02:00
obligaron ebfb519ee0 Rename gbQuietMode to HeadlessMode 2022-07-13 18:54:36 +02:00
Cesar Canassa ce349789cf ♻️ Refactor M_StartKill to receive a Monster reference (#4943) 2022-07-13 15:57:58 +02:00
ephphatha 1337ff6ea2 Add check if a monster potentially has leashed minions 2022-07-13 07:13:34 +02:00
Gleb Mazovetskiy 33ac2cca8e ♻️ Make Monster counters size_t 2022-07-12 03:04:53 +01:00
Anders Jenbo 3d08f951d6 Clean up use of miniwin 2022-07-10 21:13:39 +02:00
Anders Jenbo 3ae834148a Split event handeling from general miniwin features 2022-07-10 21:13:39 +02:00