Commit graph

11314 commits

Author SHA1 Message Date
Kp 76a7361786 Close descent.hog on exit
Add RAII wrappers for unmounting PHYSFS paths.  Use them in places that
previously handled unmounting explicitly.  Also, use it for descent.hog
/ descent2.hog, which previously were left mounted indefinitely.
2021-06-28 03:37:49 +00:00
Kp 1dba8e40ec Move PHYSFSX_addRelToSearchPath pathname to caller
Some callers will need access to the computed path.  Change the callers
to pass in a buffer for this path, and have PHYSFSX_addRelToSearchPath
fill that buffer directly.
2021-06-28 03:37:49 +00:00
Kp c98c412fbb Remove template indirection around PHYSFSX_getRealPath
All callers use a std::array<char, PATH_MAX>, so update the definition
to use that.
2021-06-28 03:37:49 +00:00
Kp 391a539ad2 Use enum class for PHYSFSX_addRelToSearchPath append/prepend parameter 2021-06-28 03:37:49 +00:00
Kp 93a7e34caf Move newmenu_item slider storage of saved_text out of line
When other newmenu_item private members also move, this will make
newmenu_item smaller.
2021-06-28 03:37:49 +00:00
Kp 1936b771e1 Construct nm_item_input in place 2021-06-28 03:37:49 +00:00
Kp ef6e36f7ee Move newmenu_item union members into named union 2021-06-28 03:37:49 +00:00
Kp 821e68527d Remove nm_set_item_input overload for char[]
Require use of std::array.  There is no need to support both overloads.
2021-06-28 03:37:49 +00:00
Kp 2a504ee03e Construct nm_item_menu in place 2021-06-28 03:37:49 +00:00
Kp b5460a0a48 Construct nm_item_text in place 2021-06-28 03:37:49 +00:00
Kp 3d14dbacde Remove digi_reset
It was only available in debug builds, and did nothing when called.
2021-06-28 03:37:49 +00:00
Kp 6e12644620 Remove write-only field digi_sound::bits 2021-06-28 03:37:49 +00:00
Kp 73c3474f8e Reduce uses of RAIIdmem for local variables 2021-06-28 03:37:49 +00:00
Kp d0a8cf7769 Avoid unnecessary reallocations in D1 shareware sound decompression
lastsize was never updated from 0, so every pass would reallocate the
buffer.  Switch to a std::vector and rely on it to remember the size.
Manually tracking the size would be slightly more efficient, but this is
not a hot path and the vector approach is easier to review.
2021-06-28 03:37:48 +00:00
Kp ee07a45712 Simplify MALLOC invocations
Remove overload for C array decay, and fix up the call sites that
required it.
2021-06-28 03:37:48 +00:00
AlumiuN b918d33e1c Fix door lock/unlock triggers causing a crash when given an invalid wall location 2021-06-14 15:16:56 +12:00
AlumiuN a17129a9aa Fixed mission menu subdirectory handling 2021-06-13 20:15:26 +12:00
Kp 32b7899059 Remove const qualifier from gr_init_bitmap
gr_init_bitmap can be passed a pointer to uninitialized memory, and
will save that pointer into the bitmap for the underlying memory to be
initialized later.  In gcc-11, this triggers a warning because the
`const` qualifier leads gcc to expect that the memory will only be read
(while uninitialized) and not written.

Reported-by: TheDemonicSurfer <https://github.com/dxx-rebirth/dxx-rebirth/issues/593>
2021-06-12 21:07:32 +00:00
Robert Menes 201199ebf8
Merge c630191c29 into e226623ebe 2021-06-01 14:44:48 -04:00
Robert Menes c630191c29
Add Haiku as a built host option 2021-06-01 13:37:30 -04:00
Kp e226623ebe Fix advice in dylibbundler error path
Reported-by: Kreeblah <https://github.com/dxx-rebirth/dxx-rebirth/pull/591#issuecomment-841927157>
2021-05-18 03:00:48 +00:00
Kp e75cff028f Rework dylibbundler test
- Add support for a sequence of guard predicates for a test, rather than
  limiting to a single predicate.
- Use that support to skip the dylibbundler test when
  user_settings.macos_add_frameworks makes the test unnecessary.
- Use StaticSubprocess to avoid running dylibbundler repeatedly if
  building multiple targets for which the test is necessary.
- Capture stderr from the child process, and log it, instead of letting
  it be written directly to the stderr inherited from the caller of
  SCons.
- On failure, write to the SConf log the return code of dylibbundler,
  its stdout, and its stderr.  This may help users diagnose the problem
  if it is more complicated than the tool not being installed.
- On failure, show a more direct suggestion about how to avoid needing
  dylibbundler.
2021-05-16 23:15:14 +00:00
Kp ad4fb29920 Use super() in SConstruct to avoid repeating parent class names 2021-05-16 23:15:14 +00:00
Kp 88ff96f49e Change SConstruct classes not to inherit from object
This is not necessary in Python3, and Python2 is no longer supported.
2021-05-16 23:15:14 +00:00
Kreeblah 6b5ff851a3 Updated dylibbundler test 2021-05-16 23:15:11 +00:00
Kreeblah 5afd1d8e53 Updated dylibbundler test 2021-05-16 23:15:11 +00:00
Kreeblah ef9c9a3b29 Updated dylibbundler test 2021-05-16 23:15:11 +00:00
Kreeblah d9d1f5c0db Updated dylibbundler test 2021-05-16 23:15:11 +00:00
Kreeblah 25556fa120 Updated dylibbundler test 2021-05-16 23:15:11 +00:00
Kreeblah d82c52539c Updated dylibbundler test 2021-05-16 23:15:11 +00:00
Kreeblah 66fe76b0c2 Updated dylibbundler test 2021-05-16 23:15:11 +00:00
Kreeblah 14562e74b3 Added test for dylibbundler on macOS 2021-05-16 23:15:11 +00:00
Dave Milici 87adf05c75
Merge a9d14fc03d into 48589d0fb0 2021-05-04 10:03:00 -07:00
Dave Milici a9d14fc03d Relocate stereo conditional for cockpit views into select_cockpit().
Avoids switching cockpit views to CM_LETTERBOX when player dies or
level ends which stereo viewport is active, as well as other calls
to select_cockpit().
2021-05-04 09:55:48 -07:00
Dave Milici a394bd0312 Consolidated above/below format cases for readability. 2021-05-04 08:46:26 -07:00
Dave Milici 5025cedf45 Simplified case for above/below blank interval adjustment. 2021-05-03 16:05:12 -07:00
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
Dave Milici c0592ec52c Merge branch 'stereo-patch' of https://github.com/IronicResearch/dxx-rebirth into stereo-patch
fixups after rebase master
2021-04-08 14:20:29 -07:00
Dave Milici d06751282b Hack to keep stereo formats remaining fullscreen.
When player gets killed, the screen inexplicably switches to
another viewport format to show explosion POV and then switches
to cockpit viewport, which is not compatible with stereo formats.

Unable to locate where exactly cockpit gets switched on player
dead state, so hack is in place to keep stereo formats fullscreen.
2021-04-08 14:07:35 -07:00
Dave Milici ea6379de2d Add above/below option sync blank interval for external sync doubler. 2021-04-08 14:07:35 -07: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