Dmitry Marakasov
edc00041cd
Fix UB in random generator
...
abs(INT_MIN) is undefined behavior, so process this case without
calling abs()
4 years ago
ephphatha
4aa9a4bc5d
Expand hot area of stash cell to include bottom-right border
...
This matches the behaviour of inventory cell hit logic. Previously it was possible to click exactly on a border and be unable to put an item in the stash.
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
Gleb Mazovetskiy
4808d5c3ab
Reduce debug log output of OpenAsset
4 years ago
obligaron
c6c929a90c
Remove MpqDir and use PrefPath instead.
4 years ago
ephphatha
93068de918
Address type conversion warnings in WordWrapString
4 years ago
Gleb Mazovetskiy
2f22d94e0d
Remove `OwnedCelSprite::Unowned` method
...
Conversion is already provided by the `CelSprite(const OwnedCelSprite &)` constructor.
4 years ago
Gleb Mazovetskiy
e2dbbb3d95
CelSprite: Unify width storage
...
Reduces the size of a CelSprite by taking advantage of the fact that
16-bit pointers are aligned, so the last bit is always 0.
4 years ago
Gleb Mazovetskiy
f4bce38875
Use `uint16_t` for sprite widths
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
48ff656dc0
Load monster graphics into a single buffer
...
Follow-up to a5e1fa5bbe , which loaded
the missiles into a single buffer.
4 years ago
obligaron
79b926c375
Move more options to OptionEntryBase
4 years ago
Gleb Mazovetskiy
a5e1fa5bbe
Load missile frames into a single buffer
...
Previously, the memory for each frame was allocated separately.
Changes it to allocate a single buffer for all the frames.
This has the following advantages:
1. Less bookkeeping overhead in the allocator.
2. Less alignment overhead (allocator results are max-aligned by default).
We can follow this up with a similar treatment for other multi-file
animations.
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
ephphatha
fb21ffb635
Define a column major iterator for code requiring that iteration order.
...
GCC and specifically GCC6 really don't like inheriting common code, requires redefining almost everything.
4 years ago
ephphatha
c4c664c6be
Add class to allow iterating over all points in a rectangle
...
Co-authored-by: Gleb Mazovetskiy <glex.spb@gmail.com>
4 years ago
obligaron
2843d99485
Fix walk stuttering with Preview Frame
4 years ago
obligaron
75760382ef
Regard preview frame in AnimationInfo
4 years ago
obligaron
a7f361de41
AnimationInfo: Change TicksSinceSequenceStarted and relevantAnimationTicksWithSkipping to float
4 years ago
Gleb Mazovetskiy
e12adf689e
Fix windows build
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
obligaron
9a14edfcd9
Add OptionEntries for Hardware Cursor
4 years ago
Gleb Mazovetskiy
9bc9bb6d33
Fix demomode file comments
4 years ago
Gleb Mazovetskiy
1f2d67f98b
Fix demomode line endings
4 years ago
Gleb Mazovetskiy
076b0c0c05
Overhaul tests
...
1. Adds a `libdevilution_so` target when tests are enabled.
2. Each test file is now a separate binary target linked against `libdevilutionx_so` (can now run tests in parallel).
3. Tests are now defined in a separate `test/CMakeLists.txt` file.
4. Building the tests is now controlled by the standard `BUILD_TESTING` option (defined by CTest).
5. Tests are now built by default.
6. On CI, test errors are now reported.
Also:
* `.clang-format`: Enable SortIncludes in tests
* `path_test.cpp`: Fix -Wsign-compare
4 years ago
obligaron
5e2ad66e64
Add OptionEntry Resolution
4 years ago
Gleb Mazovetskiy
0f924528ba
macOS/iOS: Add resources to the bundle
4 years ago
obligaron
2e5a488d5f
Add OptionEntry for graphics
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
Gleb Mazovetskiy
fa90679416
game_assets.* -> assets.*
4 years ago
Gleb Mazovetskiy
720d210d95
utils/mpq* -> mpq/*
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