Commit graph

11248 commits

Author SHA1 Message Date
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 537e9fef37 Throw if a bitmap starts outside its parents boundaries
Such bitmaps will, at best, fail to render due to clipping.  These
should never happen, so report it with an exception if it does.
2021-02-25 03:53:49 +00: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 18f326a77c Merge cbrt64:docs-windows-native-building into master 2021-02-22 01:43:53 +00:00
Kp 1ec6fdb0b5 Add back forwarding includes
These are not necessary for proper compilation, but are included so that
a mismatch between the forward declaration and the definition will be
diagnosed immediately.
2021-02-20 23:46:51 +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
Edward E 2d9aca9074
Merge c1e1a4570d into 8fdc326c2a 2021-02-07 23:53:14 -06:00
Edward E c1e1a4570d Add Windows/MSYS2 build instructions
Also user scripts for running the produced executable
2021-02-07 23:51:41 -06:00
C.W. Betts 8fdc326c2a Add CFBundleIdentifier to the plists. 2021-02-07 19:58:12 -07:00
Kp 00f6436959 Zero out newmenu_item::nm_private_imenu
Clear the largest union member to avoid issues with uninitialized
members.  A future change will refine this to construct members to
specific values.
2021-02-08 01:56:15 +00: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 791282aad7 Read physfs location from pkg-config
For consistency with other packages, ask pkg-config for the location
instead of assuming it is on the system search path.
2021-02-07 00:35:33 +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 b0338164f7 Remove SDLMain.m
According to @raptor, this is not needed on modern OSX for SDL1 or SDL2,
and breaks the build on SDL2.  Remove it.

Reported-by: raptor <https://github.com/dxx-rebirth/dxx-rebirth/issues/565>
2021-02-06 17:53:53 +00: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 6e52dc8db2 Shrink newmenu_item::right_offset
Its value never exceeds UINT8_MAX.
2021-02-06 17:53:53 +00:00
Kp a4bc997be3 Pack newmenu_item more tightly
Move value down to eliminate one area of padding on 64-bit systems.
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 49944a3fbf Use enum, not integral_constant, for netflag/netgrant constants 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 775d039083 Expand gcc memcpy workaround to gcc-10
The upstream bug is still not fixed.
2021-01-17 22:23:23 +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