Commit graph

10330 commits

Author SHA1 Message Date
Kp 65cd43e7d0 Add FreeBSD to allowed platforms
pkubaj proposed extending the if/elif tree.  This patch instead switches
to a loop, which avoids repeating any strings and is cleaner to extend
when another platform shows up needing normalization.

Requested-by: pkubaj <https://github.com/dxx-rebirth/dxx-rebirth/pull/426>
2019-05-28 03:39:23 +00:00
Kp 340e679cd5 Suppress bogus -Wunused-lambda-capture warning to fix clang build
clang treats -Wunused as a request for -Wunused-lambda-capture, which is
good, except that -Wunused-lambda-capture is overzealous.  It should
warn for captures that are not used in the body.  It should not, but
does, warn for captures which are used in the body when such captures
are not required by the standard.  Since 4 of the supported gcc versions
require that capture, removing the capture is not an option at this
point.  Add a test to suppress the clang warning in this case, and hope
that eventually clang will warn only for uses that are actually unused.

This removes the need for parts of <https://github.com/dxx-rebirth/dxx-rebirth/pull/426> (by pkubaj).
2019-05-28 03:39:23 +00:00
Kp 3a5b4ddd7b Fix clang signed/unsigned mismatch
Fixes: bfcff2cefe ("Fix crash loading guidebot with unreachable goal")
2019-05-28 03:39:23 +00:00
Kp 6772bac84e Remove per-game README files; prefer the unified README 2019-05-26 22:07:45 +00:00
Kp 0e684a9469 Merge branch 'add-readme' of https://github.com/fskirschbaum/dxx-rebirth
Requested-by: fskirschbaum <https://github.com/dxx-rebirth/dxx-rebirth/pull/422>
2019-05-26 22:07:42 +00:00
Kp e4ce2f0a7f Update to new multi-template issue template system
Suggested-by: fskirschbaum <https://github.com/dxx-rebirth/dxx-rebirth/pull/422#issuecomment-495965125>
2019-05-26 21:53:38 +00:00
F. Stephen Kirschbaum a8f7fcab57
Update README.md
- Update forum links
- Tweak new Issue Reporting section text
- Escape asterisk
2019-05-25 22:40:28 -05:00
Kp bfcff2cefe Fix crash loading guidebot with unreachable goal
Remove use of object_guidebot_cannot_reach and instead track the
reachability of the object as a separate flag.  This allows the game to
remember when an object was found, but unreachable.  Previously, it
would store only that some unreachable object was found.  Now, it stores
the index of the unreachable object.  This extra information is not used
yet.

Reported-by: Dainslaif <https://github.com/dxx-rebirth/dxx-rebirth/issues/421>
Fixes: c3cead4319 ("Move Escort_goal_index to d_unique_buddy_state")
2019-05-26 00:44:37 +00:00
Kp 1f03083b68 Add support for generating clang compilation database 2019-05-26 00:44:37 +00:00
Kp c43b9cd430 Fix builddir prefix/suffix confusion
Commit 0e81c05 moved the offending line, but it was already wrong in
54d57a37c9.

