Anders Jenbo
dbfd1fc91f
Revert "dun_render: Add `DunTileColorMap` for baked light"
...
This reverts commit 827eb9705d .
3 years ago
Anders Jenbo
31bd9790d8
Revert "Rendering: Unify and optimize pixel blitters"
...
This reverts commit 397529bf0f .
3 years ago
Gleb Mazovetskiy
14e32bd8f3
`DrawDungeon`: Remove `dRendered` check
...
This check was only needed when the tile to the east was drawn first.
Checks for this with a single bool rather than a whole bitset.
3 years ago
Gleb Mazovetskiy
827eb9705d
dun_render: Add `DunTileColorMap` for baked light
...
Refs #6631
3 years ago
ephphatha
c1f3dcb705
Use safer versions of random number functions instead of GenerateRnd
3 years ago
Gleb Mazovetskiy
4c87f335ac
`DrawDungeon`: Move checks out of `DrawObject/Item`
...
Avoids calling `FindObjectAtPosition` and similar pre-checks twice.
3 years ago
Gleb Mazovetskiy
e5c426c315
Make `IsWall` easier for the compiler to inline
...
This appears to be a very hot function.
Makes it fully inlineable (even in Debug mode).
3 years ago
Eric Robinson
d63fa514ab
Automap: Pentagram ( #6606 )
3 years ago
Gleb Mazovetskiy
b83637add8
Use a C array for transparency LUT for debug perf
...
In a debug build, `std::array` accesses are function calls.
Timedemo on my machine:
* Before: 45.39 seconds 141.3 FPS
* After: 40.20 seconds 159.5 FPS
3 years ago
Gleb Mazovetskiy
b64ee0e190
Use `if constexpr` in clx/dun_render
3 years ago
Gleb Mazovetskiy
16a6fc62e1
Deduplicate some of the MPQ handling
...
Reuse libmpq functions where possible instead of our own.
3 years ago
Gleb Mazovetskiy
0f77cc3797
Force-inline methods to improve debug build perf
...
This has little or no effect on the optimized build
but significantly improves performance of the headless debug build
`timedemo_test` on my machine goes from 3s to 2s.
3 years ago
Gleb Mazovetskiy
70ff515f48
Stream demo messages
...
This entirely eliminates the demo memory overhead.
3 years ago
Gleb Mazovetskiy
65e0ad88d2
Further reduce demo file size
...
The vast majority of events are rendering events:
Type | Count
-------------|------:
Rendering | 58,971
MouseMotion | 19,651
GameTick | 6,414
MouseButton | 516
Key | 7
Custom | 1
Encodes Rendering events in a single byte when possible.
Demo file size: 253,410 bytes -> 194,439 bytes
3 years ago
Gleb Mazovetskiy
d31a7b5c2c
Log Demo settings
3 years ago
Gleb Mazovetskiy
62e9aa0448
`MissilePosition`: Use `WorldTilePosition`
...
Reduces struct size and makes the types of coordinates more obvious.
3 years ago
Gleb Mazovetskiy
5355146d51
Use structured bindings
3 years ago
Stephen C. Wills
5e778431c3
Deterministic timer simulation for shrine messages in demo mode ( #6516 )
3 years ago
Gleb Mazovetskiy
eb51a8beb3
Reduce demo message size
...
`DemoMsg` struct and event data are now kept separately.
RAM usage for the timedemo messages: -85% (1.8 MiB -> 261 KiB)
Demo (`.dmo`) file size: -57% (590,790 bytes -> 253,410 bytes)
3 years ago
Stephen C. Wills
45dbe6aa61
Shift software cursor graphic and remove special casing ( #6512 )
3 years ago
Gleb Mazovetskiy
4a4735e908
`string_view`-based asset lookup
...
Changes asset lookup functions to use `std::string_view` instead of
`const char *`.
This required new APIs in libmpq, added in
https://github.com/diasurgical/libmpq/pull/13 .
3 years ago
Gleb Mazovetskiy
9ae72f0269
Remove `PointsInRectangle` factory functions
...
These are no longer needed in C++17 thanks to CTAD.
3 years ago
Gleb Mazovetskiy
ba4def9382
Use utils/algorithm/container.hpp in more places
3 years ago
Gleb Mazovetskiy
cbf51cd5ab
`DrawStringFormatArg`: Use `std::variant`
3 years ago
staphen
ab1af87bc9
Fix issues with light offset calculation
3 years ago
Gleb Mazovetskiy
26f42520fa
Fix unused variable warnings
3 years ago
Gleb Mazovetskiy
8c1a847f41
Remove utils/stdcompat/string_view.hpp
3 years ago
Gleb Mazovetskiy
c19bfe87fa
Remove utils/stdcompat/algorithm.hpp
3 years ago
Gleb Mazovetskiy
14540164a7
Remove utils/stdcompat/optional.hpp
3 years ago
Gleb Mazovetskiy
62d067b653
Remove utils/stdcompat/abs.hpp
3 years ago
Gleb Mazovetskiy
74755c8be7
Remove utils/stdcompat/cstddef.hpp
3 years ago
qndel
b5ab3a10a2
correct IsTileWalkable to mark tiles out of bounds as not walkable
3 years ago
obligaron
f59e3aaffb
Introduce IsPointWithinClx
3 years ago
obligaron
d5642daeb4
Introduce GetScreenPosition
3 years ago
obligaron
ac7c96b33f
Introduce PointOf operator /=
3 years ago
obligaron
578ce01432
Introduce Towner/Player/Object/Item/Monster::currentSprite/getRenderingOffset
3 years ago
Gleb Mazovetskiy
7a5e5f73e6
Support language-specific font variants
...
Refs #3538
3 years ago
Gleb Mazovetskiy
8101e2c0ba
Add `c_any_of` and friends
...
Adds handy helpers for performing algorithms on the entire container.
They're prefixed with `c_` for container.
This naming convention is identical to some popular C++ libraries, such
as Abseil.
3 years ago
Gleb Mazovetskiy
999f44cf07
Point: Safer `operator-`
...
1. Require both operands to have the same signedness to avoid surprises.
2. Only allow unary negation on signed points.
Fixes #6409
Also fixes a potential bug in the sound position calculation.
3 years ago
Anders Jenbo
64d7af2937
Fix loading new demo files and give better error messages when failing
3 years ago
Gleb Mazovetskiy
d6b7949dab
Fonts: Use pre-cropped CLX sprites
...
Built-in font size decreased by 121,587 bytes
(2,287,332 -> 2,165,745).
Fixes #6361
3 years ago
DakkJaniels
ad19caf667
Move hp/mana display and item graphics to gameplay options
3 years ago
Gleb Mazovetskiy
d8cd147ac7
Re-encode CL2 on load
...
Original Blizzard encoder is slightly less optimal than our encoder.
While size in RAM in less of a concern for the non-`UNPACKED_MPQS`
build, smaller files are faster to render.
Savings for unpacked and minified MPQs:
* diabdat.mpq: 918,311 bytes.
* hellfire.mpq: 313,882 bytes.
Example player graphics (note that only a few are loaded at any given time for single player):
* diabdat/plrgfx/warrior/: 366,564 bytes.
Example monster graphics savings:
* diabdat/monsters/skelbow: 5,391 bytes.
Based on the implementation from https://github.com/diasurgical/devilutionx-graphics-tools/pull/6
3 years ago
Gleb Mazovetskiy
14ce84b056
Fix CLX outline clipped rendering on the right
...
The actual fix is the diff in `RenderClxOutlineRowClipped`.
The rest is a refactorings that make the code easier to
follow.
Fixes #6199
3 years ago
Anders Jenbo
e8910bb3d7
Do not crash on missing fonts
3 years ago
Gleb Mazovetskiy
936b3bd45a
Demomode: Store/override gameplay options
3 years ago
Gleb Mazovetskiy
750cebc561
Delay reinitializing hwcursor until fade 1
...
With fade 0 the cursor is never visible because everything is black.
While this is a very minor optimization, it works around
one of the instances of a bug in certain drivers as seen in #5618 .
3 years ago
qndel
c362808165
debug path command ( #6101 )
3 years ago
Anders Jenbo
1d90730b0a
Correct use of local instead of global lightTableIndex
...
It looks like this was mistakenly using LightTableIndex instead of lightTableIndex. Found by @qndel
3 years ago
qndel
3500dc1861
code cleanup
3 years ago