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
KPhoenix
75d785a5f0
Bugfix: AnimationInfo integer division by 0
3 years ago
obligaron
5b11dfa2ed
Fix preview frame shown fragment overflow
3 years ago
Gleb Mazovetskiy
fab6f362c3
Point: Avoid construction in distance functions
...
This reduces the runtime of timedemo_test by 25% in debug mode.
Makes no difference to optimized mode of course.
3 years ago
Gleb Mazovetskiy
9b1ff3d50b
demomode.cpp: Fix creating a bogus event
...
The `eof()` does not return true until a failed read attempt.
> Note that the value returned by this function depends on the last operation performed on the stream (and not on the next).
3 years ago
Gleb Mazovetskiy
45757856c1
DemoMode: Add a debug define to log events
3 years ago
obligaron
5180bd02b4
Timedemo: don't update ProgressToNextGameTick in pause menu
3 years ago
obligaron
028f630848
Timedemo: don't play and record messages in loading screens
3 years ago
obligaron
6e08ad658f
Timedemo: represent game tick progress as uint8_t
3 years ago
Gleb Mazovetskiy
f4b8edb5dc
Surface.pitch(): int -> uint16_t
3 years ago
Gleb Mazovetskiy
e06ca9a016
dun_render: Remove unused argument from RenderTile
...
Now that we pass the mask into `RenderTile`, we no longer need to pass
`levelPieceId`.
3 years ago
Gleb Mazovetskiy
9a1587060d
Use real `CalculateSoundPosition` with NOSOUND
...
Fixes big-endian tests, which currently build with `-DNOSOUND`
to reduce build time.
3 years ago
Gleb Mazovetskiy
cffb2566df
Fix timedemo on SDL1
3 years ago
Gleb Mazovetskiy
aa2f88e5f6
Remove software cursor state for hardware cursor
...
Switching between software and hardware cursor could cause a glitch
as described in #5560 .
Fixes #5560
3 years ago