Commit graph

82 commits

Author SHA1 Message Date
Kp 52aa9891b9 Simplify passing weapon to do_missile_firing
When the player fires a generic secondary, the choice of proximity bomb
versus super-mine is never read.  When the player specifically drops a
bomb, only that choice needs to be read.  Pass the chosen weapon as an
argument, and avoid computing the choice on the path where it is never
read.
2022-07-23 20:58:10 +00:00
Kp c0e12eee3f Push player object lookup from do_missile_firing to caller
The caller already needs the player object for other purposes, so let
the caller pass it down to do_missile_firing.
2022-07-23 20:58:10 +00:00
Kp 0dd5d6e0d5 Split guided missile release local/remote handling
Two paths are always local.  One path is always remote.  Split the
handler function to remove the locality test and rely on the caller's
knowledge of whether the affected player is local.
2022-07-23 20:58:10 +00:00
Kp 0cb0b5cdc0 Use playernum_t for guided missile player number 2022-07-23 20:58:10 +00:00
Kp 4886afdf93 Lift which_bomb from do_missile_firing to caller
Callers already have the player_info available, and will need the value
of bomb in a subsequent commit.  Lift it here.
2022-07-16 15:26:12 +00:00
Kp 1d65a83d73 Use primary_weapon_index_t for do_laser_firing weapon_id 2022-07-16 15:26:12 +00:00
Kp 6215ef8e06 Pass LevelSharedRobotInfoState to various functions that need it 2022-07-09 13:39:29 +00:00
Kp d6c43f56af Use enum class for gun_num_t 2022-07-09 13:39:29 +00:00
Kp 504b38759c Use enum class for weapon_sound_flag
Pass the silent/audible flag as an enum:uint8_t to avoid type confusion
issues.
2022-04-24 20:42:01 +00:00
Kp 8f8989e049 Propagate do_laser_firing nfires as 1
Every caller passes `1`, so remove the parameter and always use `1`.
For backward compatibility with the previous network protocol, continue
to send a `1` in the network message.
2022-04-17 22:27:19 +00:00
Kp 8e81726ac5 Use enum class for laser_level
Remove stored_laser_level, which existed primarily to enforce type
separate.  `enum class` can do that without the need for a separate
class type.
2020-08-24 01:31:28 +00:00
Kp 53761500f1 Qualify uses of std::array 2020-05-02 21:18:42 +00:00
Kp 30091902af Simplify valptridx types where possible
Switch valptridx::ptr to a reference type.
Switch valptridx::ptridx to a reference type or to ::ptr.

Fix up uses of operator-> accordingly.
2019-12-22 05:34:08 +00:00
Kp 8997f622bd is_proximity_bomb_or_smart_mine*: s/smart/player_smart/g
As documented in zico's commit 38fabd7c49, robot smart mines have a
different ID number than player smart mines.  Rename the test functions
to clarify that they only recognize player smart mines, but not robot
smart mines.

git grep -l is_proximity_bomb_or_smart_mine | xargs sed -i -e 's/is_proximity_bomb_or_smart_mine/is_proximity_bomb_or_player_smart_mine/g'
2019-08-15 01:34:22 +00:00
Kp 2ceb0168f2 Split is_proximity_bomb_or_smart_mine* to d1x/d2x 2019-08-15 01:34:22 +00:00
Kp 65555b6eba Require only object_base for object_to_object_visibility 2019-07-27 17:48:03 +00:00
Kp 040de5b10e Rename ObjectState to LevelUniqueObjectState for consistency 2018-12-30 00:43:57 +00:00
Kp 9360a41816 Move Guided_missile into d_level_object_state 2018-10-08 03:58:48 +00:00
Kp 852ab312d5 Remove global Network_laser_track 2018-03-05 01:40:44 +00:00
Kp 599ac9dee0 Always qualify valptridx type/factory
Previously, valptridx used PREFIX for allow-invalid+mutable, c#PREFIX
for allow-invalid+const, v#PREFIX for require-valid+mutable, vc#PREFIX
for require-valid+const.  Convert the types, factories, and all usage
sites to specify a qualifier for all four combinations:

	im#PREFIX -> allow-invalid+mutable
	ic#PREFIX -> allow-invalid+const
	vm#PREFIX -> require-valid+mutable
	vc#PREFIX -> require-valid+const

Changes to common/include/valptridx.h and common/include/fwd-valptridx.h
are manual.  All other changes are generated by:

	git grep -lz -e '\(obj\|seg\|clwall\|wall\|actdoor\|trg\)\(ptridx\|ptr\|idx\)\(_t\)\?\>' | xargs -0 sed -i -e 's/\<\(v\?\)\(\(obj\|seg\|clwall\|wall\|actdoor\|trg\)\(ptridx\|ptr\|idx\)\(_t\)\?\)\>/\1m\2/g'

