Commit graph

10108 commits

Author SHA1 Message Date
Kp 676cab8921 Adjust d_event_mouse_moved member types for SDL2
References: <https://github.com/dxx-rebirth/dxx-rebirth/issues/82>
2018-06-27 03:34:34 +00:00
Kp d20901edba Adjust physfsrwops.cpp for SDL2
References: <https://github.com/dxx-rebirth/dxx-rebirth/issues/82>
2018-06-27 03:34:34 +00:00
Kp 60a99f1ea2 Allow longer mission titles in New Game dialog 2018-06-27 03:34:34 +00:00
Kp d1a4e3b7a1 Update Gentoo ebuild to current stable-0.60.x
_p38 since the target commit is 38 commits after tag 0.60.0-beta2.
2018-06-24 18:05:48 +00:00
Kp 30a83eec41 Eliminate some uses of valptridx::operator-> 2018-06-24 05:06:15 +00:00
Kp c97b41404c Factor out pick_connected_drop_segment 2018-06-24 05:06:15 +00:00
Kp 6fca290663 Pass object& to read_flying_controls 2018-06-24 05:06:15 +00:00
Kp 0fd7e0e4ce Pass context arrays to WALL_IS_DOORWAY 2018-06-24 05:06:15 +00:00
Kp 3408e3a0cd Switch to shared_segment arguments where possible 2018-06-24 05:06:15 +00:00
Kp 20caecfa0e Eliminate most uses of segment * 2018-06-24 05:06:15 +00:00
Kp fb68e7f9ec Eliminate use of side * 2018-06-24 05:06:15 +00:00
Kp 0c3e99f14c Split side uses based on shared vs unique 2018-06-24 05:06:15 +00:00
Kp 98e6b36145 Pass shared_segment for some segment I/O 2018-06-24 05:06:15 +00:00
Kp 2de3a1dd06 Pass unique_segment to objects_in 2018-06-24 05:06:14 +00:00
Kp 4ae88b6594 Pass only shared_segment to compute_segment_center 2018-06-24 05:06:14 +00:00
Kp 6d0d68d188 Split some segment uses based on shared vs unique
Leave `sides` in `shared_segment` to minimize churn.  Parts of it must
move to `unique_segment` before this project finishes.
2018-06-24 05:06:14 +00:00
Kp 06f10c88f5 Fix stack buffer overflow in tracker handling
`memcpy(a, b, strlen(b));` is just a complicated way of writing
`strcpy(a, b);`, but even more dangerous since it omits the null
terminator.  `strcpy` on untrusted data is always unsafe, and this data
does not appear to be checked before use.  There is no need to copy the
data before using it, so switch to using it in place.  This eliminates
the security problem and makes the code slightly smaller.

Fixes: 730879d733 ("Updated handling of data sent by tracker. ...")
2018-06-22 04:42:18 +00:00
Kp 144515ff88 Warn users about tracker NAT hole punch feature
The new tracker automatically exposes LAN games to the Internet.  This
surprised one user rather badly, prompting him to think he had been
hacked.  Add a first-host warning explaining the feature and asking the
user to choose whether to enable NAT hole punch.

