The code that provides the 0.75x multiplier to laser bolts when they're fired
using the quad laser is present in D1 as in D2, however it is incorrect and
results in it not being applied. As such, it is more accurate to exclude the
multiplier when compiling D1.
Thanks to SaladBadger for the tip.
Commit 2bcc7bb371 restricted
Laser_create_new to only create lasers for known weapon types. This
seemed like a good idea, but broke custom levels that use undocumented
laser types. It also replaced logic that coerced invalid weapon numbers
into a type 1 laser with logic that prevented firing such weapons at
all. This rendered robots with unknown or broken weapon data unable to
fire.
Commit 0c30fa7cf3 relaxed the logic to
prevent firing only in editor builds, but allow firing unknown or
invalid weapon types in release builds. Firing unknown weapon types may
work. Firing invalid weapon types may cause the game to crash when data
is accessed beyond the end of the defined weapon data. This caused the
crash reported in issue #506.
Revert to the 0.58.1 rule that invalid weapons are coerced to be a
player level 1 laser. Add a diagnostic when such a weapon is fired,
since the level author should have requested that weapon explicitly if
that was intended.
Reported-by: heftig <https://github.com/dxx-rebirth/dxx-rebirth/issues/506>
Fixes: 2bcc7bb371 ("Only create lasers for known weapon types")
The existing test for gcc pr #82541 was insufficient, and allowed using
-Wduplicated-branches with gcc-7 in some cases it should not. Extend
the test to cover these cases.
newpath is a std::array and does not decay to char* automatically.
Use data() method to get char[], which does decay to char*.
This compile-time issue only affected Mac OS X.
mmontag reported that the OS X linker warns when attempting to search a
framework directory that does not exist. Suppress this warning by
checking for the directory and not adding it to the search path if it
does not exist.
Reported-by: mmontag <https://github.com/dxx-rebirth/dxx-rebirth/issues/503#issuecomment-619457491>
mmontag reports that tool_bundle.py cannot be parsed under Python 3.
Fortunately, the errors are all straightforward, so non-OS X systems can
see the errors when the file is imported. Normally, the file is only
imported when building for darwin, so non-OS X systems do not see the
problem.
- Add parentheses to print() calls. This is not consistent with the
rest of the Rebirth output scheme, but is simple to do.
- Adjust the syntax for raising exceptions.
Reported-by: mmontag <https://github.com/dxx-rebirth/dxx-rebirth/issues/503#issuecomment-619463994>
zicodxx reported in issue #449 that savegames created in a new build,
then loaded in an older one, may behave incorrectly in the old build.
This cannot be fixed in the new build without reverting the logic change
which caused it. Support for old builds has always been best effort, so
this will not be fixed. Add a release note about it.
Reported-by: zicodxx <https://github.com/dxx-rebirth/dxx-rebirth/issues/449>
Switch valptridx error style dispatching from using macro pasting to
using C++11 user-defined literals. This makes the code a bit easier to
read, and removes the need for a C99-conforming preprocessor here, which
should help anyone trying to port to Microsoft Visual Studio.
The new implementation also fixes a limitation of the previous
implementation. Before, an override that referenced an invalid name
could be silently ignored. Now, incorrect overrides cause an attempt to
use an undefined instantiation, which fails with a compilation error.
The minimum supported compiler versions now provide a depth-efficient
implementation of std::make_index_sequence, which removes the last
reason to carry a private implementation. In the case of clang, it
appears to have a special compiler intrinsic used to implement its
std::make_index_sequence.
Switch to the compiler-provided version for both gcc and clang.
- Remove the d1x, d2x ebuilds. Gentoo uses the dxx name now, so the old
placeholder ebuilds are no longer needed.
- Update the dxx snapshot ebuild to a current commit.
- Resynchronize the dxx snapshot ebuild from the dxx live ebuild.
- This adds support for USE=valgrind and for USE=data.
- Add a helper script to generate snapshot ebuilds for arbitrary
commits.
gcc-4.9 support is now difficult to test due to system libraries linking
to newer symbols. gcc-4.9 is unsupported upstream, as are gcc-5 and
gcc-6. Raise the minimum required gcc version to the minimum version
supported upstream.
Debian Jessie shipped gcc-4.9.2, and support for this target was the
primary motivator for retaining gcc-4.9 support. Jessie ended regular
support in June 2018, and will end Long Term Support in June 2020. It
seems unlikely that Jessie would receive a snapshot build of Rebirth in
the months it has left.
Debian Stretch shipped gcc-6, but is currently considered "oldstable"
and has been superseded by Debian Buster. Further, Debian Stretch
provides a package for gcc-7, so Stretch users can still build Rebirth
using only packages available from the package manager.
Commit d355ef4030 removed a seemingly unnecessary modification of the
global variable grd_curcanv->cv_font, after eliminating all local reads
of it. However, a non-local read, buried in listbox_mouse, depended on
grd_curcanv->cv_font being set to a MEDIUM font. After that commit,
grd_curcanv->cv_font retained its prior value, which is not a MEDIUM
font. This caused listbox_mouse to compute an incorrect height of the
lines in the listbox, which manifested as the game choosing the wrong
line when the mouse is clicked in the listbox.
Fix the problem by explicitly using MEDIUM3_FONT, since that was
usually the value left in grd_curcanv->cv_font prior to that commit. In
some cases, a different MEDIUM font would be left there, but all the
MEDIUM fonts have the same height, so they are interchangeable for this
purpose.
Reported-by: Q3BFG10K <https://github.com/dxx-rebirth/dxx-rebirth/issues/498>
Fixes: d355ef4030 ("Pass font to various drawing functions")
andrew-strong reported that using SDL2, with the window set to full
screen, but a windowed size less than full screen, caused letterbox
sequences, such as the player ship destroyed sequence, to render in a
subwindow sized to the dimensions game would have when unmaximized, even
if the game window is maximized at the time of the sequence.
tycho suggested a change that resolves this issue, and basic testing
showed no unwanted side effects.
Reported-by: andrew-strong <https://github.com/dxx-rebirth/dxx-rebirth/issues/399>
Suggested-by: tycho <https://github.com/dxx-rebirth/dxx-rebirth/issues/399#issuecomment-583688998>
ziplantil reported that in Descent 1, if a player has an empty Vulcan
cannon, and no energy, then attempting to fire a weapon would play the
SOUND_ALREADY_SELECTED clip every frame until the player ceased trying
to fire. The problem does not impact Descent 2 since Descent 2 does not
play this sound sample when trying to activate a weapon that is already
active.
If the current weapon is already LASER_INDEX, then
select_primary_weapon(LASER_INDEX) simplifies to:
```
// Pointless, player already using this weapon
newdemo_record_player_weapon(LASER_INDEX)
if (Primary_weapon != LASER_INDEX) {
// skipped, path is false
}
else
{
if (wait_for_rearm) // true for this path
// Bad, plays every frame
digi_play_sample(SOUND_ALREADY_SELECTED);
}
// Pointless, Primary_weapon already is LASER_INDEX
Primary_weapon = LASER_INDEX;
if (weapon_name)
{
// skipped, path is false
}
```
Skipping the call avoids two pointless statements, one bad statement,
and nothing useful. Therefore, the simplest fix for the problem is to
call select_primary_weapon(LASER_INDEX) only if the primary weapon is
not currently LASER_INDEX.
Reported-by: ziplantil <https://github.com/dxx-rebirth/dxx-rebirth/issues/499>