Commit graph

5677 commits

Author SHA1 Message Date
Dave Milici 528650c37e Use std::array for viewport/tranform params per PR suggestion. 2021-03-15 14:45:29 -07:00
Dave Milici 08b8790ad0 Remove separate left/right caches for stereo viewport + transform params.
ogl_stereo_frame() is only ever called once for selected stereo view..
2021-03-15 14:30:48 -07:00
Dave Milici ab7924e129 Relocate viewport/transform adjustments inside ogl_stereo_frame() call.
Note since ogl_stereo_frame() is only ever called once per ogl_start_frame()..
ogl_end_frame() instance, only the active stereo eye view needs to be handled.
Implies that separate left/right viewport/transform caches are redundant.
2021-03-15 14:01:53 -07:00
Dave Milici f51e7b86b9 Reorganize & consolidate stereo vars per PR suggestions. 2021-03-15 11:32:10 -07:00
Dave Milici fdfcb726d1 Use frustum left/right clipping for image shift instead of viewport clipping.
left/right clipping planes affected by frustum matrix term M[2][0] (8th element)
2021-03-14 11:45:37 -07:00
Dave Milici 4d9e656809 Enumerate stereo formats for better logic insulation. 2021-03-14 09:25:38 -07:00
Dave Milici 509da82ee8 Add -gl_stereoview option for selecting stereo viewport modes. 2021-03-12 10:07:45 -08:00
Dave Milici f5d2dfa7ce Use Descent 1.5 defaults for stereo parallax params. 2021-03-11 12:32:01 -08:00
Dave Milici 4ca5f63b49 Use GL viewport clipping for stereo parallax image shift adjustments.
Equivalent to legacy Descent 1.5 pixel shift methods for stereo formats.
Since Descent is rendering viewpoint differences for left/right eyes,
pixel shifting via display viewport is sufficient adjustment.

Since OGL layer here is essentially handling display output surfaces,
the OGL projection transform is not useful for stereo parallax effects
as when used for 3D scenes.
2021-03-11 12:32:01 -08:00
Dave Milici 8c8b7419b6 Improved conditionals for stereo vs non-stereo modes.
Hot-key handling for cycling thru stereo modes & parallax adjustments.
Simplified stereo adjustments for left/right eye separation & offsets.
Not quite compatible yet with Bob Akka stereo method from Descent 1.5.
Function key assignments different (F5..F8) due to pre-empted hot-keys.

ALT+SHIFT+F5:	decrease eye separation (VR_eye_width)
ALT+SHIFT+F6:	increase eye separation (VR_eye_width)
    SHIFT+F5:	decrease image shift (VR_eye_offset)
    SHIFT+F6:	increase image shift (VR_eye_offset)
ALT|SHIFT+F7:	reset eye separation + image shift
ALT|SHIFT+F8:	cycle thru half-width + half-height formats

Note for compiling dxx-rebirth snapshot on MacOSX:

export CXXFLAGS=-Wno-uninitialized
scons macos_add_frameworks=False
2021-03-11 12:32:01 -08:00
Dave Milici bb903a1d80 Support stereo viewport rendering in half-height & half-width formats.
Enable stereo mode when launched via -gl_stereo option.
GL_STEREO quad buffering may not be available unless OGL layer
supports stereo pixel format descriptors.
Half-height viewport rendering for above/below format.
Half-width viewport rendering for side/by/side formats.
HUD & cockpit elements disabled when stereo views active.
2021-03-11 12:32:01 -08:00
Dave Milici 4169183342 Initial stereo rendering test in side-by-side format.
OGL layer used for rendering surfaces, so using left/right viewports absent stereo quad buffers.
Using legacy Descent +/- eye offset method for left/right stereo perspective rendering passes.
2021-03-11 12:32:01 -08:00
Dmitry Grigoryev 09946a1d99 Fix alignment of screen resolution menu text 2021-03-05 13:03:07 +01:00
Kp fcd5991eeb Clamp kconfig window size to screen size 2021-02-25 03:53:49 +00:00
Kp 6c814ff095 Draw kconfig background based on window dimensions
Replace hardcoded dimensions with the dimensions used by the window
being drawn.
2021-02-25 03:53:49 +00:00
Kp 6a425bb2a7 Drop unnecessary includes 2021-02-20 23:46:51 +00:00
Kp 9aab870cad Fix build break in digi.cpp
fbd05a1592 dropped an include of "jukebox.h" as unnecessary.  jukebox
was almost unnecessary, but jukebox includes physfsx, and physfsx
includes stdexcept.  stdexcept is necessary.  Include stdexcept
directly.

