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
Juliano Leal Goncalves
7da37da8c9
♻️ Leverage 'Point' in 'RenderTile' function
5 years ago
Juliano Leal Goncalves
bb2dfdfb73
🚚 Rename 'ItemStruct' to 'Item'
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
24d0d37d26
Add drop shadow to DrawMapLineSteep
5 years ago
ephphatha
b680e3fef1
Align end comment markers for doxygen comments
...
Including a bunch from previous PRs (since I was responsible for the broken formatting for most 😓 )
5 years ago
Anders Jenbo
2ca6e37c46
Clean up sub folders using clang-tidy/Android Studio
5 years ago
Anders Jenbo
dce78dde62
Rename lighting globals
5 years ago
Gleb Mazovetskiy
55464eec78
Fix `-Wmissing-braces`
...
Fixes warnings such as this one:
```
../../../../../../Source/engine/render/text_render.hpp:83:33: warning: suggest braces around initialization of subobject [-Wmissing-braces]
return DrawString(out, text, { position.x, position.y, out.w() - position.x, 0 }, flags, spacing, lineHeight, drawTextCursor);
^~~~~~~~~~~~~~~~~~~~~~
```
5 years ago
Gleb Mazovetskiy
cb0dae8590
🚚 Rename `CelOutputBuf` to `Surface` and extract
5 years ago
qndel
a1710ff51e
pass item to CelDrawItem ( #2265 )
...
pass item to CelDrawItem
5 years ago
Anders Jenbo
8e07ef8fe5
Clang-tidy: misc-unused-parameters
5 years ago
Anders Jenbo
2bdb6caa07
Cleanup majority of remaning implicit bool conversions ( #2234 )
5 years ago
Anders Jenbo
2417d3d333
🔥 Remove unused code
5 years ago
Anders Jenbo
af254601d6
♻️ Apply clang-tidy to engine
5 years ago
Andrew James
60a47caf1b
Refactor Draw* functions to use Rectangle and Point types
...
Added overload for DrawString taking a Point to avoid creating a rect for callers which only use position. This also documents the way DrawString operates when passed a clipping rectangle with a dimension of 0.
As part of this overload removed the logic for 0 width regions from DrawString. This does change the behaviour of the Rectangle version if called with a rect with width 0, all callers using that behaviour have been updated in this commit.
Using Rectangle/Size allowed simplifying the logic for certain calls where they could use DrawText alignment flags, previously this was manually aligning by calculating dimensions and offsetting the position. This also fixes #2169
Also includes a few instances where a temporary buffer was used to set the text to be drawn with unbounded sprintf calls, replaced those with snprintf as is recommended in modern C applications. Moving to C++ strings would be good in a future refactor.
5 years ago
Gleb Mazovetskiy
14218080b6
🚚 engine.h: Extract `CelGetFrame` and friends
5 years ago
Gleb Mazovetskiy
e40b1963f9
🚚 engine.h: Extract `CelSprite` and file loading
5 years ago
Gleb Mazovetskiy
f9f301b054
🚚 engine.h: Extract `Point`, `Direction`, `clamp`
...
`engine.h` is getting quite bloated. Moves this code to their own files.
5 years ago
ephphatha
b478d8295c
Remove dead code, FreeText() is never called
...
Given the program already lets the destructors get called naturally there's no need to explicitly call this function. Even if it was desirable to re-init the font data the old instances will be destroyed when the new instance is assigned to the optional.
5 years ago
Chance4us
608c231f46
Draw black drop shadow for automap ( #2090 )
5 years ago
Kalebe Alves
118efe8e6d
Use Point/SDL_Rect for control functions coordinate system
5 years ago
Kalebe Alves
0461529176
Move byte from engine.h
5 years ago
qndel
b1d74d2791
alt highlighting ( #2060 )
5 years ago
Anders Jenbo
6ce8f13751
Apply clang-tidy to more code and do some related cleanups
5 years ago
Gleb Mazovetskiy
b76f7656f3
🧹 LoadArt: BYTE -> uint8_t
...
The change in include order necessitated a couple of other minor
cleanups, one in stubs.h and one in sdl2_to_1_2_backports.h
5 years ago
qndel
69b903743a
fix typos
5 years ago
qndel
faae9a65c7
fix typos ( #2038 )
5 years ago
Gleb Mazovetskiy
bb95e0c337
cl2_render: Use memset when rendering outline
...
A minor cleanup that replaces the for-loop rendering for a fill run
with memsets.
5 years ago
Anders Jenbo
6acb49bea4
Render quest and menu text using common text rendering
5 years ago
Anders Jenbo
4c6ddc79a1
Clean up text render
5 years ago
Anders Jenbo
a03a2c2634
Render chat panel using common text rendering
5 years ago
Anders Jenbo
d723ebce1a
Render help text using common text rendering
5 years ago