Commit graph

10896 commits

Author SHA1 Message Date
Kp 7ded8fb6c5 Update issue template OS version lists 2020-09-11 03:08:03 +00:00
Kp 9c5f7b1248 Fix incorrect read length in D1 piggy_read_sounds
Reported-by: Kreeblah <https://github.com/dxx-rebirth/dxx-rebirth/issues/542>
Fixes: faf37e3c14 ("Always allocate D2-sized sound array")
2020-09-11 03:08:03 +00:00
Kp 969caa8c0c Add configure test to check for usable GL utility library
Rebirth built with OpenGL has a hard dependency on the GL utility
library, but did not have a configure time test to report this.  Add
one.

Reported-by: shoober420 <https://github.com/dxx-rebirth/dxx-rebirth/issues/468>
2020-09-11 03:08:02 +00:00
Kp b3c3066a38 Fix no-joystick build
When joystick support is not present, `event_joystick_get_button` is not
declared in joy.h.

Fixes: c24864b180 ("make menus controllable with joystick")
2020-09-11 03:08:02 +00:00
Kp 3ee3ac7b7a Delete multi_do_death
It is not needed.  Deathmatch players never lose their keys, so there is
no need to reapply them.
2020-09-11 03:08:02 +00:00
Kp 6a9444e5d6 Move some multiplayer functions into namespaces 2020-09-11 03:08:02 +00:00
Kp 61f186bc18 Use enum class for texture1_value 2020-09-11 03:08:02 +00:00
Kp 39cb42b878 Push partial_range construction to newmenu callers
In some cases, callers know the length of the range and can apply better
checks than the called code.
2020-09-11 03:08:02 +00:00
Kp e31d030caf Use zip for nm_messagebox_str 2020-09-11 03:08:02 +00:00
Kp 7de81a7293 Move Afterburner_charge to dsx 2020-09-11 03:08:02 +00:00
Kp 14a9657136 Use partial_range to store newmenu_item pointer/length 2020-09-11 03:08:02 +00:00
Kp c66a5276b7 Pass draw_item newmenu_item by reference 2020-09-11 03:08:02 +00:00
Kp e2204cc8e5 Rotate menu items in terms of ranges, not indexes 2020-09-11 03:08:02 +00:00
Kp 495e808f7b Factor out generating slider special characters
The same logic is used in two places.  Move it to a helper function, and
switch from repeated use of snprintf for one character at a time to
instead use fill_n.
2020-09-11 03:08:02 +00:00
Kp 18282d5b66 Move some menu code into namespaces 2020-09-11 03:08:02 +00:00
Kp 96d108b7c9 Merge commit 'fix_gr_menu_crash' into master 2020-09-02 02:16:47 +00:00
Arne de Bruijn 5b56ed1970 Ensure cached cockpit textures are valid
Check if the cockpit window textures are still valid when reusing the
previous cockpit data in cockpit_decode_alpha.