Fixes: fbd05a1592 ("optimize include files (include what you use)")
2021-02-20 23:46:51 +00:00
dimag0g 6282dd25b9
Merge fbd05a1592 into 8fdc326c2a 2021-02-16 21:30:26 -08:00
Kp f19f66bdb7 Fix crash entering save game name
Commit e6875641c9 moved allowed_chars from global scope into
individual newmenu_item entries.  However, it did not enforce that this
field be initialized, and some callers failed to do so.  The save game
menu was such a caller, and crashed when using an uninitialized value as
the allowed_chars pointer.  There is no character restriction here, so
explicitly set the pointer to nullptr.

Reported-by: kitelessd <https://github.com/dxx-rebirth/dxx-rebirth/issues/571>
Fixes: e6875641c9 ("Move Newmenu_allowed_chars into individual newmenu_item")
2021-02-08 01:56:15 +00:00
Kp 5465eda034 Fix anarchy/coop mouselook
Fixes: 17b3812ee3 ("Make more_game_options_menu inherit from newmenu")
2021-02-08 01:56:15 +00:00
Kp 15bd145daf Fix clang build break
clang warns for an unused constexpr global variable.  gcc does not.
Move the affected variable into the same #if that guards the use of the
variable.

Fixes: 4a8d7c7574 ("Default to 1024x768 for new users, not 640x480")
2021-02-06 23:11:42 +00:00
Dmitry Grigoryev fbd05a1592 optimize include files (include what you use) 2021-02-06 21:38:50 +01:00
Kp 081024eb8f Fix build for screenshot=legacy opengl=0
Reported-by: dimag0g <https://github.com/dxx-rebirth/dxx-rebirth/pull/568>
2021-02-06 17:53:53 +00:00
Kp 747a0f531d Factor out mouse button scroll processing 2021-02-06 17:53:53 +00:00
Dmitry Grigoryev 5bc927be5b Fix alignment of difficulty menu text 2021-02-02 14:15:34 +01:00
Kp 1afd0eeae2 Move NETFLAG_DOPOWERUP to netgame_info and clarify name 2021-01-25 00:45:07 +00:00
Kp 81a2d92ee9 Move ResolutionX, ResolutionY to CCfg 2021-01-25 00:45:07 +00:00
Kp 4a8d7c7574 Default to 1024x768 for new users, not 640x480
640x480 is too small to render some dialogs correctly, and is much
smaller than even a small laptop screen.  Smaller resolutions are still
supported, if the user chooses to switch.
2021-01-25 00:45:07 +00:00
Kp 11d7344625 Fix alignment of select_start_level_menu text
When the user opens the menu via the mouse, grd_curcanv points to a
canvas other than the top level canvas.  When the user opens the menu
via the keyboard, grd_curcanv points to the top level canvas.  For this
menu, the top level canvas must be used in order to get correct
alignment.  Switch the constructor to always use the top level canvas.

Reported-by: dimag0g <https://github.com/dxx-rebirth/dxx-rebirth/issues/564>
Fixes: e45ba0b4a9 ("Make new game menu inherit from newmenu")
2021-01-25 00:45:07 +00:00
Kp 5d0d9dcc1a Use primary_weapon_index_t for pick_up_primary 2021-01-25 00:45:07 +00:00
Kp 2196f6add5 Use enumerated_array for Secondary_ammo_max 2021-01-25 00:45:07 +00:00
Kp 6c63e11caa Use enumerated_array for Secondary_weapon_to_weapon_info 2021-01-25 00:45:07 +00:00
Kp b20fa0d77d Use enumerated_array for Primary_weapon_to_weapon_info 2021-01-25 00:45:07 +00:00
Kp 9abf81c77a Factor out logic for toggling between base/super weapons 2021-01-25 00:45:07 +00:00
Kp f1cfbaa982 Use enum class for cockpit_3d_view 2021-01-25 00:45:07 +00:00
Kp 77acae6510 Use enum class for weapon_box_user 2021-01-17 22:23:23 +00:00
Kp 423e513a4a Move overlap_dirty to gauge_inset_window 2021-01-17 22:23:23 +00:00
Kp 977684ba29 Move static_time to gauge_inset_window 2021-01-17 22:23:23 +00:00
Kp 977714c93f Move weapon_box_user to gauge_inset_window 2021-01-17 22:23:23 +00:00
Kp b4ba47f7bc Move weapon_box_fade_values to gauge_inset_window 2021-01-17 22:23:23 +00:00
Kp 8bc06dc700 Move weapon_box_states to gauge_inset_window 2021-01-17 22:23:23 +00:00
Kp d40a587628 Move old_weapon into gauge_inset_window 2021-01-17 22:23:23 +00:00
Kp b70f569178 Use enum class for OGL_TEXFILT_* constants 2021-01-17 22:23:23 +00:00
Kp a682d2bacb Simplify movie_play_status
Callers only ever test for whether the movie was skipped, and never
distinguish between a movie that ran to completion versus a movie that
the user interrupted.  Combine these two statuses into one value, and
eliminate the logic in RunMovie that picked which of the two to return.
2021-01-17 22:23:23 +00:00
Kp 6f7b0b4743 Use enum class for PlayMovie result 2021-01-17 22:23:23 +00:00
Kp 7b99654379 Use enum class for weapon_box_states 2021-01-17 22:23:23 +00:00
Kp 1843d375f2 Use enumerated_array for Secondary_weapon_to_powerup 2021-01-17 22:23:22 +00:00
Kp e9f590eeb1 Use enumerated_array for Primary_weapon_to_powerup 2021-01-17 22:23:22 +00:00
Kp baa2823953 Pass player_info to which_bomb
Previously, rendering the preferred bomb type could also change it if
the active type was exhausted.  This is undesirable, since it depends on
the user to have a HUD mode which causes the bomb type to render.
Switch to only change the active type if the user tries to drop a bomb
while the active type is unavailable.  Some call sites already switch
bomb types automatically on depletion.  Those sites will still do so.
2021-01-17 22:23:22 +00:00
Kp c7680621a8 Switch mine type if only alternate mine is available
v0.58.1 did this, but the functionality was accidentally removed in
859b399d20.  Restore it.

