Commit graph

10571 commits

Author SHA1 Message Date
Kp 6f9657cf9b Move controlcen_death_silence to d_level_unique_control_center_state 2019-08-15 01:34:22 +00:00
Kp 9f0b455f6d Move Reactor_strength to d_level_shared_control_center_state 2019-08-15 01:34:22 +00:00
Kp 9689a7f7d2 Move Base_control_center_explosion_time to d_level_shared_control_center_state 2019-08-15 01:34:22 +00:00
Kp e58daea0da Restrict reactor-sleep logic to D2 levels
This code was not in D1, so running it when emulating D1 on the D2
engine is incorrect.
2019-08-15 01:34:22 +00:00
Kp f2eebca6c3 Move Last_time_cc_vis_check to d_level_unique_control_center_state 2019-08-15 01:34:22 +00:00
Kp d9d536afda Move Control_center_player_been_seen to d_level_unique_control_center_state 2019-08-15 01:34:22 +00:00
Kp 0826881fa0 Move Dead_controlcen_object_num to d_level_unique_control_center_state 2019-08-15 01:34:22 +00:00
Kp d0a9d8db98 Move Control_center_present to d_level_unique_control_center_state
This could be a shared variable instead, since it cannot be directly
influenced by gameplay.  However, it is influenced by the game mode, and
keeping shared variables that are mode-specific would be more complexity
for very little savings.
2019-08-15 01:34:22 +00:00
Kp edc1ec0729 Fold multi_do_controlcen_destroy call of net_destroy_controlcen 2019-08-15 01:34:22 +00:00
Kp 11278eb153 Rename Control_center_next_fire_time to Frametime_until_next_fire
Clarify the type of the value.
2019-08-15 01:34:22 +00:00
Kp 195f5e7d9f Move Control_center_next_fire_time to d_level_unique_control_center_state 2019-08-15 01:34:22 +00:00
Kp 885296b136 Move Control_center_been_hit to d_level_unique_control_center_state 2019-08-15 01:34:22 +00:00
Kp f988948eef Move Countdown_timer to d_level_unique_control_center_state 2019-08-15 01:34:22 +00:00
Kp 21c927584b Move Total_countdown_time to d_level_unique_control_center_state 2019-08-15 01:34:22 +00:00
Kp 707b3c5b0d Move Countdown_seconds_left to d_level_unique_control_center_state 2019-08-15 01:34:22 +00:00
Kp 519edb9e16 Move Control_center_destroyed to d_level_unique_control_center_state 2019-08-15 01:34:22 +00:00
Kp 0d9e032c60 Factor out some multi net_destroy_controlcen usage 2019-08-15 01:34:22 +00:00
Kp fd09f9d36b Add is_proximity_bomb_or_any_smart_mine
Zico's commit 38fabd7c49 open-coded a test for a robot smart mine.  So
far, this is the only place it is needed, but others might arise.  Move
the test and its comment out to a static helper function.
2019-08-15 01:34:22 +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 b8cb819bb4 Make read_sndfile static for D1
Currently, only D2 can reread sounds.  Restore static for D1
read_sndfile.
2019-08-15 01:34:22 +00:00
Kp aa9bea4b92 Remove redundant declaration of Piggy_hamfile_version 2019-08-15 01:34:22 +00:00
Kp 0d66e531a0 Merge branch 'ziplantil/custom-sxx' into master 2019-08-15 01:34:22 +00:00
ziplantil d9c113c315 load .s11,.s22 when loading D2 mission to allow custom sounds 2019-08-13 22:47:22 +03:00
Christian Beckhäuser 38fabd7c49 Fixed two issues with game's transparency effects feature (which I introduced when implementing it): First, Superprox mines dropped by enemies were made undesirably transparent since they have their own ID not considered by is_proximity_bomb_or_smart_mine(). Second, only some force field textures in D2X had transparency effects since the game has two different textures for force fields - eclip num 78 and 93 - but only the former was defined and used in is_alphablend_eclip() 2019-08-08 11:57:52 +02:00
Kp ec234e0b8e Cache intermediate values in draw_mine_exit_cover 2019-08-06 03:02:32 +00:00
Kp 7f4c57b614 Merge https://github.com/ziplantil/dxx-rebirth.git branch 'exithatchfix' 2019-08-06 02:59:41 +00:00
Kp a4d3cbe5e5 Check for invalid orb dimensions when loading hoard data 2019-08-06 02:59:41 +00:00
Kp 31136cfd1b Fix undefined access if N_bitmaps <= 1
clang-check warns that if `N_bitmaps <= 1`, then
`DiskBitmapHeader_d1_read` will never run, but `bmh.wh_extra` will be
read in `bitmap_read_d1`.  Reorder the logic to return early if there
are no bitmaps.
2019-08-06 02:59:41 +00:00
Kp 04b50757c5 Explicitly test for nullptr in do_physics_align_object
clang-check warns about a potential binding a reference to nullptr in
the case that a segment has 0 sides.  While this is silly and
impossible, a related failure mode would occur if vm_vec_dot never
indicated a side as good.  This should be impossible, but the test for
nullptr is cheap, so add it to silence the checker.
2019-08-06 02:59:41 +00:00
Kp 4295eb7e4a Pass CPPDEFINES into compilation database 2019-08-06 02:59:41 +00:00
Kp 334da8e8e6 Move some SDL-only symbols into !DXX_USE_OGL 2019-08-06 02:59:41 +00:00
Kp f0faac66d4 Move Seismic_tremor_magnitude to d_level_unique_seismic_state 2019-08-06 02:59:41 +00:00
Kp 4b0f797d7e Move Secret_return_orient to d_level_shared_segment_state 2019-08-06 02:59:41 +00:00
Kp 4eb61ecf5c Fix original game bug: failure to reset Level_shake_duration
The game has an alternative level file format that is not normally used.
This format can enable seismic events on a timer, independent of reactor
countdown or earthshaker usage.  However, this feature is not reset on
loading a regular level after playing a level with the timer-driven
seismic events, so the regular level shakes according to the timer, even
though its author never designed it to do so.

