Commit graph

8397 commits

Author SHA1 Message Date
Kp acac40bc25 Mark global constants as constexpr
s/^const \([^*=]*{};\)/constexpr \1/
2016-07-23 04:10:42 +00:00
Kp b0821cff55 Fix inverted sense of -use_players_dir
Fixes: 4d483ca88f ("Simplify use of SysUsePlayersDir")
2016-07-22 02:25:17 +00:00
Kp d67ada45ef Coerce pilot names to lowercase on startup
Mako88 reports that using `-pilot Mixed` on Windows causes crashes
during multiplayer setup, but `-pilot mixed` does not crash.  This is
not reproducible on case sensitive filesystems, probably because case
sensitive systems recognize that `Mixed.plr` and `mixed.plr` are not the
same file.  In both cases, the underlying plr file name was all
lowercase.  Coerce the pilot name to lowercase when it is converted to a
plr file name.  This also fixes a minor bug where the check for a
user-specified extension of `.plr` would recognize `-pilot alice.plr`,
but not recognize `-pilot alice.PLR`.

This is a workaround for a bug in the network code, which becomes
confused and crashes when the player's callsign contains mixed case.

Reported-by: Mako88 <https://github.com/dxx-rebirth/dxx-rebirth/issues/188>
2016-07-21 01:43:23 +00:00
Kp 4d483ca88f Simplify use of SysUsePlayersDir 2016-07-21 01:43:22 +00:00
Kp a940edcf77 Fix longstanding unbalanced quote in help text
Fixes: 6b8f64cca2 ("If it can't find descent2.hog/d2demo.hog, still print some useful info")
2016-07-21 01:43:22 +00:00
Kp 39dc9db869 Use range_for for demo iteration 2016-07-21 01:43:22 +00:00
Kp 1e07e4c566 Remove leading underscore for dxx_constructor_base_type 2016-07-21 01:43:22 +00:00
Kp c9d1928e8c Refactor recording build environment 2016-07-21 01:43:22 +00:00
Kp e446965511 Remove unnecessary wall number check in kill_stuck_objects
Callers are expected to filter out invalid numbers.  Even if they do
not, the only use of the number is to match entries in Stuck_objects.
An invalid match could cause a call to vobjptr() with an invalid index,
but that would be diagnosed by the valptridx checking, so no invalid
memory access will occur.
2016-07-21 01:43:22 +00:00
Kp 278c10dec0 Move flush_fcd_cache calls up from kill_stuck_objects
Many callers of kill_stuck_objects call it twice, once for each of two
walls.  Move the flush_fcd_cache up to occur only once, rather than once
per wall.
2016-07-21 01:43:21 +00:00
Kp 82e6ab130b Remove kill_stuck_objects() in wall_illusion_off
Objects cannot become stuck in illusionary walls, so there is nothing to
kill.
2016-07-21 01:43:21 +00:00
Kp 0cfd7c8dbd Remove unused variable SOF_PLAYING 2016-07-21 01:43:21 +00:00
Kp 24f59cc9d0 Add stub flush_fcd_cache for D1 2016-07-21 01:43:21 +00:00
Kp b1bdf4aa53 Unify D1/D2 remove_obsolete_stuck_objects
After fixing the bogus lifeleft assignment, the D2 version is equivalent
to a more thorough version of the D1 version.  Delete the D1 version and
use the D2 version for both games.
2016-07-21 01:43:21 +00:00
Kp 7d926f0741 Remove bogus remove_obsolete_stuck_objects lifeleft change
This assignment looks bogus.  If the signature saved when the object
became stuck is different from the signature of the object currently
using that slot, then remove_obsolete_stuck_objects kills the object
using that slot.  Signatures are defined to change when the object slot
is freed and reused.  Therefore, this statement kills the new object
that took the slot of the obsolete object.  This new object may be
important, such as a spawned robot or a weapon.
2016-07-21 01:43:21 +00:00
Kp f29630bd4a Propagate MAX_STUCK_OBJECTS 2016-07-21 01:43:21 +00:00
Kp c854c25d44 Fix wall_remove_side bogus use of IS_CHILD on wallnum
IS_CHILD is for segments, not walls.
2016-07-21 01:43:20 +00:00
Kp 7bb63324bd Remove useless cast in newdemo.cpp 2016-07-16 16:52:04 +00:00
Kp 3550f2d7ff Flatten render type hierarchy 2016-07-16 16:52:04 +00:00
Kp c636dc4b98 Convert various static const expressions to constexpr 2016-07-16 16:52:04 +00:00
Kp f2ecb6401a Simplify do_powerup_frame tests 2016-07-16 16:52:04 +00:00
Kp b0526d6928 Respect verbosebuild=0 for Windows resource files 2016-07-16 16:52:04 +00:00
Kp 3b0d4bf8be Fix lto run of size_type format test 2016-07-16 16:52:04 +00:00
Kp 5963ff747b Use fallthrough for abandoning marker input 2016-07-15 03:43:04 +00:00
Kp 674a9213f8 Add workaround for Win32 wrong type for size_t
GCC std::array uses std::size_t for its size_type.  On Linux/amd64,
`std::size_t` is `unsigned long`.  On Win32, `std::size_t` is
`unsigned int`.  This provokes format string warnings because an
unsigned int is passed where the format string declares an unsigned
long.  On Win32, `unsigned int` and `unsigned long` are the same size,
so `unsigned long` could have been used to avoid this problem by
maintaining consistency with Linux, but it was not.  This may have been
an attempt to achieve bug compatibility with Microsoft's types.

