Commit graph

10502 commits

Author SHA1 Message Date
Kp 427f45fdd7 Update Arch PKGBUILD
- Quote variables.
- Use https:// where possible.
- Combine mkdir calls.
- Fix broken links to GOG game pages.
2019-09-14 20:54:08 +00:00
Christian Beckhäuser 5b18219aac Restored fade to black after defeating the final Descent 2 boss which was lost along with software rendering screen fade effects. New implementation is done in similar way as the fade to white after regular countown reaches 0 while trying to restore the original effect as faithfully as possible (except that it doesn't pause the game during the effect). 2019-09-12 14:54:55 +02:00
Christian Beckhäuser b97091cf70 Added Arch PKGBUILDs 2019-09-12 13:29:17 +02:00
Kp 95abeb0d64 Fix SConf for Windows/SDL2
On all platforms, libSDL redefined `main` in a way that interfered with
SConf tests.  On some platforms, but not on Linux, libSDL2 does not
redefine `main`.  Based on a remark in the SDL2 migration guide, and the
apparent success (on Linux) after removing the `#undef`, I removed use
of `#undef` when building for SDL2.  As privately reported by zico,
libSDL2 on Windows still redefines `main`, so it still needs an explicit
`#undef` to let the SConf tests build correctly.  For platforms where
`#undef` is not needed, it is harmless.  Add this `#undef`
unconditionally, and update the inline comment.

Fixes: f491059ed7 ("Enable building with SDL2")
Reported-by: zicodxx <private>
2019-09-05 01:55:41 +00:00
Kp d6b2ab51a7 Merge branch 'Daivuk:axis_buttons' into master
Requested-by: Daivuk <https://github.com/dxx-rebirth/dxx-rebirth/pull/452>
2019-09-01 18:15:26 +00:00
daivuk 74ef8b02e6 Added axis buttons
Each axis can act as two buttons in both ways.
For example, a player might map slide left and slide right to J1 -A1 and J1 +A1 as button presses instead of the slide L/R axis.

This is mostly to fix XBox 360 Controller Left and Right triggers. But it can work on every axis if the player wishes to bind them.
2019-09-01 13:11:14 -04:00
Kp 183f11cc68 Do not charge player for failed primary weapon shots
Defer decreasing energy/vulcan until the object is confirmed to be
created.  This avoids charging the player for a shot that cannot be
created due to object exhaustion.

Defer updating Next_laser_fire_time, so that a player can immediately
try firing again.
2019-09-01 00:20:28 +00:00
Kp b6fd9eafd7 Do not charge player for failed secondary weapon shots
Defer decreasing energy (for flares) or secondary weapon count (for
secondaries) until the object is confirmed to be created.  This avoids
charging the player for a shot that cannot be created due to object
exhaustion.
2019-09-01 00:20:28 +00:00
Kp 275c4297fe Write back Final_boss_countdown_time on every update
Otherwise, unless FrameTime exceeds Final_boss_countdown_time in a
single frame, the time never advances and the level never ends.

Fixes: 215252b8ca ("Fold Final_boss_is_dead into Final_boss_countdown_time")
2019-09-01 00:20:28 +00:00
Kp 33c893e3e2 Make del+shift+b do fatal damage to every robot it explodes
Run through more of the normal death logic for the robots, instead of
simply deleting them from existence.
2019-09-01 00:20:28 +00:00
Kp 29c3551fa9 Fix crash loading endlevel data with no exit side
Reported-by: ziplantil <https://github.com/dxx-rebirth/dxx-rebirth/issues/450>
2019-08-31 17:31:51 +00:00
Kp 6629711b59 Import RPM spec file 2019-08-29 02:40:32 +00:00
Kp 9bb6a95e90 Set player name in Players[] at single-player game load
The prior commit fixed the problem of a blank pilot name for new games,
but loading an existing save game uses a different path and still did
not set the player's callsign.  Set it on load, too.

Fixes: 0c7de10512 ("Track chosen pilot name outside Players[]")
2019-08-29 02:40:32 +00:00
Kp 0b8f32d744 Set player name in Players[] at single-player game start
Single player games relied on the quirk that the pilot's name was always
kept in Players[], even outside a game.  Commit 0c7de10512 removed
that quirk, which had the unintended consequence that single player
games are now played by the anonymous pilot.  Set the player's callsign
during game setup so that the high score entry can be attributed
correctly.

Fixes: 0c7de10512 ("Track chosen pilot name outside Players[]")
Reported-by: Neurochild247 <https://github.com/dxx-rebirth/dxx-rebirth/issues/443>
Bisected-by: zicodxx <https://github.com/dxx-rebirth/dxx-rebirth/issues/443#issuecomment-523827234>
2019-08-25 17:53:57 +00:00
Kp e7275f8a8c Align capitalization of Data directory in instructions with the code
Commit e6169f17f9 switched from searching `Data/` to searching
`data/`.  For users on case-insensitive filesystems, this is a no-op and
the instructions that reference the `Data` directory continue to work.
For users on case-sensitive filesystems, the change broke accessing the
data directory, and caused the instructions to mislead.  Given the age
of the commit, fixing the capitalization now will likely cause more
problems than it solves.  Instead, fix the capitalization of the
instructions, so that users who follow the documentation get a working
setup.

Reported-by: krux02 <https://github.com/dxx-rebirth/dxx-rebirth/issues/447>
Fixes: e6169f17f9 ("Add 'Data' subdir as a searchpath, so D2X will find descent.pig and to simplify a lot of file opening/checking/closing code")
2019-08-25 17:06:34 +00:00
Kp c355e207fe Refactor song loading
Use an RAII object to manage allocations and keep the length and pointer
together.
2019-08-25 16:43:17 +00:00
Kp 4cf4e60d25 Merge branch ziplantil:dxxrsngsecretlvl to master 2019-08-24 19:49:22 +00:00
Kp 4504f3602a Hide lives-remaining count during demo playback
The demo system does not track this, so hide it instead of showing
incorrect information.
2019-08-24 18:14:16 +00:00
Kp 2b2ca67de5 Add enumerated_iterator::operator==
Defining _GLIBCXX_DEBUG introduces a dependency on this method.
Implement it so that _GLIBCXX_DEBUG can be used.
2019-08-24 18:14:16 +00:00
Kp dd0f639176 Avoid reducing player's highest-level when replaying a non-MRU level
If the level was not the most recently played, a save is forced so that
it can be marked as most recently played.  However, the logic to force
the save also forced an update of the highest-level field, even if that
reduced it.

- Rename the parameter to clarify its meaning.
- Add comments explaining the logic to force the save.
- Only update the highest-level field when the update would increase the saved value
2019-08-24 04:32:24 +00:00
Kp 211a172c1d Tighten checks on killer_obj type
Do not assume that a type other than OBJ_ROBOT will be OBJ_WEAPON.
Check explicitly for OBJ_WEAPON.

Reported-by: Johnsondr80 <https://github.com/dxx-rebirth/dxx-rebirth/issues/437>
2019-08-21 02:54:08 +00:00
Kp 653a705e90 Test that guided missile's parent is still a player
If a guided missile is in flight, and its owning player dies, the
player's type is changed to OBJ_GHOST.  The damage that killed the
player should have put the guided missile into autonomous mode, so for
this purpose, return that the missile is not actively guided.

Reported-by: Johnsondr80 <https://github.com/dxx-rebirth/dxx-rebirth/issues/437>
2019-08-21 02:54:08 +00:00
Kp 6d0cd8513e Recompute automap subcanvas on window size change
The subcanvas is positioned based on the dimensions of the containing
window, so it must be repositioned if the outer window is resized.

Reported-by: vLKp <https://github.com/dxx-rebirth/dxx-rebirth/issues/394>
Fixes: f491059ed7 ("Enable building with SDL2")
2019-08-18 20:37:29 +00:00
Kp f4264f146e Add USE=valgrind support to ebuild 2019-08-18 20:37:29 +00:00
ziplantil 6588bd6626 refactor secret level music code 2019-08-18 20:18:34 +03:00
ziplantil 79e0e2fdea dxx-r.sng: add !Rebirth.secret 2019-08-16 00:20:52 +03:00
Kp ade6ee4195 Move exit_segnum to d_player_unique_endlevel_state
exit_segnum is set during load_endlevel_data, which currently runs too
early for this to depend on the exit used, and thus to be player-unique.
That data should be loaded at need, when the level ends, rather than
during level setup.  This can be addressed later, when support for
multiple exits is improved.
2019-08-15 01:34:22 +00:00
Kp 2daf788b34 Move transition_segnum to d_player_unique_endlevel_state
transition_segnum is a function of how the player exited the mine, since
there could be multiple exit tunnels, although current code appears not
to handle that well in other places.  Therefore, it needs to be
per-player data, not part of the level data, where it would not depend
on the player exiting.
2019-08-15 01:34:22 +00:00
Kp 6fe1c90aef Make D2 emulate D1 homers in D1 missions 2019-08-15 01:34:22 +00:00
Kp 4f8df36129 Compact HandleDeathInput 2019-08-15 01:34:22 +00:00
Kp 9bafdc9078 Move Death_sequence_aborted to d_game_view_unique_state 2019-08-15 01:34:22 +00:00
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