Commit Graph
623 Commits
Author SHA1 Message Date
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
Anders Jenbo 3ae834148a Split event handeling from general miniwin features 2022-07-10 21:13:39 +02:00
Anders Jenbo 2d21fc372e Remove more miniwin code 2022-07-10 21:13:39 +02:00
Anders Jenbo 6a8fd04067 Use player by references (#4938) 2022-07-10 11:40:04 +02:00
Gleb Mazovetskiy 197e1180b2 Add StrCat and StrAppend
Adds simple string / integer concatenation functions.

Many of the uses of `fmt::format` are simply concatenation
of a few strings and integers.

`StrCat` is an easier-to-read alternative to such uses of `fmt`.
2022-07-10 06:14:58 +02:00
Cesar Canassa e538acb248 📝 Fixes Doxygen warnings (#4904) 2022-07-07 12:51:24 +02:00
Mikołaj Piróg 15989609a8 Members' name changes and comments in Monster struct (#4861) 2022-07-06 10:21:22 +02:00
Mikołaj Piróg dda0b96ea5 Remove #defines in player.h and add constexpr where applicable (#4896)
* Change defines to constexpr int in player.h

* Add const or constexpr to player.h/cpp where applicable

* Update tests with changed names of player constatns

* remove unecessary variable
2022-07-05 17:25:23 +02:00
Cesar Canassa 6579aa53c5 Normalise the player and monster walking function naming (#4877)
Both player and monster walking functions are not named WalkNorthwards, WalkSouthwards and WalkSideways.

Also renames the PLT_MODE enum to follow the same pattern and removes the comments that are now unnecessary
2022-07-03 20:28:06 +02:00
Gleb Mazovetskiy d152d2c0fb Add OptionalOwnedCelSprite 2022-07-03 12:26:39 +01:00
Gleb Mazovetskiy 72660d9189 Migrate snprintf to fmt (#4845)
* Migrate `app_fatal` from printf to libfmt
* Migrate snprintf to fmt
2022-07-02 02:36:17 +02:00
Anders Jenbo 0cc5ee4344 Clean up variable definitions 2022-06-30 02:59:23 +02:00
Anders Jenbo d82f2ebc9e Pass players by reference instead of an index 2022-06-28 00:30:00 +02:00
Vladimir Olteanu 2588cc12d7 Reduce reliance on bool done for control flow, part 2 of x (#4741) 2022-06-25 18:20:04 +02:00
Anders Jenbo 6d56058708 Move level generation to subfolder 2022-06-23 09:21:58 +02:00
ephphatha 3af11ad355 Use the same function when checking and actually dropping an item 2022-06-21 18:53:19 +02:00
Gleb Mazovetskiy 8e9c9e0238 Reduced the size of OwnedCelSprite* by 8 bytes
`OwnedCelSpriteWithFrameHeight`: 40 -> 32
2022-06-20 01:11:22 +02:00
obligaron 9ac04314f4 Introduce Player::isOnLevel 2022-06-18 17:05:30 +02:00
Andrew James 0add7a8af6 Define sizes using Size type in control.cpp/stash.cpp (#4737)
* Use appropriate types for size constants in control.cpp

* Declare constexpr value for iterating over the cells in a stash grid

* Use appropriate type for UIRectangle dimensions
2022-06-18 15:25:52 +02:00