Commit graph

5463 commits

Author SHA1 Message Date
Kp 03ebeda31a Fix use-after-free in kmatrix handling 2020-12-26 21:17:29 +00:00
Kp 1cc7be6b11 Construct listbox_layout directly in listbox 2020-12-26 21:17:29 +00:00
Kp b9a27094eb Pass menu_title through listbox functions 2020-12-26 21:17:29 +00:00
Kp b63ccc63ca Make passive_messagebox inherit from newmenu
passive_messagebox is only suitable when the user's selection does not
matter, so restrict to be used for cases where only one "choice" is
offered.
2020-12-26 21:17:29 +00:00
Kp 6322f2bb9c In multiplayer, show mission/level name on kmatrix screen
Requested-by: snytek <https://github.com/dxx-rebirth/dxx-rebirth/issues/553>
2020-12-26 21:17:29 +00:00
Kp cba756b826 Make hud_config_menu inherit from newmenu 2020-12-26 21:17:29 +00:00
Kp a9e723a822 Make gameplay_config_menu inherit from newmenu 2020-12-26 21:17:29 +00:00
Kp 09465f0f3d Make reticle_config_menu inherit from newmenu 2020-12-26 21:17:29 +00:00
Kp e79f907057 Make graphics_config_menu inherit from newmenu 2020-12-26 21:17:29 +00:00
Kp 316379a498 Make input_config_menu inherit from newmenu 2020-12-26 21:17:29 +00:00
Kp 7c46e5c760 Make sound_menu inherit from newmenu 2020-12-26 21:17:29 +00:00
Kp 11990bb856 Make manual_join_menu inherit from newmenu 2020-12-26 21:17:29 +00:00
Kp 57592811e0 Use enum class for direct_join::connecting 2020-12-26 21:17:29 +00:00
Kp 533f7752f4 Make wimp_menu inherit from newmenu 2020-12-26 21:17:29 +00:00
Kp be6c52b27e Make levelwarp_menu inherit from newmenu 2020-12-26 21:17:29 +00:00
Kp f22a73c2cc Remove unnecessary use of event_process_all in sandbox
The sandbox window is called in a context where an outer event loop will
work just as well.
2020-12-26 21:17:29 +00:00
Kp b459422206 Do not force player to leave score screen after final level
This reduces the chance of players hitting a difficult-to-fix
double-free bug, by preventing the free from occurring when the window
times out while not in focus.  A proper fix requires not freeing the
window in a recursive call path.
2020-12-26 21:17:29 +00:00
Kp 60e2622234 Use enum class for kmatrix tracking of reactor destruction
Name the two states, instead of using 0/1.
2020-12-26 21:17:29 +00:00
Kp 834f009dd7 Use enum class for wallnum_t 2020-12-26 21:17:29 +00:00
Kp 92aeee1efc Fix array underflow in GotoPrevWall when no walls exist 2020-12-26 21:17:29 +00:00
Kp fc63029833 Move more symbols into namespaces 2020-12-26 21:17:29 +00:00
Kp e2565e6120 Move some group structures inside #if 0
Some group functionality was disabled in 2665869c24, but the globals
to support the disabled code were not removed.  Move them into a
corresponding #if 0, since they have no value with the group code
disabled.

