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
qndel
f84c35d2dc
fix typos
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
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
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
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
Gleb Mazovetskiy
bffe7dd071
`DrawStringWithColors`: Fix `{}` support
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
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
Gleb Mazovetskiy
e3dc241c2f
Correctly handle ZWSP in WordWrapString
4 years ago
Gleb Mazovetskiy
40b1dc7a12
WordWrap: Require whitespace to break after Latin punctuation
...
This fixes cases such as `github.com`.
As we now require a space after Latin punctuation, we can remove
the list of Latin punctuation symbols and break on the space itself.
We still disallow linebreaks between consecutive fullwidth punctuation
symbols.
4 years ago
Gleb Mazovetskiy
e1dc7df3a5
Fix crash in `WordWrapString`
...
Fixes #3433
4 years ago
Gleb Mazovetskiy
8e5bc0597a
Don't line-break in the middle of a punct sequence
...
Also removes a redundant copy of the input string.
Fixes #3420
4 years ago
Gleb Mazovetskiy
e9a9daa794
DrawString: Stop allocating
...
Switch to a state-machine UTF-8 decoder from the branchless one.
This allows us to avoid copying the string on every `DrawString` call.
4 years ago
Gleb Mazovetskiy
3d308983a8
Migrate to libmpq
...
libmpq is a much simpler alternative to StormLib for reading MPQ archives.
We use our own fork of libmpq: https://github.com/diasurgical/libmpq
Impact:
* DevilutionX is now a lot more portable. Unlike StormLib, libmpq only
needs platform-specific code for Windows.
* Locks around file access **removed** (instead we duplicate the file descriptor for streamed audio only).
* RAM usage is **300 KiB** lower than StormLib.
* Stripped release linux_x86_64 binary is **32 KiB** smaller.
* Amiga build now hangs instead of crashing.
4 years ago
Gleb Mazovetskiy
9dd0474a52
DrawArt: Fix bounds check ( #3395 )
...
The bounds checks were performed against the global screen dimensions
instead of the output buffer dimensions.
Also includes some minor cleanup of DrawArt.
Fixes #3388
4 years ago
Gleb Mazovetskiy
117695489b
DrawArt: Fix bounds check ( #3395 )
...
The bounds checks were performed against the global screen dimensions
instead of the output buffer dimensions.
Also includes some minor cleanup of DrawArt.
Fixes #3388
4 years ago
Anders Jenbo
9cee65da6c
Correct calculation for KerningFitSpacing
4 years ago
Anders Jenbo
b227afc4c4
Do not render text past first encoding error
...
Continuing past the error allows for CTD attacks using special crafted
invalid UTF-8 with a multiby indicator at the end the string
4 years ago
Anders Jenbo
11e37e972a
Port essential parts to use SDL abstraction for file access
4 years ago
Gleb Mazovetskiy
dec45920eb
Text rendering: Support Zero-width space
...
Zero-width space is a non-printing character that indicates a word
boundary.
https://en.wikipedia.org/wiki/Zero-width_space
4 years ago
Anders Jenbo
5b3abbd315
Correct dialog font full width
4 years ago
Anders Jenbo
b3546e3254
Load full width kerning programmatically
4 years ago
Anders Jenbo
f022a341b0
Avoid crashing from missing fonts
4 years ago
Gleb Mazovetskiy
f4404e1452
WordWrapString: Also break on `,` U+FF0C (FULLWIDTH COMMA)
5 years ago
Gleb Mazovetskiy
0c694edaba
WordWrapString: Wrap on punctuation
...
Useful for Chinese and Japanese, which do not have spaces between words,
nor whitespace after punctuation.
5 years ago
Anders Jenbo
4dd8b121ec
Replace TTF with PCX font
5 years ago
Anders Jenbo
d0f70d5468
Correct loading of unicode fonts past row 09
5 years ago
Anders Jenbo
704a04ae4d
Add support for Unicode fonts
5 years ago
Alex
6df826eb02
Fix compiler warnings
5 years ago
Anders Jenbo
7771a08d03
Translatable mainpanel
5 years ago
staphen
09b8afba4e
Fix OOB error in DrawString
5 years ago
qndel
1f61b683a6
fix chat line wrapping
5 years ago
Anders Jenbo
41f6b62caa
Fix infinit loop if first word overflows the text box
...
Fixes #2829
5 years ago
Anders Jenbo
7169882b1f
✨ Implement new font rendering
5 years ago
Vladimir Olteanu
b17ff04ee2
Use string_view in DrawString and friends
5 years ago
ephphatha
0575716eac
Rename UiFlags members to group related options
5 years ago
ephphatha
4ad53232a0
Convert the UiFlags enum to a scoped enum type
...
Replace operator&& with named function
5 years ago
Anders Jenbo
2ca6e37c46
Clean up sub folders using clang-tidy/Android Studio
5 years ago