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
staphen
ce413ec4a6
Round to the nearest integer when computing missile coordinates
3 years ago
Gleb Mazovetskiy
1addfc9e54
dun_render: Deduplicate trapezoid upper half
3 years ago
Gleb Mazovetskiy
63a042d0e3
dun_render: Simplify non-masked primitives
...
As we recently confirmed, Square and Left/RightTriangle primitives
never use masks other than Transparent and Solid.
Simplify the code to take advantage of that.
3 years ago
Gleb Mazovetskiy
55d25fd079
dun_render: Swap32LE the data offset
3 years ago
Gleb Mazovetskiy
79b330825d
dun_render: Avoid `Invalid` tile type
...
1. Do not call `RenderTile` with invalid values to begin with.
2. Move mask selection out of `RenderTile`.
3 years ago
Gleb Mazovetskiy
44ed0296d8
dun_render: Overhaul mask handling
...
We notice that masks can be described by 2 parameters:
1. Whether they have 0 or 1 as their high bits.
2. Whether they shift to the left or to the right on the next line.
Describing masks this way allows us to lift them to template variables and simplify the code.
We also avoid handling the mask in the `RenderLine` loop entirely.
Also fixes a foliage rendering bug: Transparent foliage pixels were previously blended but they should have been simply skipped.
3 years ago
Gleb Mazovetskiy
5024bc0f07
Show FPS up to 1 decimal point
...
If FPS < 100, print it with 1 decimal point.
Useful for measuring performance impact on low-end devices.
3 years ago