Reported-by: Tourmeister <https://forum.dxx-rebirth.com/showthread.php?tid=943&pid=12179#pid12179>
References: <https://github.com/dxx-rebirth/dxx-rebirth/issues/372>
Fixes: 730879d733 ("... Added support for handling ACKs from tracker and Hole punching between game clients via tracker. ...")
2018-06-21 03:08:36 +00:00
Kp e3d42913a4 Remove always-disabled editor/segment.cpp code
Various functions are preprocessor-excluded by `BOTTOM_STUFF`, which has
been 0 since btb added it in a196e6d554
(October 2001).  It seems unlikely that anyone will miss it.
2018-06-20 04:16:06 +00:00
Kp 0886aee3ea Always destroy control center when kill goal timer expires
Prior releases destroyed the control center when the kill goal timer
expired, even if no player had scored any kills.  General cleanup of
kill goal quirks eliminated this odd rule, but players liked the old
rule and want it back.  Restore it.
2018-06-20 04:16:06 +00:00
Kp 1d6ff380f7 Jump thread wall_is_doorway 2018-06-20 04:16:06 +00:00
Kp 946d5e19cb Pass screen width/height to HUD_SCALE_X/HUD_SCALE_Y explicitly 2018-06-20 04:16:06 +00:00
Kp a0fd264133 Tighten checks on create_path_points parameters 2018-06-20 04:16:06 +00:00
Kp fa8253fe22 Fix -Wsign-compare warnings in morph.cpp 2018-06-18 04:11:40 +00:00
Kp c8b04d0c83 Allow more items on screen in a listbox 2018-06-18 04:11:39 +00:00
Kp 6f4270ecd8 Store mission list filenames inside mission_menu 2018-06-18 04:11:39 +00:00
Kp 2a82207e91 Add unit tests for valptridx parameter validation 2018-06-17 05:04:38 +00:00
Kp 9b2d5d5162 Add debug hook $DXX_SCONS_DEBUG_USER_SETTINGS to log user_settings init
For the benefit of users less familiar with how setup is handled, add a
hook triggered by $DXX_SCONS_DEBUG_USER_SETTINGS to log initialization
of `user_settings` so that users can trace which values combined to
produce the observed results.
2018-06-17 05:04:38 +00:00
Kp 2f4524d3c2 Add screenshot=none to disable screenshot support
Per comment from kreator, some Apple systems now ship without a working
print screen key.  It makes no sense to provide print screen support
bound to a key which does not exist.  Add `screenshot=none` and activate
it on OS X to remove the unreachable screenshot support.
2018-06-16 04:13:37 +00:00
Kp d7bb190621 Fix assertion on close of game over window 2018-06-15 02:58:01 +00:00
Kp 39edf53496 Check for freed canvas in release builds 2018-06-14 02:39:15 +00:00
Kp c991f8b107 Prevent Point_segs underflow on player death
If the player commits suicide in Descent 2, Point_segs[-2] is accessed
because aip->hide_index = -1, aip->path_length = 0.  As a spot fix,
check for underflow and skip the access if it would be out of bounds.
2018-06-14 02:39:15 +00:00
Kp 8690bf4ca7 Change handling of explicitly blank briefings
Prior versions of Descent had a bug that specifying `briefing=` did not
inhibit a briefing.  Instead the directive was completely ignored.  The
engine would then use the auto-detected briefing if one was found.  This
quirk was eliminated during refactoring of the mission parsing code.
Unfortunately, some published missions relied on this bug: they ship a
briefing, but their mission file explicitly states that there is no
briefing.  Players expect the briefing to play despite the mission
stating that there is none.

Reorder the logic to restore the bug that `briefing=` is ignored.

Reported-by: Calmarius <https://forum.dxx-rebirth.com/showthread.php?tid=1054>
Fixes: 6020c9c013 ("Use d_fname for DOS filenames")
2018-06-13 02:02:58 +00:00
Kp 5526de4c10 Simplify case insensitive lookups 2018-06-13 02:02:58 +00:00
Kp d5bfeb0813 Fix OS X build break
Github user bdamm (Rebirth forum user dammfine) reports[1][2][3] a build
failure on OS X, likely caused by clang failing to implement forwarding
constructors fully.  The Rebirth fallback to variadic constructor
forwarding is imperfect, and in this case caused a failure.  Add an
explicit conversion to disambiguate the ternary expression's type.

[1]: Rebirth forum report: https://forum.dxx-rebirth.com/showthread.php?tid=1055
[2]: Github commit comment: ccc2a288f1?diff=unified#commitcomment-29322121
[3]: Github issue: https://github.com/dxx-rebirth/dxx-rebirth/issues/391

