Commit Graph
215 Commits
Author SHA1 Message Date
ephphatha 01ee2ecefc Pretty print Size values in test failure messages 2022-06-02 15:29:18 +02:00
ephphatha d5622d5080 Add point constructor to allow comparison in test macros 2022-06-02 15:29:18 +02:00
qndel f84c35d2dc fix typos 2022-06-01 17:12:22 +02:00
Andrew James 1047e408bd Simplify logic of UpdateMissilePos using helpers from 4620 (#4621) 2022-05-31 06:58:47 +02:00
Anders Jenbo 0508311959 Cleanup block_lvid checks 2022-05-29 22:32:14 +02:00
Dmitry Marakasov 04d0950c9e Fix UB in random generator
abs(INT_MIN) is undefined behavior, so process this case without
calling abs()
2022-05-18 04:40:54 +02:00
Gleb Mazovetskiy 961e1b584b Always load fonts as CEL
There appear to be no drawbacks, only advantages.
2022-04-25 05:31:26 +01:00
Gleb Mazovetskiy c2917b1dc8 DiabloUi: Load animated PCX sprites as CEL
Reduces memory usage in menu (and thus the overall allocator pressure)
2022-04-25 05:31:26 +01:00
Gleb Mazovetskiy 978bae1a15 Add a helper for loading PCX as CEL from path 2022-04-25 05:31:26 +01:00
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.
2022-04-25 05:31:26 +01:00
obligaron b62cacd1d6 Demomode: Init ControlMode to KeyboardAndMouse 2022-04-23 05:32:01 +02:00
ephphatha 6a04d441c1 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.
2022-04-14 18:02:56 +02:00
Gleb Mazovetskiy a66ca44695 Zero-based frame indexing
Index frames starting at 0 instead of 1.
2022-04-14 04:39:26 +01:00
Gleb Mazovetskiy ade8aba822 Fix some more warnings 2022-04-14 01:26:29 +02:00
Vladimir Olteanu 25d412d1ac Remove duplicate code in DoLighting 2022-04-14 01:21:18 +02:00
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.
2022-04-12 01:52:53 +02:00
Gleb Mazovetskiy 4808d5c3ab Reduce debug log output of OpenAsset 2022-04-11 23:35:03 +02:00
obligaron c6c929a90c Remove MpqDir and use PrefPath instead. 2022-04-10 17:06:45 +02:00
ephphatha 93068de918 Address type conversion warnings in WordWrapString 2022-04-03 14:56:01 +02:00
Gleb Mazovetskiy 2f22d94e0d Remove OwnedCelSprite::Unowned method
Conversion is already provided by the `CelSprite(const OwnedCelSprite &)` constructor.
2022-03-23 10:09:18 +01:00
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.
2022-03-23 09:57:33 +01:00
Gleb Mazovetskiy f4bce38875 Use uint16_t for sprite widths 2022-03-06 04:49:13 +01:00
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.
2022-03-06 04:49:13 +01:00
qndel 9ba64ad08b TRN rewrite + bugfix (#4056)
* working new TRN system
* apply TRNs to all unique missiles
2022-02-20 14:28:51 +01:00
Gleb Mazovetskiy 48ff656dc0 Load monster graphics into a single buffer
Follow-up to a5e1fa5bbe, which loaded
the missiles into a single buffer.
2022-02-17 22:02:41 +00:00
obligaron 79b926c375 Move more options to OptionEntryBase 2022-02-05 20:51:54 +01:00
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.
2022-02-01 04:04:59 +00:00
Gleb Mazovetskiy 1519e995cf Move store graphics out of stores.cpp
These graphics are used in various places outside of `stores.cpp`.
2022-01-30 14:56:04 +01:00
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.
2022-01-19 03:05:27 +01:00
ephphathaandGleb Mazovetskiy c4c664c6be Add class to allow iterating over all points in a rectangle
Co-authored-by: Gleb Mazovetskiy <[email protected]>
2022-01-19 03:05:27 +01:00
obligaron 2843d99485 Fix walk stuttering with Preview Frame 2022-01-15 14:40:35 +01:00
obligaron 75760382ef Regard preview frame in AnimationInfo 2022-01-12 12:26:39 +01:00
obligaron a7f361de41 AnimationInfo: Change TicksSinceSequenceStarted and relevantAnimationTicksWithSkipping to float 2022-01-12 12:26:39 +01:00
Gleb Mazovetskiy e12adf689e Fix windows build 2022-01-06 13:43:01 +00:00
KPhoenixandAnders Jenbo a08026097a Chat Interface Revision (#3840)
Co-authored-by: Anders Jenbo <[email protected]>
2021-12-25 10:11:42 +00:00
Anders Jenbo b6bdbcfc98 Stip stippled transparency 2021-12-21 12:55:30 +01:00
obligaron 9a14edfcd9 Add OptionEntries for Hardware Cursor 2021-12-17 20:12:17 +01:00
Gleb Mazovetskiy 9bc9bb6d33 Fix demomode file comments 2021-12-17 16:27:19 +00:00
Gleb Mazovetskiy 1f2d67f98b Fix demomode line endings 2021-12-17 16:27:19 +00:00
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
2021-12-16 20:26:51 +00:00
obligaron 5e2ad66e64 Add OptionEntry Resolution 2021-12-08 00:37:06 +01:00
Gleb Mazovetskiy 0f924528ba macOS/iOS: Add resources to the bundle 2021-12-05 20:33:24 +01:00
obligaron 2e5a488d5f Add OptionEntry for graphics 2021-12-05 02:00:27 +01:00
Gleb Mazovetskiy 1de202cfe0 DrawString: Fix IsCJK definition
Fix IsCJK to include Hiragana, Katakana, Bopomofo, etc.
2021-11-27 15:11:52 +01:00
Gleb Mazovetskiy 48ddb2ea06 DrawString: Fix line height for tall codepoints 2021-11-27 15:11:52 +01:00
obligaron 6273f700fa Add some Graphic Settings to Settingsmenu (#3617) 2021-11-27 00:25:48 +01:00
Gleb Mazovetskiy 1425bec3e4 Add missing GetLineWidth declaration to header 2021-11-25 12:22:27 +01:00
Gleb Mazovetskiy bffe7dd071 DrawStringWithColors: Fix {} support 2021-11-25 12:22:27 +01:00
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.
2021-11-25 12:22:27 +01:00
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.
2021-11-25 00:26:16 +00:00