Fixes: 2665869c24 ("Mark editor groups broken")
2020-12-26 21:17:29 +00:00
Kp faa4d2ce34 Use enum class for vertnum_t 2020-12-26 21:17:29 +00:00
Kp 38770bea12 Remove remap_side_uvs
It has never worked correctly.  It compares real vertex numbers (as used
to index in Vertices[]) to abstract vertex numbers (always in the range
of [0, 7], as used on a theoretical segment.
2020-12-26 21:17:29 +00:00
Kp 9d62300898 Make find_edge more like automap_find_edge
Both have similar purposes, but search for different matching data
structures.
2020-12-26 21:17:29 +00:00
Kp 10b43d4ba0 Enable quick exit from is_free_vertex
Once the loop has determined a vertex is used at least twice, there is
no need to count how many more times it is used.  Return immediately
after detecting the second use.
2020-12-26 21:17:29 +00:00
Kp fd9e65554f Switch automap_find_edge to use std::hash 2020-12-26 21:17:29 +00:00
Kp 95d8095c6d Simplify med_set_vertex
- Make it static
- Remove the update of Num_vertices, since the caller reverses that
  update.
- Remove the reversal, since it is no longer needed.
- Remove the test and update of Vertices.count, because the caller
  always passes a vertex number that makes the test false.
2020-12-26 21:17:29 +00:00
Kp 70d55c010d Move Num_vertices into if(DXX_USE_EDITOR)
Non-editor builds only need Num_vertices as a local during mine loading.
2020-12-26 21:17:29 +00:00
Kp 90d43d6519 Simplify compress_vertices 2020-12-26 21:17:29 +00:00
Kp c58a69dbec Return vertnum_t from med_add_vertex 2020-12-26 21:17:29 +00:00
Kp 4658abc87e Remove Adam_level_names[]
These refer to the Miner levels, which were removed in the preceding
commit since support for them has been marked as broken for an extended
period, and no one has reported an issue.
2020-12-20 20:39:07 +00:00
Kp 6b3e78054c Remove support for reading Miner's .LVL files
The Miner LVL files are not present in retail Descent 2 data.  I know of
no way to obtain them.  The code for loading them has been marked as
broken since 2018, and no one reported it.  Remove this support to
simplify future work.
2020-12-20 20:39:07 +00:00
Kp 1c2fcf86e0 Convert multi_leave_game to dispatch through a vtable 2020-12-20 20:39:07 +00:00
Kp e2c95058db Convert multi_endlevel to dispatch through a vtable 2020-12-20 20:39:07 +00:00
Kp a3eb82cefd Move multi code into namespaces 2020-12-20 20:39:07 +00:00
Kp 5e4047ce2a Convert disconnect_player to dispatch through a vtable 2020-12-20 20:39:07 +00:00
Kp 955ce55661 Convert kick_player to dispatch through a vtable 2020-12-20 20:39:07 +00:00
Kp 2007257064 Convert get_multi_endlevel_poll2 to dispatch through a vtable 2020-12-20 20:39:07 +00:00
Kp 407678dfdf Convert multi_send_endlevel_packet to dispatch through a vtable 2020-12-20 20:39:07 +00:00
Kp ea6504e60b Convert multi_level_sync to dispatch through a vtable 2020-12-20 20:39:07 +00:00
Kp 2f90d7a208 Convert multi_do_protocol_frame to dispatch through a vtable 2020-12-20 20:39:07 +00:00
Kp d070377e6b Convert multi_objnum_is_past to dispatch through a vtable
This reduces the call depth by one, and eliminates a load of a global
variable that always has the value MULTI_PROTO_UDP.  It adds a load of
the address of the empty dispatch object.  Overall, this should be an
improvement.
2020-12-20 20:39:07 +00:00
Kp 479884288c Always delegate to window_create for send_creation_events 2020-12-20 20:39:07 +00:00
Kp a56ff84fd5 Make listbox callback const 2020-12-20 20:39:07 +00:00
Kp a4cfdba4d9 Make joystick_sensitivity::menu inherit from newmenu 2020-12-20 20:39:07 +00:00
Kp f0b6a23e0e Make mouse_sensitivity::menu inherit from newmenu 2020-12-20 20:39:07 +00:00
Kp c5a677817b Make keyboard_sensitivity::menu inherit from newmenu 2020-12-20 20:39:07 +00:00
Kp a0b09f0657 Make netgame_powerups_allowed_menu inherit from newmenu 2020-12-20 20:39:07 +00:00
Kp 485369810a Make grant_powerup_menu inherit from newmenu 2020-12-20 20:39:07 +00:00