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
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
Anders Jenbo
b00ae287b8
Minimize propegation of global Players index
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
Gleb Mazovetskiy
72660d9189
Migrate snprintf to fmt ( #4845 )
...
* Migrate `app_fatal` from printf to libfmt
* Migrate snprintf to fmt
4 years ago
Gleb Mazovetskiy
3178dd5158
Replace most uses of `sprintf` with `fmt` ( #4837 )
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
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
Gleb Mazovetskiy
8e9c9e0238
Reduced the size of `OwnedCelSprite*` by 8 bytes
...
`OwnedCelSpriteWithFrameHeight`: 40 -> 32
4 years ago
Anders Jenbo
860bd1cebf
Operate directly on SOL data
4 years ago
Gleb Mazovetskiy
02d448267a
Render fonts as PCX (-420 KiB RAM)
...
Reduces peak memory consuption in game by ~420 KiB.
This is because the PCX renderer applies the palette on the fly while
rendering, meaning we do not need to duplicate the font for different
palettes.
This approach is also a bit slower than precomposed palettes (still
plenty fast).
4 years ago
Gleb Mazovetskiy
1fc8ecb6f6
Add fmt::runtime annotations for C++20 support
...
`fmt` requires non-contexpr format string arguments to be wrapped in
`fmt::runtime` in C++20.
4 years ago
Gleb Mazovetskiy
c380c7fa61
PCX: Add transparency support
4 years ago
Gleb Mazovetskiy
220d38aa5c
Direct PCX rendering
4 years ago
qndel
f84c35d2dc
fix typos
4 years ago
Anders Jenbo
0508311959
Cleanup block_lvid checks
4 years ago
Gleb Mazovetskiy
961e1b584b
Always load fonts as CEL
...
There appear to be no drawbacks, only advantages.
4 years ago
Gleb Mazovetskiy
978bae1a15
Add a helper for loading PCX as CEL from path
4 years ago
Gleb Mazovetskiy
2b161e5535
An option to convert fonts to CEL in-memory
...
Reduced RAM usage by 200 KiB with no performance drop, perhaps even an
improvement.
4 years ago
Gleb Mazovetskiy
a66ca44695
Zero-based frame indexing
...
Index frames starting at 0 instead of 1.
4 years ago
Gleb Mazovetskiy
ade8aba822
Fix some more warnings
4 years ago
Gleb Mazovetskiy
12de70550b
Fix an OOB in CEL/CL2 outline rendering
...
This OOB happened when rendering a sprite so that it is exactly
off-screen (touching the border but not visible) on top/bottom
while also being only partly off-screen on the left or right.
4 years ago
ephphatha
93068de918
Address type conversion warnings in WordWrapString
4 years ago
Gleb Mazovetskiy
7fede6c4cb
Clean up owned/unowned CelSprite ambiguity
...
Makes `CelSprite` unowned and adds a new `OwnedCelSprite` class for
owned sprites.
This clarifies ownership and makes the code cleaner in a number of
places.
Additionally, because the `CelSprite` class is now tiny (1 less
pointer), we can pass it by-value instead of by-reference, removing a
pointer indirection in the rendering functions.
4 years ago
qndel
9ba64ad08b
TRN rewrite + bugfix ( #4056 )
...
* working new TRN system
* apply TRNs to all unique missiles
4 years ago
Gleb Mazovetskiy
1519e995cf
Move store graphics out of `stores.cpp`
...
These graphics are used in various places outside of `stores.cpp`.
4 years ago
KPhoenix
a08026097a
Chat Interface Revision ( #3840 )
...
Co-authored-by: Anders Jenbo <anders@jenbo.dk>
4 years ago
Anders Jenbo
b6bdbcfc98
Stip stippled transparency
4 years ago
Gleb Mazovetskiy
1de202cfe0
DrawString: Fix IsCJK definition
...
Fix IsCJK to include Hiragana, Katakana, Bopomofo, etc.
4 years ago
Gleb Mazovetskiy
48ddb2ea06
DrawString: Fix line height for tall codepoints
4 years ago
obligaron
6273f700fa
Add some Graphic Settings to Settingsmenu ( #3617 )
4 years ago
Gleb Mazovetskiy
1425bec3e4
Add missing GetLineWidth declaration to header
4 years ago
Gleb Mazovetskiy
bffe7dd071
`DrawStringWithColors`: Fix `{}` support
4 years ago
Gleb Mazovetskiy
c57644970f
Move `UiFlags` and `UiPanels` into their own files
...
The first breaks circular dependency between `DiabloUI` and `text_render`.
The latter one moves `UiPanels` to a more appropriate place.
4 years ago
Gleb Mazovetskiy
af168fd8df
Add `DrawStringWithColors`
...
A way to color parts of the string differently while keeping the color
information out of the string itself.
This is an alternative to #3546 .
4 years ago
Gleb Mazovetskiy
7e1fea6f76
clang-format all files in {Source,test}/
...
Also includes a few manual tweaks to comments and newlines for better results.
Co-authored-by: Anders Jenbo <anders@jenbo.dk>
4 years ago
Anders Jenbo
9ea6d9c9d1
Tweak Hangul font width
4 years ago
Anders Jenbo
a6f17fe072
Adjust width of CJK and Hangul fonts
4 years ago
Anders Jenbo
5e97bfa1e8
Adjust to new CJK font width
4 years ago
Gleb Mazovetskiy
f45270e9ab
`RenderString`: Fix width calculation after \n
...
Fixes #3456
4 years ago
Gleb Mazovetskiy
bc9031ad54
WordWrapString: Fix state after starting a new line
...
After starting a new line, we restart the processing from the line break
position, so we need to set `nextCodepoint` correctly.
Fixes #3449
4 years ago