Fixes: 859b399d20 ("Use mask for Secondary_last_was_super")
2021-01-17 22:23:22 +00:00
Kp b51da25a42 Add quick-exit path for robot awareness in no-robot games
If no awareness events are pending, skip scanning objects for robots
to inform about the awareness events.
2021-01-17 22:23:22 +00:00
Kp 93bef60b79 Improve D1 emulation of process_awareness_events
When D2 emulates D1, use the D1 recursion limit.
2021-01-17 22:23:22 +00:00
Kp 1d5afd34ce Improve post-level score screen message
Use a special message when the timeout has elapsed, and the game is
waiting for the user to restore focus to the score screen.
2021-01-17 22:23:22 +00:00
Dmitry Grigoryev 1338ddab34 Add menu page for HUD style and cockpit view 2020-12-28 22:39:36 +01:00
Kp 04c1d8cc57 Move marker deletion are-you-sure to a non-blocking window 2020-12-27 22:03:09 +00:00
Kp a45726d7e4 drop_robot_egg: return immediately if count-to-drop == 0
This suppresses a misleading warning when a robot is set to drop 0
objects of an invalid type.
2020-12-27 22:03:09 +00:00
Kp e4f8d02380 Make screen_resolution_menu inherit from newmenu 2020-12-27 22:03:09 +00:00
Kp ed2bc8e213 Use enum class for nm_type 2020-12-27 22:03:09 +00:00
Kp 306b5ddebe Simplify levelwarp_menu handling of EVENT_WINDOW_CLOSE 2020-12-27 22:03:09 +00:00
Kp e45ba0b4a9 Make new game menu inherit from newmenu 2020-12-27 22:03:09 +00:00
Kp 03512841b1 Make do_difficulty_menu menu inherit from newmenu 2020-12-27 22:03:09 +00:00
Kp ae021b12e7 Use named Difficulty_level enum members in MENU_DIFFICULTY_TEXT 2020-12-27 22:03:09 +00:00
Kp 8e76a5a064 Avoid gcc snprintf truncation warning in net_udp.cpp
gcc computes a potential value range for game times as [0, 1092] instead
of the [0, 50] that the game uses.  This could be reasonable as the code
was before, but even adding an explicit range check before the usage
does not eliminate the warning.  Avoid the warning by increasing the
size of the buffer to avoid truncation even if the value were 1092.
2020-12-27 22:03:09 +00:00
Kp 3e467e54a3 Make MakeNewPlayerFile menu inherit from newmenu 2020-12-27 22:03:09 +00:00
Kp daf53321bf Remove return value of new_player_config
It always succeeds.
2020-12-27 22:03:09 +00:00
Kp 76cbd11956 Make kmatrix_window::event_handler cancel menu inherit from newmenu 2020-12-27 22:03:09 +00:00
Kp 115c38cd77 Remove kmatrix_poll2
After the previous commit, its only purpose is to automatically dismiss
the window after 3 seconds.  Users may be surprised by this, and the
automatic dismissal has limited value.  Remove it and let the user
remain at the cancel dialog until a decision is made.
2020-12-27 22:03:09 +00:00
Kp 479005b769 Remove call to dispatch->do_protocol_frame in kmatrix_poll2
The menu operated by kmatrix_poll2 exists only when the containing
kmatrix menu is also open.  kmatrix has its own call to
do_protocol_frame, so there is no need for another one here.
2020-12-27 22:03:09 +00:00
Kp 907c69dcb7 Skip some kmatrix logic when not in the foreground
Closing the kmatrix window while it is not in the foreground may cause a
use-after-free when it is closed again later, since the event loop can
reenter kmatrix_window::event_handler.  Skip the exit logic if the
window is not in the foreground, so that it remains open until it times
out while in the foreground.
2020-12-27 22:03:09 +00:00
Kp 80fc124a63 Remove unnecessary definitions of static member variables
C++17 permits, but deprecates, this form.  Remove it to simplify the
code.
2020-12-27 22:03:09 +00:00
Kp e7629f35ee Move newmenu_item::saved_text into the two sub-types that need it 2020-12-27 22:03:09 +00:00
Kp e6875641c9 Move Newmenu_allowed_chars into individual newmenu_item
Allowed characters are more properly scoped to a specific text entry
field.  Move them there to eliminate a global.
2020-12-27 22:03:09 +00:00
Kp 40501fa31e Make PlayerFinishedLevel menu inherit from newmenu 2020-12-27 22:03:09 +00:00
Kp 421959643c Make get_level_name menu inherit from newmenu 2020-12-27 22:03:09 +00:00
Kp 3e210a9ceb Make do_screen_message menu inherit from newmenu 2020-12-27 22:03:09 +00:00
Kp 1f8c8e355b Allow newmenu callers to choose whether to use a background box
Previously, callers chose whether to use a fullscreen background image,
and the newmenu code inferred that callers without a background image
wanted a background box, while those with a background image wanted no
box.  Change newmenu_layout to take a parameter specifying the caller's
intent, so that a caller can choose to have any combination of a
background image and a background box.
2020-12-27 22:03:09 +00:00
Kp c9d5d3be02 Fix buffer overflow on ill-formed briefing picture filename 2020-12-27 22:03:09 +00:00
Kp 1b58b82e81 Convert debug briefing menu to inherit from newmenu 2020-12-27 22:03:09 +00:00
Kp 2b9c146ff2 Convert glitz menu to inherit from newmenu
Add a static method to block until the menu closes, so that the glitz
menu can continue to block its caller.
2020-12-27 22:03:09 +00:00
Kp c0601edde3 Move GammaLevel to CCfg 2020-12-27 22:03:09 +00:00
Kp 3cbae9df31 Reset cockpit on leaving graphics menu
Calling gr_set_mode invalidates loaded fonts.  Avoid a use-after-free by
forcing a cockpit reset, which will reinitialize canvases that reference
the unloaded fonts.
2020-12-27 22:03:09 +00:00
Kp 17b3812ee3 Make more_game_options_menu inherit from newmenu 2020-12-27 22:03:09 +00:00
Kp 9be9f7ae64 Pass grs_font& to show_time 2020-12-27 22:03:09 +00:00
Kp 318ed5b684 Simplify info_display_default
Commit 8a437a759c made show_all always
true.
2020-12-27 22:03:09 +00:00
Kp c3e2d1841c Simplify info_display_segsize
Commit 8a437a759c made show_all always
true.
2020-12-27 22:03:09 +00:00
Kp 7fde0a00a0 Simplify info_display_object_placement
Commit 8a437a759c changed the logic to
always set show_all to 1.  This renders the short-circuit logic in
info_display_object_placement irrelevant, as show_all will always force
the information to draw.  Remove the variables that were used to decide
whether a redraw was required.
2020-12-27 22:03:09 +00:00
Kp aaf4629c05 Fix potential canvas.cv_font / cv_font inconsistency in gr_ustring
A prior conversion changed the actual rendering to use the argument
cv_font, but still picked which render function to use based on the
flags for the active font.  Switch to use only the supplied font.
2020-12-27 22:03:09 +00:00
Kp 9dd3f0dbf4 Pass grs_font& to nm_rstring 2020-12-27 22:03:09 +00:00
Kp 135ba07db4 Pass grs_font& to nm_string_inputbox 2020-12-27 22:03:09 +00:00
Kp 8b7e5ba04d Pass grs_font& to nm_string 2020-12-27 22:03:09 +00:00
Kp 0fa2afb6a6 Pass grs_font& to nm_string_slider 2020-12-27 22:03:09 +00:00
Kp d11f5c0cab Simplify newmenu font setup 2020-12-27 22:03:09 +00:00
Kp c1d6150015 Pass grs_font& to gr_set_curfont 2020-12-27 22:03:09 +00:00
Kp effa7435c2 Remove newmenu_listbox1
It is no longer used.
2020-12-27 22:03:09 +00:00
Kp 7f2df64649 Make mission_menu inherit from listbox 2020-12-27 22:03:09 +00:00
Kp df3f695023 Make menu.cpp:browser inherit from listbox 2020-12-27 22:03:09 +00:00
Kp e6f6bb68a0 Use enum class for browser::select_dir 2020-12-27 22:03:09 +00:00
Kp fcb3607ac4 Shrink browser::select_dir, browser::new_path to uint8_t
These are flag values.  There is no need to store an int.
2020-12-27 22:03:09 +00:00
Kp 0c77bee1d9 Change PHYSFS_removeFromSearchPath to PHYSFS_unmount
Per the documentation, PHYSFS_removeFromSearchPath is a deprecated
wrapper for PHYSFS_unmount.  Call PHYSFS_unmount directly.
2020-12-27 22:03:09 +00:00
Kp fa648075a9 Change PHYSFS_addToSearchPath to PHYSFS_mount
Per the documentation, PHYSFS_addToSearchPath is a deprecated wrapper
for PHYSFS_mount.  Call PHYSFS_mount directly.
2020-12-27 22:03:09 +00:00
Kp 0c53d3a34f Replace PHYSFSX_isNewPath with !PHYSFS_getMountPoint
PHYSFSX_isNewPath retrieves from PhysFS a list of all paths, then
searches them, and frees them at the end.  PhysFS can search its own
list without needing the allocations, so delegate the work to it.
2020-12-27 22:03:09 +00:00
Kp 6211fd029a Simplify menu.cpp:browser
->when_selected is always get_absolute_path.  Remove the pointer and
replace the indirect calls with a direct reference.