Reported-by: bdamm <https://github.com/dxx-rebirth/dxx-rebirth/issues/391>
Fixes: ccc2a288f1 ("Simplify HUD_SCALE_X_AR, HUD_SCALE_Y_AR")
2018-06-12 02:53:06 +00:00
Kp d786122b37 Force type of ternary expressions
When using variadic forwarding constructors
(`sconf_cxx11_inherit_constructor=force-failure`) instead of inheriting
constructors, some ternary expressions become ambiguous due to the
inability to forward the `explicit` modifier from the base class
constructor to the derived class.  Add explicit type overrides to
disambiguate these expressions to the result that the compiler would
have picked on its own when using inheriting constructors.
2018-06-12 02:53:06 +00:00
Kp 479235d5bc Mark variadic forwarding constructor as constexpr
This is safely ignored when the constructor cannot satisfy `constexpr`.
Without this modifier, forwarding to `constexpr` constructors is not
`constexpr`, which causes build failures.

clang-5 with `sconf_cxx11_inherit_constructor=force-failure`:
```
    similar/main/gauges.cpp:553:61: error: constexpr constructor's 1st parameter type 'const (anonymous namespace)::hud_x_scale_float' (aka 'const hud_scale_float<'x'>') is not a literal type
    similar/main/gauges.cpp:432:7: note: 'hud_scale_float<'x'>' is not literal because it is not an aggregate and has no constexpr constructors other than copy or move constructors
```

Fixes: 893e8cde06 ("Combine hud gauge parameters")
2018-06-12 02:53:06 +00:00
Kp 9b17450914 Fix up long broken glmprintf support
Switch the macro so that the result is always checked for correct
syntax.  This will prevent future bitrot.
2018-06-08 04:04:05 +00:00
Kp f51b7b6b20 Enforce separation of font X/Y scaling 2018-06-08 04:04:05 +00:00
Kp bde498894a Disallow operator=(T &&) && in valptridx
GCC std::remove_if overwrites removed elements using:

	*dstiter = move(*srciter);

This is fine for normal containers, but produces incorrect results when
*dstiter returns a proxy object instead of a reference.  In that case,
the proxy object is move-assigned from the source, then goes out of
scope.  If the move assignment did not write to underlying storage, as
valptridx proxy objects do not, then incorrect results occur.  This
broke ActiveDoor handling (fixed in 4a01fab66d98[1]) and has been a trap
waiting to recur.  Apply reference-qualifiers to valptridx objects so
that move-assignment requires an lvalue for the left-hand side.  This
permits normal use of move-assignment, but forces a compile error if
std::remove_if or similar are used on valptridx proxy objects.

[1]: 4a01fab66d
2018-06-08 04:04:05 +00:00
Kp e616ca4f47 Bump Gentoo ebuilds for beta2 2018-06-06 04:53:45 +00:00
Kp f0157490dc Fix check_header_includes=1 build 2018-06-06 04:53:45 +00:00
Kp bf84c3be4e Improve SCons diagnostics for missing required headers 2018-06-06 04:53:45 +00:00
Kp 93789f0666 Use valptridx for Dl_indices 2018-06-06 04:53:45 +00:00
Kp 1c1d92b399 Move valptridx factory iterator out to be generally available 2018-06-06 04:53:45 +00:00
Kp c04ae08c2e Preserve sign in HUD_SCALE_X,HUD_SCALE_Y
Fixes: ccc2a288f1 ("Simplify HUD_SCALE_X_AR, HUD_SCALE_Y_AR")
2018-06-06 04:53:45 +00:00
Kp b1ba7c27d1 Improve error handling/reporting for excessive blown bitmaps
Ill-formed levels can provoke this exception.  Downgrade the error from
a fatal exception to a CON_URGENT message.

Increase the array size to 32 from D1:7, D2:20, since each element is
only an int.

Switch from an assertion on bitmask overflow to a CON_URGENT warning.

Fixes: f7f416c3cb ("Trap blown bitmap overflow")
2018-05-30 02:43:22 +00:00
Kp d355ef4030 Pass font to various drawing functions 2018-05-19 23:21:42 +00:00
Kp fda1eb851e Pass fonts to LINE_SPACING 2018-05-19 23:21:42 +00:00
Kp 3049476e11 Change LINE_SPACING to a static inline function 2018-05-19 23:21:42 +00:00