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
thebigMuh
7fbcfeb35c
Adding text rendering flag to adjust spacing to fit horizontally
...
Now also works for multiline strings
5 years ago
Anders Jenbo
18aa04fa4f
♻️ Use common text rendering for store menus
5 years ago
qndel
610d5319bd
swap if in drawing inventory items ( #1968 )
5 years ago
qndel
89c40eaa7b
inventory items rendering cleanup ( #1938 )
5 years ago
Gleb Mazovetskiy
8ac9047b4f
🧹 Clean up CEL outline clipping
...
A simpler structure based on the CL2 implementation.
5 years ago
Anders Jenbo
7667880de4
🐛 Implement letter spacing in new font rendering
...
Fixes #1950
5 years ago
Gleb Mazovetskiy
29a488738e
🔥 Mark core CL2 and CEL functions as inline hot
5 years ago
Gleb Mazovetskiy
f624b9788c
🔥 Mark `dun_render` functions as `hot`
5 years ago
Gleb Mazovetskiy
4d10642b3d
🧹 Add and use a DVL_ALWAYS_INLINE macro
...
Also moves attribute macros out of miniwin into a new header.
5 years ago
Gleb Mazovetskiy
e53a79259d
🐞 CL2 outline: Fix left clip
5 years ago
Gleb Mazovetskiy
537e056111
🐞 CL2 outline: Skip color index 0
...
Fixes a regression introduced in #1934
5 years ago