Commit Graph
7 Commits
Author SHA1 Message Date
Gleb Mazovetskiy 44ed0296d8 dun_render: Overhaul mask handling
We notice that masks can be described by 2 parameters:

1. Whether they have 0 or 1 as their high bits.
2. Whether they shift to the left or to the right on the next line.

Describing masks this way allows us to lift them to template variables and simplify the code.
We also avoid handling the mask in the `RenderLine` loop entirely.

Also fixes a foliage rendering bug: Transparent foliage pixels were previously blended but they should have been simply skipped.
2022-12-04 21:53:52 +01:00
Gleb Mazovetskiy bfc5639e6b Fix DVL_EXCEPTIONS on clang 2022-07-06 13:25:51 +01:00
Gleb Mazovetskiy b7404af9c7 Fix build with NONET and no exceptions
Fixes the build with `-fno-rtti` and `-fno-exceptions`.

Building with these flags reduces the binary size by more than 200 KiB.
2022-06-18 14:05:10 +02:00
ephphatha adba5c4441 Add hint to avoid bugprone-use-after-move warnings
Makes clang (and GCC) consider item.Clear() a reinitialisation of a moved variable - see https://clang.llvm.org/extra/clang-tidy/checks/bugprone-use-after-move.html#reinitialization
2022-04-19 09:54:19 +01: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
Gleb Mazovetskiy f624b9788c 🔥 Mark dun_render functions as hot 2021-05-13 01:54:27 +02:00
Gleb Mazovetskiy 4d10642b3d 🧹 Add and use a DVL_ALWAYS_INLINE macro
Also moves attribute macros out of miniwin into a new header.
2021-05-13 01:54:27 +02:00