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`).
4 years ago
Mikołaj Piróg
c38db60d0b
Remove monster name member from monster struct ( #4986 )
4 years ago
Anders Jenbo
ac2bf9aaac
Limit what gets called in headless mode
4 years ago
obligaron
ebfb519ee0
Rename gbQuietMode to HeadlessMode
4 years ago
obligaron
40283ca69e
Introduce timedemo based tests
4 years ago
obligaron
bab9baa42a
Handle gbQuietMode for paths in StartGame
4 years ago
ephphatha
1337ff6ea2
Add check if a monster potentially has leashed minions
4 years ago
Gleb Mazovetskiy
33ac2cca8e
♻️ Make Monster counters `size_t`
4 years ago
Anders Jenbo
3d08f951d6
Clean up use of miniwin
4 years ago
Anders Jenbo
3ae834148a
Split event handeling from general miniwin features
4 years ago
Anders Jenbo
2d21fc372e
Remove more miniwin code
4 years ago
Trihedraf
5ee6e5dd3a
Make zoom a setting in the menu ( #4931 )
4 years ago
Anders Jenbo
6a8fd04067
Use player by references ( #4938 )
4 years ago
Andrew James
593a9f3b4b
Pull distinct points from VisionCrawlTable used by guardians ( #4844 )
4 years ago
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`.
4 years ago
ephphatha
7c54066f31
Use PickRandomlyAmong when choosing between two options
4 years ago
ephphatha
bc0a058350
Invert FlipCoin
4 years ago
Gleb Mazovetskiy
c8ddf7df65
Crawl: Move implementation from header to cpp
4 years ago
Gleb Mazovetskiy
2f09c20b08
cel_render: Remove unused `LineEndFn`
...
This was used for stippled transparency which we no longer support.
4 years ago
Cesar Canassa
bb3fb36ddc
✨ Introduces FlipCoin() ( #4908 )
4 years ago
Vladimir Olteanu
f463f08642
Refactor FindClosestValidPosition to use Crawl
4 years ago
Cesar Canassa
e538acb248
📝 Fixes Doxygen warnings ( #4904 )
4 years ago
Mikołaj Piróg
15989609a8
Members' name changes and comments in Monster struct ( #4861 )
4 years ago
obligaron
3c571bf64b
Avoid overflow of tickCounterOfCurrentFrame ( #4893 )
...
* When MFLAG_ALLOW_SPECIAL is set, don't call processAnimation (avoid overflow of tickCounterOfCurrentFrame)
4 years ago
Gleb Mazovetskiy
aeb8f9ee91
points_in_rectangle_range.hpp: Fix line endings
4 years ago
Gleb Mazovetskiy
eb8721885d
Fix clang warnings
...
As seen in the Xbox NDK build.
4 years ago
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]]
4 years ago
Gleb Mazovetskiy
6949a6f418
Monster: Remove MType/MData pointers
...
These pointers are redundant, replaces them with methods.
4 years ago
Gleb Mazovetskiy
d152d2c0fb
Add OptionalOwnedCelSprite
4 years ago
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.
4 years ago
obligaron
e87aca38bb
Change animation frames and tick per frame to int8_t
4 years ago
Anders Jenbo
b00ae287b8
Minimize propegation of global Players index
4 years ago
Gleb Mazovetskiy
92b6be4302
Fix `Point#*Distance` functions for unsigned types ( #4857 )
...
The `-` converts everything to unsigned if one of the operands is
unsigned. Convert everything to int before calculating.
4 years ago
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
4 years ago
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.
4 years ago
Andrew James
a083b76ec4
Avoid casting unnecessarily in worldToNormalScreen ( #4852 )
...
This doesn't trigger warnings on msvc, not sure about other compilers. Also added asserts to all functions performing rotations to match Rotate()
4 years ago
Gleb Mazovetskiy
72660d9189
Migrate snprintf to fmt ( #4845 )
...
* Migrate `app_fatal` from printf to libfmt
* Migrate snprintf to fmt
4 years ago
Gleb Mazovetskiy
3b2e560fa0
Non-int versions of `Point` and `Displacement` ( #4824 )
...
* Non-int versions of `Point` and `Displacement`
This will allow us to make some structs, such as `ActorPosition`, much
smaller.
* ActorPosition: Use smaller types
`Monsters`: 56K -> 46K
* player.cpp: Reduce size of `DirectionSettings`
* CrawlTable: Displacement -> DisplacementOf<int8_t>
* CrawlTable: vector<vector> -> array<vector>
Also only allocate one vector during construction instead of two.
A bit less indirection.
* Monster#enemyPosition: Point -> WorldTilePosition
sizeof(Monster): 240 -> 232
* Monster: Further optimize field layout and sizes
sizeof(Monster): 232 -> 208
`Monsters` is down to 40,000 bytes
* DMonsterStr: _mx/_my -> position
4 years ago
Gleb Mazovetskiy
010dda42cf
Remove PCX->CEL conversion
...
It is no longer used as we render all assets directly as PCX.
4 years ago
Gleb Mazovetskiy
0c7e36e81a
DiabloUI: Clean up portrait loading
...
1. Load portraits as PCX (~30% smaller).
2. Simplify the portrait override logic.
4 years ago
Gleb Mazovetskiy
3178dd5158
Replace most uses of `sprintf` with `fmt` ( #4837 )
4 years ago
Vladimir Olteanu
5a5111f1d8
Refactor CrawlTable ( #4833 )
4 years ago
Gleb Mazovetskiy
bd66e7d6d8
pcx_render: Fix line skipping for odd widths ( #4828 )
...
When line skipping PCX sprites with odd widths, skip the padding pixel
as well.
4 years ago
Mikołaj Piróg
2e7ff45fbf
Monster global constants cleanup ( #4827 )
...
* Change #defines to constexpr const, add constexpr where applicable, fix typos
4 years ago
Anders Jenbo
b3b5d16633
Clean up DrawPlayerIconHelper
4 years ago
obligaron
0d2a23254e
Use binaryformat for demofile ( #4799 )
4 years ago
Anders Jenbo
72656b3011
Move path and palette to the engine folder
4 years ago
Anders Jenbo
99181fd709
Move more files to the engine folder
4 years ago
ephphatha
c68fcf3cb1
Apply MethodCase config to Rectangle::Contains
...
Also included Circle and VirtualButton classes due to the shared use.
4 years ago
ephphatha
de05ce6562
Use theme room attributes directly instead of recalculating
4 years ago