for the 'm' prefix and:

	git grep -lz -e '\(obj\|seg\|clwall\|wall\|actdoor\|trg\)\(ptridx\|ptr\|idx\)\(_t\)\?\>' | xargs -0 sed -i -e 's/\<\([cm]\(obj\|seg\|clwall\|wall\|actdoor\|trg\)\(ptridx\|ptr\|idx\)\(_t\)\?\)\>/i&/g'

for the 'i' prefix.
2017-06-10 03:31:02 +00:00
Kp a55de34884 Pass canvas to Laser_render 2017-03-11 19:56:26 +00:00
Kp 7df99350dd Pass player to do_laser_firing_player 2017-02-08 23:34:41 +00:00
Kp 012238ba14 Fold segnum.h into fwd-segment.h 2016-12-24 18:12:17 +00:00
Kp 117e205ff0 Fold spreadfire calls to Laser_player_fire_spread 2016-12-10 17:51:09 +00:00
Kp a70d1ac646 Pass player_info &to omega_charge_frame 2016-11-19 18:09:26 +00:00
zico 407805be42 Restored proper scaling of Min_trackable_dot by adding new function get_scaled_min_trackable_dot(). This was previously a fixed defintion based on Descent 1's result of Min_trackable_dot's scaling if FrameTime < F1_0/16 which did not properly reflect the intended result of Descent 2 nor did it properly align to different FrameTime/HOMING_TURN_RATE settings. get_scaled_min_trackable_dot() will scale the result accordingly for whatever fixed or variable time setting is given and respecting each game's individual scaling. 2016-10-10 15:37:25 +02:00
Kp 8248438ffa Move Omega_charge to player_info 2016-08-28 22:41:47 +00:00
zico dad3e953e9 Retored historically accurate versions of homing tracking and lifeleft calculations for D1X and D2X based on their original source code releases instead of mixing them together. Further encabsuled NEWHOMER code to disable unused functions and variables if NEWHOMER is disabled. 2016-08-17 13:43:01 +02:00
Kp 139741ec40 Pass const object_base to Laser_render 2016-07-23 04:10:42 +00:00
Kp 6251848c5f Move Missile_gun into player_info 2016-07-06 01:54:25 +00:00
zico 64400ff284 Restored original Descent 2 HOMING_MAX_TRACKABLE_DOT for D2X build, formerly using the Descent 1 setting 2016-05-10 14:22:53 +02:00
Kp 8e86a3586d Use #ifdef dsx to guard dsx namespace 2016-01-09 16:38:15 +00:00
Kp 9ceedc96a8 Propagate valptridx requirement up 2016-01-09 16:38:14 +00:00
Kp db9fb0ed42 Move more symbols into namespace dcx/dsx 2015-12-22 04:18:50 +00:00
Kp b683b4cc68 Scope weapon type 2015-12-03 03:26:49 +00:00
Kp 31d538ebe2 Use helper for robot weapon type 2015-12-03 03:26:48 +00:00
Kp bb41075adb Add preprocessor guards around types that vary by game 2015-11-26 02:56:55 +00:00
Kp 2196008178 Move fwdobject.h -> fwd-object.h for consistency 2015-10-10 03:44:14 +00:00
Kp 946048c54b Move valptridx subtypes to individual fwd headers 2015-08-22 20:43:04 +00:00
zico 2bfe21183e Changing homing turn times to 30 FPS base again by user request 2015-06-01 15:27:34 +02:00
zico b04282e791 Using one global yet independent timeer for homing missiles similar to d_tick instead of having one in each missile object. Also decreased HOMING_TURNING_TIME to 25 FPS base 2015-05-30 18:29:41 +02:00
Kp ed86b53395 Make Muzzle_queue_index static 2015-05-09 17:39:01 +00:00
Kp b5eae4c809 Split create_smart_children 2015-05-09 17:38:58 +00:00
Kp 08a42a68ff Pass vcobjptridx to laser_are_related 2015-05-09 17:38:58 +00:00
Kp 8d849b2b39 Wrap laser level in class
Move enum laser_level_t to weapon.h for the new class.
2015-04-26 20:15:56 +00:00
Kp 90fbebf8fd Convert most global arrays to array<> 2015-04-02 02:36:52 +00:00
Kp 12ad357b8d Move Wimp Menu to macro 2015-03-28 17:18:02 +00:00
Kp fbac119095 Propagate use of objptridx_t 2014-12-23 04:20:27 +00:00
Kp cf31cc4a5d Switch Laser_render to vobjptr_t 2014-11-30 22:09:23 +00:00
Kp 53aa70cecb Use vsegptridx_t 2014-10-28 03:08:51 +00:00