Add a workaround by defining a macro DXX_PRI_size_type in the style of
inttypes.h PRI* macros.  Use an SConf test to determine the correct
value by inspecting which compilation runs succeed.  Currently, Linux
needs "l", Win32 needs "", and Win64 needs "I64".
2016-07-15 03:43:03 +00:00
Kp a9aa5552b7 Pass SConf test macros into later tests
Some tests may benefit from the results of earlier tests.  Other tests
may give different results if the macros from earlier tests are defined.
SCons dependency checking rejects including dxxsconf.h during testing,
so save the results of self._check_macro and insert them into later
tests.  Some tests define their macros in other ways.  The macros from
those tests and are not yet inserted.
2016-07-15 03:43:03 +00:00
Kp dfcf28ff10 Rename fmtcheck macros to follow standard conventions 2016-07-15 03:43:03 +00:00
Kp f892ace24b Remove useless cast in multibot.cpp 2016-07-15 03:43:03 +00:00
Kp a274ea0ee8 Remove useless cast in multi.cpp 2016-07-15 03:43:03 +00:00
Kp 68dd57021c Remove useless cast in mine.cpp 2016-07-15 03:43:03 +00:00
Kp 14c7683afa Remove useless cast in gameseq.cpp 2016-07-15 03:43:03 +00:00
Kp a0c2ac469a Remove useless cast in font.cpp 2016-07-15 03:43:03 +00:00
Kp 80a087806e Remove useless cast in gamefont.h 2016-07-15 03:43:02 +00:00
Kp 12ff40bd93 Remove useless cast in gamefont 2016-07-15 03:43:02 +00:00
Kp 5a16845d74 Remove useless cast in scalec 2016-07-15 03:43:02 +00:00
Kp 81da15382b Remove useless cast in scanline 2016-07-15 03:43:02 +00:00
Kp 4526f509f3 Remove useless cast in f2db
Bare floating point literals are double.
2016-07-15 03:43:02 +00:00
Kp 279dc555dd Propagate digiobj MAX_Q 2016-07-15 03:43:02 +00:00
Kp 3ebf1f009f Reorder digiobj channel clear 2016-07-15 03:43:02 +00:00
Kp 946e7bd4ee Move some digi symbols to dcx 2016-07-15 03:43:02 +00:00
Kp 74299f7e88 Encourage tail call optimizations in digiobj 2016-07-15 03:43:01 +00:00
Kp 63651b8c68 Move PIGGY_PAGE_IN into namespace dsx with GameBitmaps 2016-07-15 03:43:01 +00:00
Kp aa95cbfccc Move set_thrust_from_velocity to dcx 2016-07-15 03:43:01 +00:00
Kp 5d7c7d6454 Make assert_equal inherit integral_constant 2016-07-15 03:43:01 +00:00
Kp 957016621e Remove support for Boost.TypeTraits
Boost enable_if works differently from std::enable_if, so the build is
broken when using Boost.TypeTraits.  The broken code has been present
for a long time and no one reported it.  Remove the fallback to Boost.
2016-07-15 03:43:01 +00:00
Kp 40d4bf4f09 Remove unused inherit_void_ptr_handler 2016-07-15 03:43:01 +00:00
Kp 54258ef2ec Remove unnecessary forward declarations 2016-07-14 01:59:05 +00:00
Kp 44592ddc31 Flatten kconfig type hierarchy 2016-07-14 01:59:05 +00:00
Kp 96f78e1032 Use constexpr for MAX_BITMAP_FILES 2016-07-14 01:59:05 +00:00
Kp 6905b5bd1d Use constexpr for MAX_SOUNDS 2016-07-14 01:59:04 +00:00