Fix that by resetting the timer state to 0 before loading a regular
level.
2019-08-06 02:59:41 +00:00
Kp ad16d90dd5 Move Secret_return_segment to d_level_shared_segment_state 2019-08-06 02:59:41 +00:00
Kp 7691e98304 Factor out seismic effect processing
Level seismic events and Earthshaker seismic events start with different
intensities, but share everything afterward.  Move the common parts to a
function.
2019-08-06 02:59:41 +00:00
Kp 625d863c55 Move Smega_detonate_times to d_level_unique_seismic_state::Earthshaker_detonate_times 2019-08-06 02:59:41 +00:00
Kp 140711cb35 Move Next_seismic_sound_time to d_level_unique_seismic_state 2019-08-06 02:59:41 +00:00
Kp 596a17db69 Fold Seismic_sound_playing into Next_seismic_sound_time
When Next_seismic_sound_time is non-zero, a seismic sound is playing.
When Next_seismic_sound_time is zero, no sound is playing.  Use this to
eliminate the explicit tracking variable Seismic_sound_playing.
2019-08-06 02:59:41 +00:00
Kp 8fd231e501 Move Seismic_tremor_volume to d_level_unique_seismic_state 2019-08-06 02:59:41 +00:00
Kp 42778ff7fa Move Level_shake_duration to d_level_shared_seismic_state 2019-08-06 02:59:41 +00:00
Kp b8fa75c8cb Move Level_shake_frequency to d_level_shared_seismic_state 2019-08-06 02:59:41 +00:00
Kp 184337e6e1 Move Seismic_disturbance_end_time to d_level_unique_seismic_state 2019-08-06 02:59:40 +00:00
Kp ef0e64d421 Move awareness events to d_level_unique_robot_awareness_state 2019-08-06 02:59:40 +00:00
Kp 03214c0e6f Fix original game bug that meant to reset camera flag, but did not 2019-08-06 02:59:40 +00:00
Kp 215252b8ca Fold Final_boss_is_dead into Final_boss_countdown_time 2019-08-06 02:59:40 +00:00
Kp 5455a65d33 Move Final_boss_countdown_time to d_game_unique_state 2019-08-06 02:59:40 +00:00
Kp 3d8c02fefa Move Final_boss_is_dead to d_game_unique_state 2019-08-06 02:59:40 +00:00
Kp 7d803cf63e Move some save/restore functions to dcx/dsx as appropriate 2019-08-06 02:59:40 +00:00