Commit Graph
38 Commits
Author SHA1 Message Date
obligaron a2ec22667f Use AnimationInfo::isLastFrame in more places 2022-09-04 18:00:16 +02:00
obligaron deb0d6d9e1 Use missile helpers in MoveMissile/UpdateMissileRendererData (#5291) 2022-08-26 21:50:42 +02:00
Gleb Mazovetskiy 188dc79f6e Make Players a vector 2022-08-26 13:22:04 +09:00
obligaron 68891a8df1 Rename MissileMovementDistrubution => MissileMovementDistribution 2022-08-20 23:41:40 +02:00
Gleb Mazovetskiy 580d3cb6ee touch/renderers: Migrate away from Art 2022-08-08 14:29:45 +01:00
obligaron 2493f06116 ActorPosition: Remove offset, offset2 and velocity 2022-08-03 21:25:21 +02:00
obligaron a410e989bf Remove ScrollInfo 2022-08-03 21:25:21 +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
Andrew James 480ab945e7 Only draw towners on their base tile (#5171) 2022-08-01 21:02:59 +10:00
obligaron c5ce29106e Fix left sideways walking monsters draw order 2022-07-30 14:11:08 +02:00
ephphatha 0ce76a3f13 Add Object lookup method to mimic map::at() 2022-07-28 12:47:13 +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
Gleb Mazovetskiy f9b9a7de9d CL2 render: Point position argument
Bring the CL2 API closer to CEL and PCX.
2022-07-18 09:25:12 +02:00
Gleb Mazovetskiy a4ac41cece Replace DVL_VK virtual key codes with SDLK 2022-07-17 10:00:06 +01:00
Gleb Mazovetskiy 70364013b0 Fix fmt v9 deprecation warnings
Version 9 of libfmt deprecates printing `enum` without casting it to an
integral type explicitly (consistent with `enum class`).
2022-07-16 12:55:18 +01:00
Mikołaj Piróg c38db60d0b Remove monster name member from monster struct (#4986) 2022-07-14 10:16:19 +02:00
Anders Jenbo ac2bf9aaac Limit what gets called in headless mode 2022-07-13 18:54:36 +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
Anders Jenbo 2d21fc372e Remove more miniwin code 2022-07-10 21:13:39 +02:00
Trihedraf 5ee6e5dd3a Make zoom a setting in the menu (#4931) 2022-07-10 19:59:32 +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
k-bar 26de74f4a2 AnimationInfo class correct style (#4870)
* AnimationInfo class correct case-style for private members

clang-tidy warnings:
readability-identifier-naming    invalid case style for private member

* AnimationInfo class correct case-style for members

clang-tidy warnings:
readability-identifier-naming    invalid case style for member

* AnimationInfo class correct case-style for methods

clang-tidy warnings:
readability-identifier-naming    invalid case style for method

* AnimationInfo class use nodiscard

clang-tidy warnings:
modernize-use-nodiscard    function  should be marked [[nodiscard]]
2022-07-03 16:55:37 +02:00
Gleb Mazovetskiy 6949a6f418 Monster: Remove MType/MData pointers
These pointers are redundant, replaces them with methods.
2022-07-03 13:21:11 +01:00
Gleb Mazovetskiy 21dc7f553d Add OptionalCelSprite: smaller than std::optional
`CelSprite` data pointer can never be `nullptr`.

We implement a smaller `optional` for it by taking advantage of that.
2022-07-03 12:26:39 +01:00
Anders Jenbo b00ae287b8 Minimize propegation of global Players index 2022-07-03 06:10:42 +02:00
ephphatha 0f1ac758d8 use a smaller buffer
fmt::memory_buffer uses 500 bytes by default, go back to a 12 byte char array to avoid all the cruft
2022-07-02 08:51:28 +01:00
ephphatha d6120f05bc Only call fmt::format_to when the FPS value updates
Don't even need to initialise the buffer since the last update time is set when DiabloInit is called, then as long as the loading screen takes more than a second the threshold gets hit to call format_to on the first frame of gameplay.
2022-07-02 08:51:28 +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
Mikołaj Piróg 2e7ff45fbf Monster global constants cleanup (#4827)
* Change #defines to constexpr const, add constexpr where applicable, fix typos
2022-07-01 00:43:03 +02:00
Anders Jenbo b3b5d16633 Clean up DrawPlayerIconHelper 2022-06-26 10:11:12 +02:00
Anders Jenbo 99181fd709 Move more files to the engine folder 2022-06-24 11:08:15 +02:00