Commit graph

62 commits

Author SHA1 Message Date
Kp d9d2bac092 Use enum class for apply_damage_to_player::possibly_friendly
Also, remove a redundant invulnerability check in one caller.
apply_damage_to_player already tests for invulnerability and returns if
appropriate.
2022-07-23 20:58:10 +00:00
Kp 6215ef8e06 Pass LevelSharedRobotInfoState to various functions that need it 2022-07-09 13:39:29 +00:00
Kp 1c57e1032d Use enumerated_array for shared_segment::sides 2022-01-15 20:39:10 +00:00
Kp fbe3bbd0fa Use enum sidenum_t in more places 2022-01-09 15:25:42 +00:00
Kp 9c08b233a5 Move collision functions into namespaces 2021-06-28 03:37:51 +00:00
Kp fc63029833 Move more symbols into namespaces 2020-12-26 21:17:29 +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 3d8c02fefa Move Final_boss_is_dead to d_game_unique_state 2019-08-06 02:59:40 +00:00
Kp 8764cad457 Use unsigned in more prototypes 2019-03-03 00:31:09 +00:00
Kp b3cd7588ef Move Delta_lights into d_level_shared_destructible_light_state 2018-12-30 00:43:58 +00:00
Kp 46644b4e91 Move Dl_indices into d_level_shared_destructible_light_state 2018-12-30 00:43:58 +00:00
Kp aa9e6da297 Pass Dl_indices as context 2018-12-30 00:43:57 +00:00
Kp a0ed5cb283 Pass Vclip as context 2018-10-21 00:24:07 +00:00
Kp 3408e3a0cd Switch to shared_segment arguments where possible 2018-06-24 05:06:15 +00:00
Kp aeedadba89 Unify D1/D2 scrape_player_on_wall 2017-09-08 00:56:37 +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 98c9374a12 Simplify powerup_grab_cheat_all path
Movement handling has an ugly hack that tries to grab powerups near the
console player, but it reuses general collision handling and fails to
check whether the player is alive.

Add a liveness check.  Place the check so that it happens once, before
the objects are scanned, rather than being needlessly repeated for every
object.

Refactor the collision code to let the movement hack skip the parts it
does not need.

Reported-by: ryusei117 <https://github.com/dxx-rebirth/dxx-rebirth/issues/302#issuecomment-275816259>
2017-02-04 23:10:29 +00:00
Chris Taylor 4cc801f42f Remove calls to window_close(Game_wind) when game finished or over
Replace calls to window_close(Game_wind) with returning window_event_result::close to game handler. Applies to when DoEndGame() is called, DoGameOver() is called, aborting in the kmatrix screen (multiplayer game) during AdvanceLevel() and playing one demo frame causes playback to stop in GameProcessFrame(). Closing a window within its handler is problematic - it can result in an unstable state.
2017-01-08 21:08:50 +08:00
zico ffb68756e3 Changed handling of scrape_player_on_wall(), preventing it to occur multiple times per frame. 2016-12-02 13:37:08 +01:00
Kp ee1003f29f Move conditionally compiled code into namespace dsx 2016-08-25 04:05:32 +00:00
Kp 3677e7036e Pass object &to collide_player_and_powerup 2016-04-23 17:59:47 +00:00
Kp 7ea89fda9f Pass object_base &to bump_one_object 2016-04-23 17:59:47 +00:00
Kp 0c299248d4 Pass object &to apply_damage_to_player 2016-04-06 03:34:14 +00:00
Kp e283a22709 Use enum class for check_volatile_wall 2016-01-29 04:05:47 +00:00
Kp bc488a8f57 Improve check_volatile_wall 2016-01-29 04:05:47 +00:00
Kp e549f3451e Use inline namespace dsx for object.h 2015-12-05 22:57:25 +00:00
Kp cfc35e819d Use inline namespace dcx for common/maths 2015-12-05 22:57:24 +00:00
Kp bb41075adb Add preprocessor guards around types that vary by game 2015-11-26 02:56:55 +00:00
Kp ad8b4230df Move fwdsegment.h -> fwd-segment.h for consistency 2015-10-10 03:44:14 +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
Kp 15fb75c1c7 Fix check_header_includes build 2015-07-25 23:10:45 +00:00
Kp 6792c1bc4b Enable -Wunused-parameter 2015-04-26 20:15:56 +00:00
Kp 3eb8f4813e Pass vcobjptr_t to apply_damage_to_controlcen 2015-04-22 02:44:30 +00:00
Kp adbefd39c4 Minimize unnecessary fields passed to check_effect_blowup 2015-04-19 04:18:52 +00:00
Kp 516b8b2397 Reduce collide.h includes 2015-04-19 04:18:51 +00:00
Kp d63be88eb0 Propagate use of vsegptridx_t 2014-11-23 04:58:45 +00:00
Kp 317fffe5da Move #endif to cover functions that need trigger 2014-11-17 04:02:26 +00:00
Kp 53aa70cecb Use vsegptridx_t 2014-10-28 03:08:51 +00:00
Kp 8aeeb3da0e Pass bump_one_object vms_vector by const & 2014-10-26 21:44:38 +00:00
Kp 012435f5c4 Pass collide_*_and_* arg by &
Use const& where possible.  Some are non-const due to the recent FVI
hack that resets the collision point late.
2014-10-26 21:36:40 +00:00
Kp 9a32e151ff Pass check_effect_blowup vms_vector arg by & 2014-10-26 21:36:35 +00:00
Kp 9dea4b4d88 Pass sound vms_vector arg by & 2014-10-26 21:33:50 +00:00
Kp eef8bb3365 Pass collide_two_objects vms_vector arg by & 2014-10-10 02:30:13 +00:00
Kp bcb26678e2 Remove unused hitpt on check_volatile_wall 2014-10-10 02:29:47 +00:00
Kp b95759aecc Propagate use of objptridx 2014-08-23 23:53:56 +00:00
Kp 66cb80c343 Propagate use of objptridx 2014-08-17 20:31:18 +00:00
Kp 125d9257be Use special type names for segment/object numbers 2014-08-13 02:57:12 +00:00
Kp da1bd2fd08 Precompute collision tables 2014-06-24 03:40:31 +00:00
zico ad7cb106bc Changed custom D1X license to GPLv3 2014-06-01 19:55:23 +02:00