Commit graph

8434 commits

Author SHA1 Message Date
Kp a1ab71f5ad Avoid calling make_unique<...>({})
The compiler may or may not recognize that the temporary T{} passed to
make_unique can be omitted.  Help it by passing nothing, then explicitly
clearing the returned data as a separate step.
2016-08-06 19:55:24 +00:00
Kp cbeb42e48c Flatten some newmenu type hierarchy 2016-08-06 19:55:24 +00:00
Kp 2e88fec559 Flatten some ui type hierarchy 2016-08-06 19:55:24 +00:00
Kp 5fb379430f Flatten some serial type hierarchy 2016-08-06 19:55:24 +00:00
Kp 6b4e639f65 Flatten newmenu_subfunction_t type 2016-08-06 19:55:24 +00:00
Kp c772385f81 Fix check_header_includes=1 Linux build 2016-08-06 19:55:24 +00:00
Kp 20ae1e2b4a Remove useless casts in d1 custom.cpp 2016-08-06 19:55:24 +00:00
Kp 1774676571 Use class to wrap Primary_weapon+Delayed_primary 2016-08-06 19:55:23 +00:00
Kp 37ec5e25d4 Declare ~UI_GADGET as protected
UI_GADGET subclasses should always be deleted through the subtype
pointer.
2016-08-06 19:55:23 +00:00
Kp df8dc7cc46 Include fwd-partial_range.h in physfs_list.h
All users of physfs_list.h included fwd-partial_range.h or
partial_range.h; physfs_list.h did not include either, but assumed one
would be available.  Include fwd to fix check_header_includes=1 build.

Fixes: ff67afd440 ("Propagate partial_range up into PHYSFSX_findFiles family")
2016-08-06 19:55:23 +00:00
Kp 7128141c55 Use enum for newmenu item type 2016-08-05 04:12:21 +00:00
Kp 3f051100a5 Move newmenu_item text_len into union 2016-07-31 22:25:51 +00:00
Kp 52d0ded9ee Cache change_res resolution computations 2016-07-31 22:25:50 +00:00
Kp f5c6b0fbf6 Move newmenu_item min_value into union 2016-07-31 22:25:50 +00:00
Kp c9aba5b04e Move newmenu_item max_value into union 2016-07-31 22:25:50 +00:00
Kp 26904ea6b3 Use range_for for newmenu_create_structure radio reset 2016-07-31 22:25:50 +00:00
Kp 344a567d1b Move newmenu_item group into union 2016-07-31 22:25:50 +00:00
Kp dd483773e0 Factor out repeated HIRESMODE tests 2016-07-31 22:25:49 +00:00
Kp 35ce30eb94 Simplify net_udp_send_fly_thru_triggers 2016-07-31 22:25:49 +00:00
Kp 7d3c3288a9 Remove support for array other than std::array
Building with Boost.Array fails due to name lookup errors.  These could
be fixed, but since no one has reported them and they are fairly old,
Boost.Array appears to be unused.  Remove support for it.

Building with std::tr1::array fails due to missing features in
std::tr1:array relative to std::array.  No one has reported this either,
so remove support for std::tr1:array.

Move the test for std::array into the Cxx11RequiredFeature list so that
it is run as part of the group test, rather than as a separate
statement.
2016-07-31 22:25:49 +00:00
Kp 2f938a35d9 Rewrite parenthesized uses of old-style numeric casts to static_cast
s/(\(float\|\(unsigned \)\?\(int\|long\)\|double\|short\|unsigned\))\s*(/static_cast<\1>(/g
2016-07-31 22:25:49 +00:00
Kp a230d24226 Allow trailing comments after num_levels and num_secrets 2016-07-30 21:56:31 +00:00
Kp c97e9af14c Use player object passed to maybe_steal_secondary_weapon 2016-07-25 03:48:09 +00:00
Kp 66e0fb1a6e Cache some get_local_player_cloak_time references 2016-07-25 03:48:09 +00:00
Kp 23a85cae27 Cache some get_local_player_invulnerable_time references 2016-07-25 03:48:09 +00:00
Kp 3a86bc6f40 Simplify various multi loops 2016-07-25 03:48:09 +00:00
Kp e30ed3621a Fold show_one_extra_view do_cockpit_window_view calls 2016-07-25 03:48:09 +00:00
Kp db42c2bc56 Fold game_draw_multi_message gr_printf calls 2016-07-25 03:48:09 +00:00
Kp 21ad09ef3d Fold show_netplayerinfo gr_string calls 2016-07-25 03:48:08 +00:00
Kp 582fef2a37 Fold show_netplayerinfo gr_printf calls 2016-07-25 03:48:08 +00:00
Kp ea65c74ba9 Move last_player_bump into player_info.Last_bumped_local_player 2016-07-25 03:48:08 +00:00
Kp f671e6781d Narrow scope of random vectors 2016-07-24 04:04:25 +00:00
Kp 8a46462846 Move lavafall_hiss_playing into player_info 2016-07-24 04:04:25 +00:00
Kp 8fef6a07b4 Pass const object_base to obj_unlink 2016-07-23 04:10:43 +00:00
Kp 139741ec40 Pass const object_base to Laser_render 2016-07-23 04:10:42 +00:00
Kp 176c0efdae Cache Muzzle_data reference 2016-07-23 04:10:42 +00:00
Kp 99bbd0cf26 Mark global constants as constexpr
s/^const \([^*]*=.*;\)/constexpr \1/
2016-07-23 04:10:42 +00:00
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