Anders Jenbo
098e9a34ca
Poormans profiler
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
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
45dbe6aa61
Shift software cursor graphic and remove special casing ( #6512 )
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
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
obligaron
f59e3aaffb
Introduce IsPointWithinClx
3 years ago
obligaron
d5642daeb4
Introduce GetScreenPosition
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
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
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
Anders Jenbo
6998906b32
Hellfire: let light affect the player
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
Gleb Mazovetskiy
8408743eed
Draw item labels before the monster health bar
...
Fixes #5867
3 years ago
Gleb Mazovetskiy
3f0d089928
Blitter: Minor optimization
...
`src < end - 3` is one more instruction than `src + 3 < end`.
Godbolt: https://godbolt.org/z/PPfhYYWG8
RG-99 binary becomes 224 bytes smaller.
3 years ago
Gleb Mazovetskiy
e81f8affba
Fix rendering issues introduced by #5913
...
Fixes #5914
3 years ago
Gleb Mazovetskiy
774993c6d0
dun_renderer: Avoid calling 0-width `Blit*`
...
A slight optimization to avoid calling blit functions entirely
when the width is zero.
3 years ago
Gleb Mazovetskiy
397529bf0f
Rendering: Unify and optimize pixel blitters
...
1. Unifies the underlying CLX and dun_render blitters.
2. Optimizes them by unrolling loops and using pointer comparison rather
than length comparison (saves a length decrement).
3. In `dun_render`, extracts `RenderLineTransparent/Opaque` branches into
functions via explicit template specialization.
Example RG-99 FPS (non-PGO'd): 17.4->18.4
3 years ago
obligaron
36ecc50fcb
Always use infravision in Arenas
3 years ago
Gleb Mazovetskiy
957bd03b98
Remove `FMT_COMPILE` in "cold" places
...
Removes most `FMT_COMPILE` calls.
`FMT_COMPILE` results in better performance but larger code size.
Removes `FMT_COMPILE` calls for places that are called infrequently,
i.e. not on every frame.
RG-99 binary size reduced by ~4 KiB.
3 years ago
Gleb Mazovetskiy
f7580f188c
Fix multiline `DrawStringWithColors` alignment
...
For center or right alignment, the lines past the first line were
aligned incorrectly. The alignment was based on the width of the
format string.
3 years ago
KPhoenix
a1fbf5253f
`enum talk_id` -> `enum class TalkID`
3 years ago
Gleb Mazovetskiy
98294e0ad5
Optimize `MissileData`: 32 bytes -> 24
...
23 bytes used, 1 spare byte in the padding.
3 years ago
Gleb Mazovetskiy
0a6a8e8aa0
Clean up missile data access
...
Replace enum static casts with `GetMissile(Sprite)Data`.
3 years ago
KPhoenix
7947b99511
Implement new enum class
3 years ago
Gleb Mazovetskiy
1788d2f8ec
Remove miniwin
...
Event handling code moved to `engine/events.{hpp,cpp}`.
3 years ago
staphen
dd6ce177f7
Derive viewport geometry from player position
3 years ago
Gleb Mazovetskiy
527e876fff
Disable item labels when in store
...
Also disable ground item outlines on hover when in store.
3 years ago
Anders Jenbo
c99f7cf644
Floating numbers ( #5639 )
...
Co-authored-by: qndel <stefan551@o2.pl>
Co-authored-by: Stephen C. Wills <staphen@gmail.com>
3 years ago