->userdata is always a pointer to the buffer for get_absolute_path to
fill.  Change the type from `void *` to an appropriate reference.
2020-12-27 22:03:09 +00:00
Kp ae5ee376f3 Move music file picking behind USE_SDLMIXER
None of these functions are used when sdlmixer=0, but the recursive
usage prevented the compiler from reporting this.
2020-12-27 22:03:09 +00:00
Kp 079602b91a Inline string_array_t::tidy comparator
There is only one call, so the target can be moved into the
implementation.  This removes use of a call-by-pointer.
2020-12-27 22:03:09 +00:00
Kp ac97d00698 Remove support for PhysFS 1, PhysFS 2
The last PhysFS 1 release was in March 2009.  The last PhysFS 2 release
was in August 2017, shortly before the release of PhysFS 3 in September
2017.  Most distributions have moved to PhysFS 3.  Drop support for
PhysFS 1 and PhysFS 2.  PhysFS 2 support could be restored if there is
interest.
2020-12-27 22:03:09 +00:00
Kp 165d8c9d1c Make demo_selection_listbox inherit from listbox 2020-12-27 22:03:09 +00:00
Kp c7f5e91007 Make pilot_selection_listbox inherit from listbox 2020-12-26 21:17:29 +00:00
Kp 8cc209b566 Simplify listing player files at startup
Remove the use of qsort, since PhysFS sorts the result.  The PhysFS sort
is case-sensitive rather than insensitive as the qsort was, but this is
unlikely to matter for most users.

Avoid an unnecessary strlen.  The required data can be obtained from the
strchr.

Suppress player files that do not end in `.plr`.  PhysFS should not
return such a file, and if it did, later code would likely become
confused.  Hide such files from the user.
2020-12-26 21:17:29 +00:00
Kp 095d660c55 Inline listbox_get_window
It is only used once.
2020-12-26 21:17:29 +00:00
Kp def7e03260 Move listbox callback handling to a derived class 2020-12-26 21:17:29 +00:00
Kp f43e98764a Move listbox to newmenu.h 2020-12-26 21:17:29 +00:00
Kp f01c29c779 Flatten newmenu_do* hierarchy
There is now a single caller for newmenu_do3.  Inline do3 into do2, so
that do2 calls do4.  Mark do4 as static.
2020-12-26 21:17:29 +00:00
Kp d1ff6becb4 Move listbox_layout to newmenu.h
Rename listbox_create_structure to listbox_layout::create_structure.
2020-12-26 21:17:29 +00:00
Kp 2ded2b2d0c Make kmatrix background optional
Previously, if the background failed to load, the kmatrix window was
immediately aborted.  Change the logic so that a failure to load uses a
blank black background, but still shows the kmatrix window.
2020-12-26 21:17:29 +00:00
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