For each link given as http://, verify that the site is accessible over
https:// and, if so, switch to it. These domains were converted:
* llvm.org
* clang.llvm.org
* en.cppreference.com
* www.dxx-rebirth.com
* www.libsdl.org
* www.scons.org
Add macro cf_assert ("control flow" assert) to hint to gcc that certain
conditions are impossible. Use it to avoid generating range checks for
situations that never happen. If the event did happen, the only
consequence would be truncated UI text, rather than a correctness
problem.
Move it to a structure. Make all the modifiers methods. Change all
callers of those methods to pass the structure. This makes the stuck
object handling free of direct access to global game data.
This commit enables Rebirth to build with SDL2, but the result is not
perfect.
- SDL2 removed some sticky key support. Rebirth may behave differently
now in this area.
- SDL2 removed some key-repeat related support. Rebirth may behave
differently now in this area.
- SDL2 gained the ability to make a window fullscreen by sizing it to
the desktop instead of by changing the desktop resolution. Rebirth
uses this, and it mostly works.
- Resizing while in the automap does not notify the automap code, so
the view is wrong until the player switches out of automap mode and
back in.
- SDL2 changed how to enumerate available resolutions. Since
fitting the window to the desktop is generally more useful than
fitting the desktop to the window, I chose to drop support for
enumerating resolutions instead of porting to the new API. Users can
now enter an arbitrary window dimension and Rebirth will make an
attempt to use it.
- It might be useful to cap the window dimension at the desktop
dimension, but that is not done yet.
- Entering fullscreen mode through the Controls->Graphics submenu
failed to notify the relevant subsystems, causing the rendered
content not to rescale. For now, compile out the option to toggle
full screen through that menu. Toggling through Alt+Enter works
properly.
Despite these quirks, this is a substantial improvement over the prior
commit, where SDL2 cannot be used at all. The remaining issues can be
resolved in future work.
References: <https://github.com/dxx-rebirth/dxx-rebirth/issues/82>
User Nemesis reported an unspecified crash, but never responded to
inquiries to provide more data. Users Tourmeister and Buff Skeleton
reported a fatal exception thrown while paging in a vclip, with initial
triggering conditions matching the report from Nemesis. Both
Tourmeister and Buff Skeleton are using v1.0 Descent 2 data. No one
with more recent data has reported a problem.
Add a try { ... } catch { ... } block to trap the partial_range
exception, log it, and then ignore paging in that vclip. This should
approximate what 0.58.1 did, assuming that the crash is due to a
negative `num_frames`. If the crash is due to a large positive
`num_frames`, this change will still prevent the previously reported
crash, but may only move the crash elsewhere. Various other subsystems
react badly to using a vclip that has not been paged in.
This change is tested not to break an otherwise working game. It is not
tested to confirm that it produces a working game for users who
experienced a crash without it.
Reported-by: Tourmeister <https://forum.dxx-rebirth.com/showthread.php?tid=943&pid=12159#pid12159>
Reported-by: Buff Skeleton <https://forum.dxx-rebirth.com/showthread.php?tid=943&pid=12290#pid12290>
References: <https://github.com/dxx-rebirth/dxx-rebirth/issues/371>
Currently, DXX_USE_SDL_REDBOOK_AUDIO is an alias for !SDL2. However,
this patch enables interested users to readily patch out Redbook even
for SDL1.
References: <https://github.com/dxx-rebirth/dxx-rebirth/issues/82>
The player appearance sound was tied to the player appearance vclip,
but this is wrong because the vclip has a shorter lifetime than the
sound. This mistake was previously hidden by the hack that caused
non-permanent sounds to be routed off to a separate queue that lost the
association between object and sound. Commit 4a98e79 eliminated that
hack because it complicated the work of that commit. However, without
the hack, object sound effects cannot outlive their host object.
Fix this by binding the sound to the position of the appearance effect,
not to the appearance object. This works since the appearance effect
cannot move, so there was no value to binding the sound to the object.
This solution could not be used for objects that move and terminate
before their associated sound effect.
Reported-by: Ryusei117 <https://github.com/dxx-rebirth/dxx-rebirth/issues/88#issuecomment-390054173>
Fixes: 4a98e796ab ("Prevent stacking weapon rotation sounds")
User jcotton42 suggested copying a D2X-XL feature: preserving the
directory structure of the user's missions area when showing a New Game
dialog. This was substantially more trouble than it should have been,
but the result is good.
Previously, the dialog presented all missions at any depth below the
starting point, and sorted them as if they were all in the root
directory.
Now:
- Empty directories are hidden entirely. There is nothing for the user
to do in them, so there is no point showing them.
- A directory with exactly one entry has that entry promoted into the
parent, since there is no ambiguity about what the user would want.
If the parent in turn has only that one promoted element when the scan
of the parent finishes, then the element can be promoted up again.
This continues until the root is reached or until a level has more
than one entry. For this purpose, both missions and directories count
as entries.
- Directory entries are decorated to inform the user how many
immediate subdirectories are present, how many missions are present
immediately in the directory, and how many missions total are present,
counting all subdirectories. If there are zero immediate
subdirectories, then the directory count is not shown. For this
purpose, directories that were hidden due to a lack of missions are
not counted.
- Sub-dialog boxes for inner directories use a title that reminds the
user of the path so far, and recaps the directory/mission statistics.
- On entry to the New Game dialog, if the last played mission is in a
sub-dialog, appropriate sub-dialogs are opened so that the last played
mission can be pre-selected.
Currently, there is no in-game override to return to the prior rollup
rules.
Requested-by: jcotton42 <https://github.com/dxx-rebirth/dxx-rebirth/issues/392>
Even when empty and default-constructible, const members must be
explicitly constructed. Add a default constructor to do this.
Fixes: 893e8cde06 ("Combine hud gauge parameters")
gcc-5 rejects `V == V::E` where the first V is a variable of type V and
the second V is a scope specifier to indicate the member E in the type
V. gcc-7 permits this.
Fixes: 5cafec2268 ("Use enum for gauges weapon_type")