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
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
c5e6bf630f
demomode.cpp: Set `mouse.*.which` to 0
...
Otherwise it can end up as `-1`, triggering the `VirtualGamepad` input
type (-1 is `SDL_TOUCH_MOUSEID`).
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
staphen
c7766cfc96
Fix the path used for streaming in LoadAudioFile()
3 years ago
Gleb Mazovetskiy
1a1a282d9a
Use C FILE instead of C++ streams throughout
...
Reduces binary size by ~2 KiB and may improve compatibility with oddball
systems (e.g. PS2).
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
Gleb Mazovetskiy
e87f68b2b5
Open fewer files concurrently at load time
...
For `MultiFileLoader` and `LoadMultipleCl2Sheet`, we now open one file
at a time.
This can help on platforms that limit the number of concurrently open
files, such as the PS2.
3 years ago
staphen
b46482f414
Clear padmapper state when changing event handlers
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
0e0cc9d1b0
Reduce to just `STREAM_ALL_AUDIO_MIN_FILE_SIZE`
...
This does result in a bit more code and RAM usage for soundsample when
`STREAM_ALL_AUDIO` is on, but not by much.
3 years ago
Gleb Mazovetskiy
0dd95adcd1
Add a minimum threshold for STREAM_ALL_AUDIO
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
Gleb Mazovetskiy
6b338eac9f
Display path in `LoadAudioFile` error dialog
3 years ago
Gleb Mazovetskiy
6d274c9547
`UNPACKED_SAVES`: Saves without MPQs
...
Reduces rg99 binary size by ~70 KiB.
3 years ago
KPhoenix
8db521727d
`enum missile_id` -> `enum class MissileID`
...
Changes `enum missile_id` to `enum class MissileID`
3 years ago
Anders Jenbo
e50e21e0e4
Use outline for spell icon texts
3 years ago
Anders Jenbo
bb2463862c
Use Position in AddItemToLabelQueue()
3 years ago
Anders Jenbo
a29fc3a074
Correct casing for Player::isWalking()
3 years ago
Gleb Mazovetskiy
5bf9dfd7ee
Demo mode: Force resolution to that of the demo
3 years ago
ephphatha
9da76e0003
Update CheckReflect to return applied damage
...
Instead of modifying the damage value by reference
3 years ago
qndel
efaf334965
typos and code cleanup
3 years ago