Commit Graph
917 Commits
Author SHA1 Message Date
Anders Jenbo e969a8ad01 Invert player to vision relation 2023-04-21 21:25:19 +02:00
Anders Jenbo 13c5c09990 Clean up Light related naming
A few are left unchanged as they will be removed in a later commit
2023-04-21 21:25:19 +02:00
DakkJaniels 24bb409086 Remove extra entry in experience level table and cap experience at level 50 requirement (#5782) 2023-04-18 03:10:14 +02:00
obligaron 1a3e72bf17 Unify normal casting and casting from inventory 2023-04-17 03:22:50 +02:00
obligaron e1cdec438e When player position desyncs ensure position.old is also updated 2023-04-17 01:35:34 +02:00
obligaron 9697c82487 Ensure PM_DEATH is reset when restarting in town for remote players 2023-04-14 23:40:08 +02:00
obligaron f6aae56a28 Refactor StartPlayerKill 2023-04-14 23:34:54 +02:00
obligaron 40bb3aeb45 Replace earflag with DeathReason 2023-04-14 23:34:54 +02:00
qndel ce2ce86070 inspect players command 2023-04-14 02:40:17 +02:00
Łukasz 2ec0603896 use Points instead of x, ys in GetRndObjLoc (objects.cpp) and portal-related functions (portal.cpp) (#5897)
Nice cleanup, thanks.
2023-03-18 21:46:00 +01:00
Gleb Mazovetskiy 957bd03b98 Remove FMT_COMPILE in "cold" places
Removes most `FMT_COMPILE` calls.
`FMT_COMPILE` results in better performance but larger code size.

Removes `FMT_COMPILE` calls for places that are called infrequently,
i.e. not on every frame.

RG-99 binary size reduced by ~4 KiB.
2023-03-12 19:29:35 +01:00
Eric Robinson f75f66d54b Add playerdat (#5763) 2023-02-10 12:56:28 +00:00
Gleb Mazovetskiy ebcd6b222d Optimize SpellData size: 40 bytes -> 24 2023-02-10 10:51:06 +00: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
ikonomov d05992da75 Remove "Zen" hit recovery (#5724)
The description of Harmony says "Fastest", clearly implying that this is the fastest recovery bonus that is attainable for a given character and also an indication that the bonus is not cumulative with other items.
2023-01-30 19:15:47 +01:00
Eric Robinson 93a145608e Optimize AddPlrExperience() (#5737) 2023-01-30 19:14:37 +01:00
Eric Robinson ef3a57b7d9 enum spell_type -> enum class SpellType (#5674) 2023-01-28 22:25:37 +01:00
staphen c857b7c7e4 Update frame skip logic for attacks after movement to match vanilla behavior 2023-01-27 23:57:03 +01:00
c99f7cf644 Floating numbers (#5639)
Co-authored-by: qndel <[email protected]>
Co-authored-by: Stephen C. Wills <[email protected]>
2023-01-22 07:20:10 +01:00
Gleb Mazovetskiy b48d4b2900 Remove uses of blank.wav
blank.wav is a 22 KiB 1-second silence that is not needed with
our sound engine.
2023-01-21 14:09:02 +00:00
KPhoenix 8db521727d enum missile_id -> enum class MissileID
Changes `enum missile_id` to `enum class MissileID`
2023-01-18 17:17:25 +00:00
KPhoenix f52b2cb71f Enum Class: MagicType
Changes enum magic_type to enum class MagicType
2023-01-17 03:56:10 +01:00
Anders Jenbo a29fc3a074 Correct casing for Player::isWalking() 2023-01-12 09:42:49 +01:00
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