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
Gleb Mazovetskiy
5bf0b8bc96
Add more missing <cstdint> includes
...
https://github.com/diasurgical/devilutionX/pull/6095 only added includes
for `uint32_t`, this PR also adds the includes for the remaining
integral types.
3 years ago
Gleb Mazovetskiy
4fa3732526
Add missing <cstdint> includes
...
Done with the following script:
```ruby
Dir["Source/**/*.{h,c,cc,cpp,hpp}"].each do |path|
v = File.read(path)
next if !v.include?("uint32_t") || v.include?("cstdint")
lines = v.lines
line_num = if lines[2].start_with?(" *")
lines.index { |l| l.start_with?(" */") } + 3
else
3
end
lines.insert(line_num, "#include <cstdint>\n")
File.write(path, lines.join(""))
end
```
then fixed-up manually
3 years ago
ephphatha
c3a8a95813
use stdlib lcg type
3 years ago
ephphatha
3bbb80d849
Introduce temporary function to advance the global rng state and discard results
3 years ago
ephphatha
b98e5fcfad
split logic responsible for advancing global generator state to a dedicated function
...
Exposing this also allows updating the engine test case to avoid peeking at the engine state after a roll, also will be useful for setting item/object seeds
3 years ago
Anders Jenbo
b7424a0068
Clean up PmChangeLightOff()
3 years ago
Anders Jenbo
6998906b32
Hellfire: let light affect the player
3 years ago
qndel
216febfe8a
fix rotating right ( #6020 )
3 years ago
qndel
731ad1ada5
use std::rotate ( #6019 )
3 years ago
Anders Jenbo
dc2d97c112
Split lighting shades from trn tables
3 years ago
Anders Jenbo
ec9d1b5550
Rename _oLight to applyLighting
3 years ago
Gleb Mazovetskiy
ac0627f029
Add a debug function that describes a CLX
...
Example output (also demonstrates a bug in our encoder):
CLX sprite: 16x20 pixelDataSize=97b
command | width | bytes | color(s)
--------|------:|------:|---------
Transp. | 80 | 1 |
Pixels | 2 | 3 | 203 199
Fill | 3 | 2 | 202
Pixels | 2 | 3 | 199 201
Fill | 1 | 2 | 205
Transp. | 8 | 1 |
Pixels | 3 | 4 | 205 199 196
Fill | 4 | 2 | 197
Fill | 1 | 2 | 202
Transp. | 9 | 1 |
Pixels | 6 | 7 | 206 199 197 203 206 202
Fill | 1 | 2 | 204
Transp. | 10 | 1 |
Pixels | 4 | 5 | 206 199 197 205
Fill | 1 | 2 | 207
Transp. | 12 | 1 |
Pixels | 3 | 4 | 206 197 197
Fill | 1 | 2 | 205
Transp. | 9 | 1 |
Pixels | 7 | 8 | 207 205 203 206 206 197 197
Fill | 1 | 2 | 206
Transp. | 8 | 1 |
Pixels | 3 | 4 | 204 197 199
Fill | 1 | 2 | 205
Transp. | 1 | 1 |
Pixels | 2 | 3 | 202 197
Fill | 1 | 2 | 204
Transp. | 8 | 1 |
Pixels | 7 | 8 | 206 197 199 207 206 199 196
Fill | 1 | 2 | 205
Transp. | 9 | 1 |
Pixels | 1 | 2 | 203
Fill | 4 | 2 | 197
Fill | 1 | 2 | 202
Transp. | 10 | 1 |
Pixels | 5 | 6 | 207 205 199 199 203
Fill | 1 | 2 | 207
Transp. | 89 | 1 |
3 years ago