Commit graph

11273 commits

Author SHA1 Message Date
C.W. Betts 48589d0fb0 Add App Category entries to the plists. 2021-04-30 14:43:15 -06:00
Kp 58a1d86c05 Fix return type of check_trans_wall lambda (#588)
The deduced return type is `grs_bitmap`, which is inefficient, but not
wrong on its own.  However, `rle_expand_texture` uses the address of its
argument as a long-term cache key, so it must never be called with the
address of a stack-local variable.  When the return type is
`grs_bitmap`, the argument to `rle_expand_texture` is a reference to a
stack-local variable.  Fix this by setting the return type to
`const grs_bitmap &`, so that the argument to `rle_expand_texture` is a
reference to an element in the global GameBitmaps array.

AlumiuN proposed an initial fix, but based on analysis of why that fix
worked, I elected to use a different, smaller, fix instead.

Reported-by: CHILLYBUS <https://github.com/dxx-rebirth/dxx-rebirth/issues/588>
Reported-by: KynikossDragonn <https://github.com/dxx-rebirth/dxx-rebirth/issues/588#issuecomment-825978696>
Analyzed-by: AlumiuN <https://github.com/dxx-rebirth/dxx-rebirth/issues/588#issuecomment-826009993>
Analyzed-by: 4C1T <https://github.com/dxx-rebirth/dxx-rebirth/issues/588#issuecomment-826016402>
Proposed-fix-by: AlumiuN <c4d1f41946>
Fixes: 61f186bc18 ("Use enum class for texture1_value")
2021-04-24 17:32:47 +00:00
Kp 809af29875 Merge branch 'dylibbundler' into master 2021-04-08 01:58:17 +00:00
Kp 1ebb738434 Fix break for !DXX_USE_EDITOR
Fixes: ddb9e8e774 ("Add in-game editor menu to update Cursegp")
2021-04-07 01:45:58 +00:00
Kp 6666928824 Fix Windows build of menu.cpp
Commit 6ad87cf78ab3 removed support for char[] as an input to
nm_item_input and fixed all sites that used it in the cross-platform
build.  The Windows build has one use that no other platform does, and
this use was not fixed.  Fix it now.

Fixes: 6ad87cf78ab369cdc26080ac579fb2ab3f592de6 ("Remove nm_set_item_input overload for char[]")
2021-04-04 22:01:25 +00:00
Kp 1843ed752c Fix Windows build of kconfig.h
fbd05a1592 changed joy.h to include only fwd-event.h, but not event.h.
event.h included maths.h, which kconfig.h was relying on.  Add an
inclusion of maths.h into kconfig.h to define `fix`.

Fixes: fbd05a1592 ("optimize include files (include what you use)")
2021-04-04 22:01:25 +00:00
Kp 32ef2969e6 Override mapping of D1 secret door texture
Previously, this texture was handled by the default branch, which would
add 64.  For this texture, adding 64 picks a frame late in an animation,
causing the texture to have transparent areas.  The intended texture, as
used in D1, has no transparent areas.  Add a special case to pick the
first frame, which appears solid.

Reported-by: Q3BFG10K <https://github.com/dxx-rebirth/dxx-rebirth/issues/577>
Analyzed-by: AlumiuN <https://github.com/dxx-rebirth/dxx-rebirth/issues/577#issuecomment-783002296>
2021-04-04 22:01:25 +00:00
Kp 414c59c6ba Enable backtick-based segment reporting in D1
This is a developer feature that is useful in D2.  Backport it to D1.
2021-04-04 22:01:25 +00:00
Kp ddb9e8e774 Add in-game editor menu to update Cursegp 2021-04-04 22:01:25 +00:00
Kp 18c39192f6 Reduce use of global structures in cheat functions 2021-04-04 22:01:25 +00:00
Kp 63940def1a Hide -gl_stereo behind #if !defined(RELEASE)
As discussed in pull #582, there are some rough edges to this feature.
Hide the option, but not the functionality, from users until these can
be corrected.  Users who want to experiment with the feature can access
it through the command-line or the in-game hotkeys in any build.  This
change only hides the help text, to prevent users from finding it and
expecting it to be fully finished.
2021-04-04 22:01:25 +00:00
Kp 02c99b7645 Consolidate stereo dimension math
Remove VR_half_width, VR_half_height.  Their values are directly derived
from VR_stereo, and can be computed on demand.
2021-04-04 22:01:25 +00:00
Kp 70ef749ff4 Consolidate stereo GL calls
Reorder the logic to unify the common calls at the bottom of the
function, and skip computing anything if called in no-stereo mode.
2021-04-04 22:01:25 +00:00
Kp 426621398f Only read viewport if VR needs it for an update 2021-04-04 22:01:25 +00:00
Kp 8cc8e80eae Fix VR build failure due to implicit fallthrough
The fallthrough appears to be intentional.  Add an annotation to allow
it.

Fixes: 6bc0e822d2 ("Handle HUD overlays in separate screen rects for stereo renderings.")
2021-04-04 22:01:25 +00:00
Kreeblah fb73b7fb8f
Tested on a fresh install and this needs to put dylibs in libs, not Frameworks 2021-03-29 23:19:32 -07:00
Kreeblah b7ff72c364
Embed dylibs in app bundles 2021-03-26 02:07:06 -07:00
Dave Milici 94ef130a4e
Merge 23bbe7dde8 into 09946a1d99 2021-03-18 16:49:00 +13:00
Dave Milici 23bbe7dde8 Offset HUD screen rects for out-of-screen stereo parallax on HUD overlays.
Used 1x VR_eye_offset to track image shift adjustments via OGL frustum planes
instead of 2x VR_eye_offset used in Descent 1.5 image shift adjustments.

Without any HUD rect offset, HUD overlays would appear to match the zero-parallax
view plane instead of appearing in an out-of-screen parallax view plane.
2021-03-17 18:01:03 -07:00
Dave Milici 6bc0e822d2 Handle HUD overlays in separate screen rects for stereo renderings. 2021-03-17 16:30:31 -07:00
Dave Milici ca1478ea88 Relocate stereo viewport scaling at caller level outside of OGL layer.
Almost compatible size with HUD screen effects if re-enabled.
2021-03-15 20:02:22 -07:00
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 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