Fixes: 0e81c0594e ("Move settings that affect the build to UserBuildSettings")
2019-05-26 00:44:37 +00:00
Kp 7e01a658c6 Prefer storing .sconsign in a build/ subdirectory 2019-05-26 00:44:37 +00:00
Kp 50efc4fdec Reduce scope of i in custom.cpp 2019-05-26 00:44:37 +00:00
F. Stephen Kirschbaum eac85142bd
Create README.md
When reading [announcement](https://www.dxx-rebirth.com/news/dxx-rebirth-rebooted/) it referenced the README file for reporting issues but there isn't a root README...  and the ISSUE_TEMPLATE.md wasn't referenced by the README files within the sub-folders... and generally it felt like there should be a README

... every project should have an up front README file.  (This is one.)
2019-05-23 22:01:08 -05:00
Chris 44212ed77b Changed default tracker host address from dxxtracker.hopto.org to tracker.dxx-rebirth.com as requested by A Future Pilot 2019-05-17 15:36:58 +02:00
Kp 3a5e203638 Fix Windows build of hmp.cpp
Reported-by: zicodxx <private>
Fixes: 2243cd7f58 ("Use xrange for loops with zero start and constant numerical end")
2019-05-17 02:13:22 +00:00
Kp f79f6ab1cc Make switches invulnerable to blast_nearby_glass
`blast_nearby_glass` calls `check_effect_blowup`, but ignores the result.
If `check_effect_blowup` executes a blow-up effect, and the blown object
is a switch, the return value will instruct the caller to execute the
associated trigger.  Since `blast_nearby_glass` ignores the return
value, it never executes a trigger.  This was originally masked by a bug
that passed undefined data from `blast_nearby_glass` to
`check_effect_blowup`, which usually confused `check_effect_blowup` into
treating the explosion as not originating from the player.  This
confusion then forced an early return when a switch was hit, effectively
accidentally making switches invulnerable to `blast_nearby_glass`.
Commit f6352e7 fixed the data confusion, allowing `check_effect_blowup`
to recognize that the explosion came from a player's weapon.  However,
it did not add handling for the trigger, so now `blast_nearby_glass` can
destroy the switch without activating the trigger.  This is at the least
annoying, and in some levels may make progress impossible.  There are
two ways to resolve this:

- Fix the logic to always execute the switch when the switch is
  destroyed, whether by direct hit or by `blast_nearby_glass`.
- Restore the quirk that switches are invulnerable to
  `blast_nearby_glass`.

Conveniently, the `force_blowup_flag` is set by `blast_nearby_glass` and
clear for all other callers, so it can be used to recognize that the
caller will not handle the switch.  Use this to implement choice 2.

Even with this change, a direct hit by a missile can still destroy a
switch and activate its trigger, since that is handled through
`collide_weapon_and_wall`.  Thus, players can still use the technique of
using a guided missile to activate an otherwise impossible switch.

Fixes: f6352e7957 ("Pass correct object to check_effect_blowup")
Reported-by: wm4 <https://github.com/dxx-rebirth/dxx-rebirth/issues/419>
2019-05-11 20:18:29 +00:00
Kp 48527630dd Remove __attribute__((packed)) on shortpos for gcc-9 support
gcc-9 warns on taking the address of an unaligned member in a packed
structure.  This structure does not need to be packed.  Remove
__attribute__((packed)) and fix the code to implement I/O correctly
without packing.
2019-05-11 20:18:29 +00:00
Kp f8769b9805 Fix gcc-9 -Wstringop-truncation in titles.cpp 2019-05-11 20:18:29 +00:00
Kp 175fc1f650 Fix gcc-9 -Wstringop-truncation in gamepal.cpp 2019-05-11 20:18:29 +00:00
Kp 2c91eda5bc Fix various gcc-9 -Wformat-truncation warnings 2019-05-06 00:36:16 +00:00
Kp 5ea591af18 Fix gcc-9 build of d_range.h
gcc-9 rejects `std::enable_if<false,
std::integral_constant<std::integral_constant, 1> 0>::type` before it
notices that the whole expression is eliminated due to SFINAE.  Use
`std::common_type` to coerce the inner integral_constant to an
appropriate integer type, which allows the expression to be well-formed
enough to reach the SFINAE check from enable_if, then be silently
removed from the overload resolution set.
2019-05-06 00:36:16 +00:00
Kp 10de0975f4 Fix gcc-9 build of joy.cpp
gcc-9 fails to constrain `i`, then warns that very large `i` would
be truncated.  Add `cf_assert` and `xrange` to inform gcc that `i` is
constrained.
2019-05-06 00:36:16 +00:00
Kp 39303358c8 Fix subsequent tests after detecting Boost.Config
Fixes: 1131868f61 ("Fix -Wimplicit-fallthrough for non-Boost users")
2019-05-06 00:36:16 +00:00
Kp 1131868f61 Fix -Wimplicit-fallthrough for non-Boost users
Users who do not install Boost cannot include <boost/config.hpp>.
SConstruct handled this by disabling the macro DXX_BOOST_FALLTHROUGH,
but did not override gcc's default-enabled (via -Wextra)
use of -Wimplicit-fallthrough=3, so users would get a fallthrough
warning and the build would fail.  Adjust this area to explicitly probe
for -Wno-implicit-fallthrough when Boost.Config is not available.

Fixes: 063bf29225 ("Enable -Wimplicit-fallthrough=5; fix resulting breaks")
Reported-by: Jayman2000 <https://github.com/dxx-rebirth/dxx-rebirth/issues/417>
2019-05-04 21:58:18 +00:00
Kp 340dc79bec Fix check_header_includes=1 build 2019-05-04 18:27:37 +00:00
Kp 57a850fce5 Use enumerate() to iterate some MAX_SIDES_PER_SEGMENT loops 2019-05-04 18:27:37 +00:00
Kp eb39a8087e Use xrange for render loops 2019-05-04 18:27:37 +00:00
Kp a52d8106ce Use xrange for loops with simple identifier start and simple identifier end
s/for\s*(\s*\(\w\+\)\s\+\(\w\+\)\s*=\s*\([A-Za-z_0-9]\+\)\s*;\s*\2\s*!=\s*\([A-Za-z_0-9]\+\)u\?\s*;\s*\(++\s*\2\|\2\s*++\s*\))/range_for (const \1 \2, xrange(\3, \4))/
2019-05-04 18:27:37 +00:00
Kp a7806dde5d Use xrange for loops with constant numerical start and simple identifier end
s/for\s*(\s*\(\w\+\)\s\+\(\w\+\)\s*=\s*\([0-9]\+\)u\?\s*;\s*\2\s*!=\s*\([A-Za-z_0-9]\+\)u\?\s*;\s*\(++\s*\2\|\2\s*++\s*\))/range_for (const \1 \2, xrange(\3u, \4))/
2019-05-04 18:27:37 +00:00
Kp 3bd10610fc Use xrange for loops with zero start and simple identifier end
s/for\s*(\s*\(\w\+\)\s\+\(\w\+\)\s*=\s*0\+u\?\s*;\s*\2\s*!=\s*\([A-Za-z_0-9]\+\)u\?\s*;\s*\(++\s*\2\|\2\s*++\s*\))/range_for (const \1 \2, xrange(\3))/
2019-05-04 18:27:37 +00:00
Kp a74914eb9c Use xrange for loops with constant numerical start and end
s/for\s*(\s*\(\w\+\)\s\+\(\w\+\)\s*=\s*\([0-9]\+\)u\?\s*;\s*\2\s*!=\s*\([0-9]\+\)u\?\s*;\s*\(++\s*\2\|\2\s*++\s*\))/range_for (const \1 \2, xrange(\3u, \4u))/
2019-05-04 18:27:37 +00:00
Kp 538286e02c Add range helper zip() 2019-05-04 18:27:36 +00:00
Kp 2243cd7f58 Use xrange for loops with zero start and constant numerical end
s/for\s*(\s*\(\w\+\)\s\+\(\w\+\)\s*=\s*0\+u\?\s*;\s*\2\s*\(!=\|<\)\s*\([0-9]\+\)u\?\s*;\s*\(++\s*\2\|\2\s*++\s*\))/range_for (const \1 \2, xrange(\4u))/
2019-05-04 18:27:36 +00:00
Kp 15ac8a5ac6 Add utility xrange for range-based loops with precomputed bounds
Utility xrange, inspired by the Python2 feature of the same name,
provides an object that returns successive values from [start, end).  It
is useful when the end index is known in advance, and is particularly
helpful when that index is expensive to recompute.
2019-05-04 18:27:36 +00:00
Kp b5ddcfdd7b Unify D1/D2 openable_doors_in_segment conditions 2019-05-04 18:27:36 +00:00
Kp 4d8d244bb9 Move spreadfire,helix orientation to player_info 2019-05-04 18:27:36 +00:00
Kp 0675e4bcad Factor out exit tunnel loop 2019-04-28 00:53:40 +00:00
Kp 3f31200997 Unify create_path_points D1/D2 check for doorway 2019-04-28 00:53:40 +00:00
Kp fb6323ed42 Use check_untrusted on boss robot messages 2019-04-28 00:53:40 +00:00
Kp 3e25804026 Use NSDMI wherever possible 2019-04-28 00:53:40 +00:00
Kp 3cc644eb52 Fix gcc-7 build of joy.cpp
gcc-7 needs an additional cf_assert to inform it that e.idx is
constrained.  Without this, it assumes e.idx could have any positive
value, then issues a fatal warning when INT_MAX does not fit in the
provided buffer.

    common/arch/sdl/joy.cpp: In function 'void dcx::joy_init()':
    common/arch/sdl/joy.cpp:281:6: error: '%u' directive output may be truncated writing between 1 and 10 bytes into a region of size between 0 and 4 [-Werror=format-truncation=]
    common/arch/sdl/joy.cpp:281:6: note: directive argument in the range [1, 2147483647]
    common/arch/sdl/joy.cpp:333:13: note: 'snprintf' output between 6 and 24 bytes into a destination of size 8
2019-04-28 00:53:40 +00:00
Kp d6b2ba1775 Fix gcc-4.9 build
gcc-4.9 lacks std::cbegin, std::cend.  Fortunately, nothing in the code
uses those, so remove tests for them.

Fixes: 5e434cbe95 ("Require availability of C++11 begin")
2019-04-28 00:53:40 +00:00
Kp 0c99a97c63 Factor out player/fireball light emission 2019-04-13 18:00:07 +00:00
Kp cc248602fd Track headlights in d_level_unique_light_state 2019-04-13 18:00:07 +00:00
Kp f69ba8ae82 Remove obsolete draw_vclip_object parameter lighted
It is always 0.
2019-04-13 18:00:07 +00:00
Kp 645daa2304 Format joystick indices as unsigned values 2019-04-13 18:00:07 +00:00
Kp e61100a858 Fix integer truncation in quaternion setup
Commit 47a6f744d split out redundant code, but accidentally stored
temporaries in a `signed short` instead of a `fix` as they should have
been.  This truncated some values, causing odd results whenever
quaternions were used.  Fix the problem by storing the intermediate
results in a `fix`.

Fixes: 47a6f744d8 ("Factor out vms_quaternion_from_matrix division")
Reported-by: Ninjared <https://forum.dxx-rebirth.com/showthread.php?tid=1113>
2019-04-13 18:00:07 +00:00
Kp 063bf29225 Enable -Wimplicit-fallthrough=5; fix resulting breaks
This enables using -Wimplicit-fallthrough with ccache+distcc, which
strip the fallthrough comments, but do not strip the attribute
annotationns.
2019-04-04 04:29:03 +00:00
Kp 5e434cbe95 Require availability of C++11 begin
Remove the fallback to Boost.Begin.  C++14 is now the minimum supported
standard, and any conforming C++14 compiler should have a working C++11
std::begin.
2019-04-04 04:29:03 +00:00
Kp 9bed4f6d78 Fix bogus borders due to fill_n length/value transposition
Reported-by: derhass <https://github.com/dxx-rebirth/dxx-rebirth/issues/415>
Fixes: 7bcbaae230 ("Tighten protection against grs_bitmap bm_data confusion")
2019-03-29 02:34:53 +00:00