Commit graph

8529 commits

Author SHA1 Message Date
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
Kp 6554b96b66 Remove unused SWAPINT64 2016-07-14 01:59:04 +00:00
Kp dcdff564f4 Fold newdemo_record_primary_ammo in draw_hud 2016-07-14 01:59:04 +00:00
Kp 3894c66b9b Fold do_missile_firing calls to multi_send_fire 2016-07-14 01:59:04 +00:00
Kp ec19c2ba89 Allow player to grab invulnerability powerup when FakingInvul
Previously, if the player was invulnerable, it was impossible to grab an
invulnerability powerup.  Relax this by allowing a spawn-induced fake
invulnerability not to count as invulnerable for this test.  Players
still cannot grab an invulnerability powerup if they are still under the
influence of a prior invulnerability powerup.
2016-07-14 01:59:04 +00:00
Kp ed7376c695 Pass object & to update_item_state::process_powerup 2016-07-14 01:59:04 +00:00
Kp d5a64c4f33 Factor out object count tests
An optimizing compiler should inline these tests.  Moving them out makes
the code easier to read, since the statements can focus on what is
updated, rather than how it is done.
2016-07-14 01:59:04 +00:00
Kp 663d6df312 Use ?: for MultiLevelInv_CountPlayerInventory flag increment 2016-07-14 01:59:03 +00:00
Kp 023ed08c1c Switch to vcobjptr for MultiLevelInv_CountPlayerInventory player
The index is not needed and the player should not be modified by the
scan.
2016-07-14 01:59:03 +00:00
Kp e65b93b750 Cache reference to MultiLevelInv.Current
Modify MultiLevelInv_CountPlayerInventory to ease conversion to a member
function.
2016-07-14 01:59:03 +00:00
Kp 96d9ae4e4a Optimize initial MultiLevelInv clear
Change the clearing of MultiLevelInv during initialization to reduce
wasted stores.  MultiLevelInv has three fields.

Field ::Initial is not accessed by MultiLevelInv_CountLevelPowerups, and
is overwritten immediately afterward, so it does not need to be cleared
first.

Field ::Current is unconditionally cleared by
MultiLevelInv_CountLevelPowerups, so it does not need to be cleared
first.

Field ::RespawnTimer is not accessed by
MultiLevelInv_CountLevelPowerups, but needs to be cleared.  Add a clear
of field .RespawnTimer and remove the clear of the entire structure.
2016-07-14 01:59:03 +00:00
Kp 5af44fa27a Refactor to propagate MultiLevelInv_Count initial
All callers of MultiLevelInv_Count passed a constant value.  Factor
out the top level blocks of MultiLevelInv_Count into helper functions,
then create two new functions corresponding to MultiLevelInv_Count(0)
and MultiLevelInv_Count(1), implemented by calling the appropriate new
helper functions.
2016-07-14 01:59:03 +00:00
Kp 1d568fa56e Move MultiLevelInv_Count for vulcan/gauss to use fallthrough 2016-07-14 01:59:03 +00:00
Kp a502342654 Remove -Wl,--insert-timestamp when $SOURCE_DATE_EPOCH is set 2016-07-14 01:59:02 +00:00
Kp ab09fa1931 Reorder Buddy_sorry_time update 2016-07-14 01:59:02 +00:00
Kp 05db30a6ff Fix piggy cast when sizeof(size_t) != sizeof(void *) 2016-07-14 01:59:02 +00:00
Kp 39895e5643 Rewrite declarations of ushort * to standard uint16_t * 2016-07-14 01:59:02 +00:00
Kp 59750d3c29 Rewrite declarations of ubyte * to standard uint8_t * 2016-07-14 01:59:02 +00:00
Kp 613a7ecbbb Rewrite parenthesized uses of uint to standard unsigned 2016-07-14 01:59:02 +00:00