Commit graph

3414 commits

Author SHA1 Message Date
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 12ff40bd93 Remove useless cast in gamefont 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 aa95cbfccc Move set_thrust_from_velocity to dcx 2016-07-15 03:43:01 +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 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 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
Kp 0b6af7fcbe Propagate MAX_OBJ_BITMAPS 2016-07-10 04:11:35 +00:00
Kp ca18195390 Propagate MAX_TEXTURES 2016-07-10 04:11:35 +00:00
Kp 6580c37b6e Propagate MAX_STOLEN_ITEMS 2016-07-10 04:11:34 +00:00
Kp 71ab00beb8 Propagate MAX_BOSS_TELEPORT_SEGS 2016-07-10 04:11:34 +00:00
Kp 1486a5a01b Move Robot_sound_volume to dcx 2016-07-09 17:58:36 +00:00
Kp 1bd32fedb5 Remove unused STRING_LENGTH 2016-07-09 17:58:35 +00:00
Kp a63fe62cb3 Add typedef for multi_allow_powerup_text type 2016-07-09 17:58:35 +00:00
Kp 2713baf5d3 Move HUD_MESSAGE_LENGTH to hud.cpp 2016-07-09 17:58:35 +00:00
Kp e8d5992797 Remove unused CENTER_STRING_LENGTH 2016-07-09 17:58:35 +00:00
Kp 7af34fa844 Fold create_n_segment_path calls 2016-07-09 17:58:35 +00:00
Kp be8022ff41 Add typedef for GMNames array 2016-07-09 17:58:35 +00:00
Kp 3779bc25a0 Define Robot_names only if EDITOR 2016-07-09 17:58:34 +00:00
Kp fee76e6ced Define Powerup_names only if EDITOR 2016-07-09 17:58:34 +00:00
Kp 7d07c24a5a Invert sense of digi.cpp firstplay to already_playing
Invert the sense so that the variable can be bss-initialized.  Rename
the variable to reflect the inverted sense.
2016-07-09 17:58:34 +00:00
Kp 2ccfdfcbc3 Make digi_win32_midi_song_playing static 2016-07-09 17:58:34 +00:00
Kp 9511ca8aaf Convert simple multi fix casts from C style to static_cast<> 2016-07-07 03:08:13 +00:00
Kp a7c64d6f97 Convert simple int casts from C style to static_cast<> 2016-07-07 03:08:13 +00:00
Kp 1dd60cc5be Rewrite simple fix64 casts from C style to static_cast<>
s/(\(fix\(64\)\?\))\s*\(\w\+\);/static_cast<\1>(\3);/g
2016-07-07 03:08:13 +00:00
Kp 9128ff7c35 Move Next_laser_fire_time to player_info 2016-07-06 01:54:26 +00:00
Kp bd3db75108 Move Next_missile_fire_time to player_info 2016-07-06 01:54:26 +00:00
Kp a554d7e2c4 Move Next_flare_fire_time into player_info 2016-07-06 01:54:25 +00:00
Kp 6251848c5f Move Missile_gun into player_info 2016-07-06 01:54:25 +00:00