This fixes a crash when leaving the graphics options menu while in
the game with cockpit visible, since that calls
ogl_smash_texture_list_internal which invalidates all textures.
2020-08-28 14:58:37 +02:00
Kp 52660dd40c Make kc_menu inherit from window 2020-08-28 00:18:45 +00:00
Kp 22afbfce15 Use zip for kc_set_exclusive_binding iteration 2020-08-28 00:18:45 +00:00
Kp b6a6cec9bd Move kconfig_start_changing to dsx 2020-08-28 00:18:45 +00:00
Kp 96c007687c Move kc_drawquestion to dcx 2020-08-28 00:18:45 +00:00
Kp 0f2c1cdd45 Make game window inherit from dcx::window 2020-08-28 00:18:45 +00:00
Kp b79eff0e5c Deduplicate fades[]
Two identical copies were defined in different places.  Use the global
one for both consumers.
2020-08-28 00:18:45 +00:00
Kp dc77c1a5ce Make pause window inherit from dcx::window 2020-08-28 00:18:45 +00:00
Kp c038805a9b Make credits window inherit from dcx::window 2020-08-28 00:18:45 +00:00
Kp 955c7d9542 Make console window inherit from dcx::window 2020-08-28 00:18:45 +00:00
Kp cc5506544a Make automap window inherit from dcx::window 2020-08-28 00:18:45 +00:00
Kp 7e72dfd75c Move some automap logic to dcx 2020-08-28 00:18:45 +00:00
Kp bc660bcfcd Pass automap by reference 2020-08-28 00:18:45 +00:00
Kp cdca112f0a Pass LevelUniqueAutomapState to automap_clear_visited 2020-08-28 00:18:45 +00:00
Kp 0ae9f3c193 Make movie window inherit from dcx::window 2020-08-28 00:18:45 +00:00
Kp f666ab14cb Make movie_pause_window window inherit from dcx::window 2020-08-28 00:18:45 +00:00
Kp 9d0a9ec783 Make escort_menu window inherit from dcx::window 2020-08-28 00:18:45 +00:00
Kp ef8c0e7527 Make kmatrix window inherit from dcx::window 2020-08-28 00:18:45 +00:00
Kp 1d3e546848 Inline window_get_canvas
The helper returns a reference to a mutable canvas, so there is no
isolation provided by using the helper.
2020-08-28 00:18:45 +00:00
Kp 0f89331924 Inline window_set_modal 2020-08-28 00:18:45 +00:00
Kp 97315725fa Move get_multi_endlevel_poll2 into dsx 2020-08-28 00:18:45 +00:00
Kp 02aa5c182e Use NSDMI for kmatrix_screen::end_time initialization 2020-08-28 00:18:45 +00:00
Kp 363ecc36f1 Move kmatrix_screen into local scope
It is only used inside one function, so there is no need to store it
into the structure.
2020-08-28 00:18:45 +00:00
Kp 5501683dda Store kmatrix_result in kmatrix_screen
Instead of storing a boolean that is later converted to a
kmatrix_result, store the desired result directly.
2020-08-28 00:18:45 +00:00
Kp 53f75c3c72 Use enum class for kmatrix network flag 2020-08-28 00:18:45 +00:00
Kp 5b45fd3bae Add compile-time check that zip() will not exceed static sizes
This is necessarily incomplete since it can only check ranges that have
a compile-time static size.  However, it catches some simple mistakes,
and imposes no runtime cost, so it is still useful.
2020-08-28 00:18:45 +00:00
Kp 74a698253b Fix kconfig zip traversal past the end of kcm_* arrays
For historical reasons, the kcm_* arrays are smaller than the player's
configuration settings.  Move the kcm_ arrays to be the first range
passed to zip, so that traversal does not exceed the array.

Fixes: d959eeca8f ("Use zip in kconfig to allow use of range-based for")
2020-08-28 00:18:45 +00:00
Kp 18027607cd Fix truncation warning in multi_send_message
When AddressSanitizer is enabled, gcc-10 will warn that strncpy will
truncate the message.  This truncation is valid, since it only loses the
terminating null byte, and the next line explicitly supplies a
terminating null.  Switch to memcpy to eliminate the warning and produce
simpler code.
2020-08-24 01:31:28 +00:00
Kp 6d3dce4e16 Use enum class for tmap_num2
Define separate enum values for rotation data in both the high bits,
where it is usually kept, and the low bits, where it is sometimes used
for math or comparisons.

Define an enum value to represent the composite of the index and the
rotation, since the composite is not suitable for use as an array
subscript.  Add helper functions to extract the component pieces.
2020-08-24 01:31:28 +00:00
Kp da66b1d9b8 Move d1_tmap_num_unique to piggy.cpp
It is only used in one file.  Move it there and make it static.
2020-08-24 01:31:28 +00:00
Kp c7a291b113 Move editor texture orientation handling to caller
tmap1 cannot be rotated, so checking for it inside
convert_to_d1_tmap_num is wrong.  tmap2 can be rotated, and checking for
it outside convert_to_d1_tmap_num is cleaner.
2020-08-24 01:31:28 +00:00
Kp ab44115aa4 Move N_robot_joints to d_level_shared_robot_joint_state 2020-08-24 01:31:28 +00:00
Kp c96671f763 Move Pof_names to d_level_shared_polygon_model_state 2020-08-24 01:31:28 +00:00
Kp dca3c6cdca Move savegame POF names to stack
They are only used while loading a savegame file.  There is no need for
them to be global.
2020-08-24 01:31:28 +00:00