Kp
20a0166cf4
Avoid double-scaling sounds at start time
...
The SDL_mixer library has already been instructed, via Mix_Volume, to
scale the volume of sounds on all channels, by an amount based on
digi_volume. There is no need to manipulate the effective distance of a
particular sound to further scale it by digi_volume. Even if this
second scale was needed, it was done incorrectly, because it was only
applied when the sound was started, but not re-applied when the sound's
volume was updated due to positional changes. As a result, any sound
which was updated would switch to an unscaled version. Sounds which
were never updated, such as those attached to the viewer object, would
retain their original scaled volume.
Update the implementation of digi_mixer_set_channel_volume to call
Mix_SetDistance in the same way as digi_mixer_start_sound, for
readability and consistency.
2021-06-28 03:37:51 +00:00
Kp
659be87a5b
Saturate return value of fix2byte
2021-06-28 03:37:51 +00:00
Kp
7cba352c19
Split digi_get_sound_loc
...
Some callers need to update an existing sound_object. Other callers
need a temporary copy of the data for external use. Rearrange the code
so that the latter type of caller can obtain the data without a pointer
indirection.
2021-06-28 03:37:51 +00:00
Kp
e0008cceb3
Use enum class for sound angle parameter
2021-06-28 03:37:51 +00:00
Kp
f233115d84
Make savegame menu inherit from newmenu
2021-06-28 03:37:51 +00:00
Kp
13e29c64f3
In debug builds, initialize newmenu_item type,text to poison values
...
This improves the chance that an unset value will abort rather than
displaying strange results. Release builds are unchanged.
2021-06-28 03:37:51 +00:00
Kp
86e8e1d4f9
Remove Python2 dict compatibility symbols
...
Switch to calling the methods directly on the dict instances. This
eliminates use of a global variable at each call site.
2021-06-28 03:37:51 +00:00
Kp
d980648823
Use structured bindings for more zip calls
2021-06-28 03:37:51 +00:00
Kp
ec4d75d44e
Switch decode_row from xrange to span to better express its operation
2021-06-28 03:37:51 +00:00
Kp
9c08b233a5
Move collision functions into namespaces
2021-06-28 03:37:51 +00:00
Kp
40b0b6c8fb
Adjust indent to silence clang -Wmisleading-indentation
...
gcc treats the intervening lines since the last `if` as sufficient to
recognize this as not misleading. clang does not. Change the indent to
calm clang.
2021-06-28 03:37:51 +00:00
Kp
f1606f7747
Simplify test for __builtin_bswap16
...
This test covered __builtin_bswap32 and __builtin_bswap16 separately,
because it was written to support gcc versions that predated the
introduction of __builtin_bswap16. The minimum supported gcc version
now understands both intrinsics, so simplify the test to cover all three
at once.
2021-06-28 03:37:51 +00:00
Kp
e1aac6949a
Replace __attribute_warn_unused_result with C++17 [[nodiscard]]
...
This eliminates a configure test, and may help readers understand the
annotation more readily.
2021-06-28 03:37:51 +00:00
Kp
770ae0cea5
Replace __attribute_noreturn with C++11 [[noreturn]]
...
This eliminates a configure test, and may help readers understand the
annotation more readily.
2021-06-28 03:37:50 +00:00
Kp
15057af2f9
Replace __noreturn with C++11 [[noreturn]]
...
This allows non-GNU-C compilers to see the attribute.
2021-06-28 03:37:50 +00:00
Kp
a3bf147768
Move create_vertex_list_from_invalid_side to dcx
2021-06-28 03:37:50 +00:00
Kp
704f8f662d
Allow rvalue reference as input to enumerated_iterator
2021-06-28 03:37:50 +00:00
Kp
3466a6f818
Combine partial_range template constructors
...
Add an explicit check for rvalue ranges that own their storage, and then
allow any other rvalue input.
2021-06-28 03:37:50 +00:00
Kp
028f4f8a56
Use structured bindings to access enumerated ranges
2021-06-28 03:37:50 +00:00
Kp
eaf319ac4e
Inline guidebot search into create_buddy_bot
...
Remove use of a predicate/std::find_if, and switch to structured
bindings to access the enumerated range.
2021-06-28 03:37:50 +00:00
Kp
7b12aac1bb
Transpose returned values for enumerate() of non-tuple
...
Match the order used for tuple.
2021-06-28 03:37:50 +00:00
Kp
2dd497c96b
Switch find_seg_side to use std::optional instead of a magic value
2021-06-28 03:37:50 +00:00
Kp
212400d140
Convert nm_messagebox_str to use messagebox_newmenu
2021-06-28 03:37:50 +00:00
Kp
496aba9886
Make net_udp_select_teams_menu inherit from newmenu
2021-06-28 03:37:50 +00:00
Kp
2cb98e3470
Simplify setup of team vector
2021-06-28 03:37:50 +00:00
Kp
4901e9161d
Convert high score saying dialog to use run_blocking_newmenu
2021-06-28 03:37:50 +00:00
Kp
9044a19d78
Fold passive_messagebox_item into passive_messagebox
2021-06-28 03:37:50 +00:00
Kp
4c34875c84
Remove unused subfunction_handler
...
Previous commits eliminated all uses of it. Remove the unused stubs.
2021-06-28 03:37:50 +00:00
Kp
55ea87ca3f
Move callback_newmenu handling into event_handler
2021-06-28 03:37:50 +00:00
Kp
cfb75c221f
Inline newmenu_do4 into its sole caller, newmenu_do2
2021-06-28 03:37:50 +00:00
Kp
0c2f95e2cd
Remove write-only member window_rendered_data::rear_view
2021-06-28 03:37:50 +00:00
Kp
8a9eb82d6e
Factor out choosing bounty target
2021-06-28 03:37:50 +00:00
Kp
728e687116
Use std library for shuffling netgame start positions
2021-06-28 03:37:50 +00:00
Kp
3d15289273
Return connect type from net_udp_show_game_info
2021-06-28 03:37:50 +00:00
Kp
1f3b678077
Make net_udp preview game menu inherit from newmenu
2021-06-28 03:37:50 +00:00
Kp
0e9e88da87
Make file browser Windows drive selection menu inherit from newmenu
2021-06-28 03:37:50 +00:00
Kp
19d0de3cea
Move weapon reorder menu subfunction handling to event_handler
2021-06-28 03:37:50 +00:00
Kp
925ed7491b
Move netgame grant-powerup menu subfunction handling to event_handler
2021-06-28 03:37:50 +00:00
Kp
da7059a0a7
Move netgame more-options menu subfunction handling to event_handler
2021-06-28 03:37:50 +00:00
Kp
e9f895de73
Move netgame powerups-allowed menu subfunction handling to event_handler
2021-06-28 03:37:50 +00:00
Kp
b1ea316a63
Move netgame list menu subfunction handling to event_handler
2021-06-28 03:37:50 +00:00
Kp
2e41a2b169
Move manual net join menu subfunction handling to event_handler
2021-06-28 03:37:50 +00:00
Kp
5f4e8da3b9
Move sandbox menu subfunction handling to event_handler
2021-06-28 03:37:50 +00:00
Kp
56ad2266da
Move netgame menu subfunction handling to event_handler
2021-06-28 03:37:50 +00:00
Kp
52f9e29e82
Move gameplay menu subfunction handling to event_handler
2021-06-28 03:37:50 +00:00
Kp
71f05d987a
Move sound menu subfunction handling to event_handler
2021-06-28 03:37:50 +00:00
Kp
431a2f99f1
Move graphics configuration menu subfunction handling to event_handler
2021-06-28 03:37:50 +00:00
Kp
3f8ef01dc7
Move hud configuration menu subfunction handling to event_handler
2021-06-28 03:37:49 +00:00
Kp
464e4e99fb
Move hud style configuration menu subfunction handling to event_handler
2021-06-28 03:37:49 +00:00
Kp
d8860549c4
Move reticle configuration menu subfunction handling to event_handler
2021-06-28 03:37:49 +00:00