Gleb Mazovetskiy
112e113201
Optimize `DoCrawl`
...
Benchmark:
```
cmake -S. -Bbuild-reld -G Ninja -DCMAKE_BUILD_TYPE=RelWithDebInfo -DBUILD_TESTING=ON
cmake --build build-reld --target crawl_benchmark && build-reld/crawl_benchmark
```
Before:
```
------------------------------------------------------
Benchmark Time CPU Iterations
------------------------------------------------------
BM_Crawl/1 3.53 ns 3.53 ns 198384032
BM_Crawl/4 54.3 ns 54.2 ns 12907171
BM_Crawl/16 733 ns 732 ns 955101
BM_Crawl/20 1142 ns 1141 ns 613766
```
After:
```
------------------------------------------------------
Benchmark Time CPU Iterations
------------------------------------------------------
BM_Crawl/1 1.36 ns 1.36 ns 453018506
BM_Crawl/4 5.59 ns 5.59 ns 124244505
BM_Crawl/16 102 ns 101 ns 6577269
BM_Crawl/20 147 ns 147 ns 4684004
```
2 years ago
Gleb Mazovetskiy
c5788e5b08
Add a CLX rendering benchmark
...
```
----------------------------------------------------------------------------
Benchmark Time CPU Iterations UserCounters...
----------------------------------------------------------------------------
BM_RenderSmallClx 868 ns 866 ns 802315 bytes_per_second=2.04538Gi/s items_per_second=6.92446M/s
BM_RenderLargeClx 128208 ns 128032 ns 5434 bytes_per_second=716.703Mi/s items_per_second=7.81057k/s
```
2 years ago
Gleb Mazovetskiy
624afafe58
Extract Crawl to a library
...
Also adds a test and a benchmark
2 years ago
Gleb Mazovetskiy
e5c628db78
Add a test for Crawl order
2 years ago
Gleb Mazovetskiy
90732aa7be
Migrate objdat.cpp data to TSV
2 years ago
Gleb Mazovetskiy
e9c29fa806
Switch to ankerl::unordered_dense
2 years ago
Gleb Mazovetskiy
09e7cfea0e
Turn codec into a standalone library
2 years ago
Gleb Mazovetskiy
3b0cde6704
Turn utils/format_int into a standalone library
2 years ago
Gleb Mazovetskiy
495e583e64
Turn utils/file_util into a standalone library
2 years ago
Gleb Mazovetskiy
164dc9dc87
Turn util/parse_int into a standalone library
2 years ago
Gleb Mazovetskiy
3e22e8065b
Turn util/str_* into a standalone library
2 years ago
Gleb Mazovetskiy
713c04838c
Turn utils/utf8 into a standalone library
2 years ago
Gleb Mazovetskiy
e078b46fec
Remove static_bit_vector
2 years ago
Gleb Mazovetskiy
ee8ca1c005
Greatly simplify outline rendering
...
The new algorithm is a lot less code, slightly faster, and results
in a smaller binary (-40 KiB on rg99).
The previous algorithm filled all the pixels around every solid pixel.
The new algorithm only fills pixels that will be visible.
We first collect the outline pixels into an array (which may contain a
small amount of duplicates). Then, we render the entire array in a
single loop. This turns out to be slightly faster than rendering inline,
at the cost of ~4 KiB of stack (basically free).
To collect the pixels, we go through the CLX sprite, keeping track
of the solid runs in the current row, and the filled pixels on the line
above and the line below.
To be able to quickly test the pixels above and below, we introduce a
new data structure, `StaticBitVector`. It is similar to a bitset,
except the size is determined at runtime (capacity is fixed),
and it supports quick updates of entire subspans.
2 years ago
Anders Jenbo
d36347f162
Record new timedemo with updated south walk behaviour
2 years ago
KPhoenix
fc6f9edad3
Update pack_test.cpp
2 years ago
Andrew James
6b2a0c4b7a
Remove conditionals for OOB reads that aren't hit in normal gameplay
...
Reworded and added comments explaining what would've happened and calling out the case that is still technically possible.
2 years ago
staphen
9e682afe13
Rename glSeedTbl
2 years ago
staphen
bc4f43490f
Load objcurs when creating starting items
2 years ago
Gleb Mazovetskiy
dc59cdaee4
Extract objcurs widths into a file
...
Read from the widths file when using the original CEL.
When using CLX, use width in CLX.
2 years ago
obligaron
95205294e8
Fix MSVC x86 warnings
2 years ago
Gleb Mazovetskiy
124d113b57
Extract spell data to a TSV
2 years ago
obligaron
dc85e7db43
Introduce GetDunSize
2 years ago
obligaron
79a43dc1de
Introduce AddMissile overloads specific for player and monster
2 years ago
KPhoenix
b8738ab4cf
Validation: Validate Item Drop Packets
2 years ago
Gleb Mazovetskiy
17f95a04da
Migrate missile sprite data to txtdata
2 years ago
Gleb Mazovetskiy
f566359e4f
Migrate item data to txtdata/
2 years ago
Gleb Mazovetskiy
2eae121931
Migrate monstdat to a data file
...
We may want to migrate this to 1 file per monster but for now the
migration is as close to the hard-coded version as possible.
Sprites that are used by multiple monsters are only loaded from disk
once.
2 years ago
ephphatha
415302fdfa
Go back to using int for missile frame comparison values
...
The code that the gmock macros end up generating appears to obscure the type mismatch so there's no warning (in msvc on my system anyway) no matter what types are involved, for clarity the comparison ends up being between std::pair<int, unsigned int> and testing::Pair<int, testing::AllOf<testing::Matchers<unsigned int>>>
2 years ago
obligaron
2b15eb8d03
Fix MSVC warnings from headers
2 years ago
obligaron
9bf1fd48b0
Fix a few MSVC warnings ( #6782 )
2 years ago
Gleb Mazovetskiy
e10f46864e
clang-format: single-line functions and if guards
2 years ago
Gleb Mazovetskiy
de6eac137b
Split up lua bindings a bit
...
```lua
local render = devilutionx.render
local function drawGreet ()
render.string("Hello from " .. _VERSION, 10, 40)
end
Events.OnGameDrawComplete.Add(drawGreet)
```
2 years ago
Anders Jenbo
706010ee45
Add Lua support
2 years ago
ephphatha
d13bed2a78
Fix broken test case
3 years ago
ephphatha
6a8f4b12da
Get base block bonus from data struct instead of storing a copy
3 years ago
ephphatha
c1f3dcb705
Use safer versions of random number functions instead of GenerateRnd
3 years ago
Andrew James
bb16b93836
move definition of non-templated function to cpp file ( #6620 )
3 years ago
ephphatha
3fda0586bd
Add support for parsing fixed point decimal strings
3 years ago
ephphatha
f3de9d6e71
Use dedicated error enum for parsing failures
3 years ago
Eric Robinson
c754d95ecc
Fix various Automap drawing issues ( #6555 )
3 years ago
Eric Robinson
0f3c74af33
Avoid rounding issues in automap and allow an extra zoom out step
3 years ago
Gleb Mazovetskiy
b28bbd65ad
Fix some compilation warnings
...
```
data_file_test.cpp:37:20: warning: suggest explicit braces to avoid ambiguous ‘else’ [-Wdangling-else]
37 | if (!result.endOfFile())
| ^
```
```
Source/engine/render/dun_render.cpp:1126:6: note: variable tracking size limit exceeded with ‘-fvar-tracking-assignments’, retrying without
1126 | void RenderTile(const Surface &out, Point position,
```
3 years ago
staphen
a151219b9b
Don't validate creation flags on gold
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
ephphatha
5f6e5ae9fb
Refactor iterator parsing to allow more reuse
3 years ago
staphen
4deae11871
Fix PlayerNetPack validation and tests
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
Anders Jenbo
bf7135dd11
Adjust tests to work with data driven levels ( #6509 )
...
Co-authored-by: staphen <staphen@gmail.com>
3 years ago