Commit graph

10896 commits

Author SHA1 Message Date
Kp 636978db4b Move Marker_model_num to d_level_shared_polygon_model_state 2020-08-24 01:31:28 +00:00
Kp cb33b04521 Pass output grs_bitmap to read_extra_bitmap_iff 2020-08-24 01:31:28 +00:00
Kp 9c3fc7523c Make extra_bitmap_num static
Modify read_extra_bitmap_d1_pig to take the bitmap-to-write as a
parameter, instead of computing it from extra_bitmap_num.
2020-08-24 01:31:28 +00:00
Kp edb9b46b55 Move piggy_is_needed to dcx 2020-08-24 01:31:28 +00:00
Kp faf37e3c14 Always allocate D2-sized sound array
This makes other code simpler, and the extra elements will simply be
ignored in D1.
2020-08-24 01:31:28 +00:00
Kp 514c63efad Expose both MAX_SOUNDS in both games 2020-08-24 01:31:28 +00:00
Kp dd035a8f2f Move some piggy code into namespace dsx 2020-08-24 01:31:28 +00:00
Kp 7e23ab554a Simplify custom_remove for loop
Iterate over a zipped range instead of explicitly maintaining an
index value and two pointers.
2020-08-24 01:31:28 +00:00
Kp 237106f31e Add warning that BitmapOriginal cannot be used directly 2020-08-24 01:31:28 +00:00
Kp b29f19da51 Use enum class for GameBitmapOffset
Values in GameBitmapOffset are only intended for use indexing within the
game's PIG file.  Give them a specific type to reflect that.
2020-08-24 01:31:28 +00:00
Kp 32268b1f48 Simplify bitmap flag setup
Remove the conditional jumps.  Bit masking is simpler.
2020-08-24 01:31:28 +00:00
Kp 8a1bc7f318 Move Exit_models_loaded into d_level_shared_polygon_model_state 2020-08-24 01:31:28 +00:00
Kp 0eaabdb2fb Move N_polygon_models into d_level_shared_polygon_model_state 2020-08-24 01:31:28 +00:00
Kp de4efc4f46 Qualify more uses of shared_segment members 2020-08-24 01:31:28 +00:00
Kp 2b8522f8ad Convert uses of vcsegptr_t to shared_segment& where possible 2020-08-24 01:31:28 +00:00
Kp 2e398c02c7 Convert uses of vmsegptr_t to shared_segment& where possible 2020-08-24 01:31:28 +00:00
Kp ce7c9946e8 Inherit base_bytebuffer_t constructor instead of delegating to it
This may encourage the compiler to generate better code, and should
never generate worse code.
2020-08-24 01:31:28 +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 0b141ea122 Show CHOST in show_partial_environ
This can influence other values, so it is useful to see it directly.
2020-08-16 00:43:12 +00:00
Kp e0b10880de Fix build break in non-debug build diagnostic
Only non-debug builds print a warning for slew objects.

Fixes: 1c42f69ff2 ("Use enum class for object_signature_t")
Reported-by: Kreeblah <https://github.com/dxx-rebirth/dxx-rebirth/issues/533>
2020-08-11 04:09:00 +00:00
Kp a8b6a8393b Fix PCH build
Add a comment in the #include directive to hide it from the PCH scanner,
since this file should not be included in the PCH.  It is only used in
one file, and it is included under special circumstances.  In
particular, it is included while inside a namespace.
2020-08-10 03:45:14 +00:00
Kp 038c6aef4d Move d_level_unique_object_state to a separate header
This is required to untangle the cross-inclusion of object.h and
morph.h.
2020-08-10 03:45:14 +00:00
Kp 8cf9ab8222 Access unique_segment::static_light directly
segment inherits unique_segment, so unique_segment members can be
referenced from an instance of segment.  Eventually, segment will be
removed.  Adjust references to go through unique_segment to support this
change.
2020-08-10 03:45:13 +00:00
Kp 7f3aa94d8c Access unique_segment::slide_textures directly
segment inherits unique_segment, so unique_segment members can be
referenced from an instance of segment.  Eventually, segment will be
removed.  Adjust references to go through unique_segment to support this
change.
2020-08-10 03:45:13 +00:00
Kp 336d84f451 Access unique_segment::light_subtracted directly
segment inherits unique_segment, so unique_segment members can be
referenced from an instance of segment.  Eventually, segment will be
removed.  Adjust references to go through unique_segment to support this
change.
2020-08-10 03:45:13 +00:00
Kp 37bd70369d Access unique_segment::objects directly
segment inherits unique_segment, so unique_segment members can be
referenced from an instance of segment.  Eventually, segment will be
removed.  Adjust references to go through unique_segment to support this
change.
2020-08-10 03:45:13 +00:00
Kp 7ad8d8c28b Rename object::movement_type to movement_source
gcc and clang disagree about how to disambiguate when an identifier is
both a typename and a member.  Avoid the disagreement by renaming the
member.
2020-08-10 03:45:13 +00:00
Kp 5245b1c4a3 Rename object::control_type to control_source
gcc and clang disagree about how to disambiguate when an identifier is
both a typename and a member.  Avoid the disagreement by renaming the
member.

Reported-by: Kreeblah <https://github.com/dxx-rebirth/dxx-rebirth/issues/532>
2020-08-10 03:45:13 +00:00
Kp 102cb5572f Exchange order of gauge_hud_type, gauge_inset_window_view
This generates better code by raising the computation of one array
level outside certain conditionals.
2020-08-10 03:45:13 +00:00
Kp 637efae03a Use enum class for gauges window indexing 2020-08-10 03:45:13 +00:00
Kp 1c42f69ff2 Use enum class for object_signature_t 2020-08-10 03:45:13 +00:00
Kp 38cddb0289 Use enum class for object movement_type 2020-08-10 03:45:13 +00:00
Kp 9e2543ecbf Use enum class for object control_type 2020-08-06 03:47:56 +00:00
Kp 4ef247e494 Use enum class for collision_result values 2020-08-06 03:47:56 +00:00
Kp 9b90a790f9 Add forward-declaration header for enumerated_array 2020-08-06 03:47:56 +00:00
Kp 021c86d4dd Remove unnecessary variable in InitMarkerInput
This was a leftover from an earlier prototype.  gcc-7 warns about it,
but gcc-8 and later silently allow it.  Remove it to fix the gcc-7
build, since it is not needed.

Reported-by: Kieltux <https://github.com/dxx-rebirth/dxx-rebirth/issues/531>
Fixes: ec6a78c481 ("Use enum class for marker index types")
2020-08-06 03:47:56 +00:00
Kp 111b655b09 Remove GM_GAME_OVER
Various sites assign GM_GAME_OVER to Game_mode, but no sites test for
it.  Its only value would be to clear out other flags, but that can be
done by clearing Game_mode.
2020-08-06 03:47:56 +00:00
Arne de Bruijn 294d54eb58 Workaround for missing forever flag in sound object demo recording
In the original code there was a 'Hack to keep sounds from building up...'
which changed a non-forever linked sound to a non-linked sound. Therefore
the forever flag wasn't needed in the demo files. The commit
4a98e796ab removed the hack, which caused
non-forever sounds to start looping on demo playback.
This commit restores the hack as far as demo files are concerned.

Reported-by: zicodxx <https://github.com/dxx-rebirth/dxx-rebirth/issues/477>
Fixes: 4a98e796ab ("Prevent stacking weapon rotation sounds")
2020-08-05 15:32:44 +02:00
Kreeblah 81a93441c0
Fixed macOS compilation 2020-08-02 16:03:19 -07:00
Kp 8d3f47d646 Fix hoard orb handling on player death
Descent tracked hoard orbs by borrowing the player's proximity bomb
slot.  Commit 829e95b6f8 moved proximity
bomb tracking to its own slot, but failed to update the player
death/deres logic accordingly.  This caused multiple inconsistencies
when a player was killed in hoard mode:

- The killed player saw the orb drop as expected.
- The killed player _also_ kept the orb in inventory after respawn,
  because the counter was not reset.
- Other players saw no orb drop.

Fix the inappropriate retention by resetting the orb count in
init_player_stats_new_ship.  Fix the inappropriate failure to drop by
adding a new unconditional field to the player death/deres message.  In
hoard games, use it to pass the orb count.  In other games, ignore it.

Fixes: 829e95b6f8 ("Separate hoard/proximity tracking")
Reported-by: snytek <https://github.com/dxx-rebirth/dxx-rebirth/issues/526>
2020-08-01 18:29:01 +00:00
Kp 0789298192 Hide HUD key graphics in competitive games
The keys are always enabled, so there is no need to show them here.
Non-fullscreen users already dedicate space to the key graphic, so
nothing can be saved by adding a special case for those viewing modes.
2020-08-01 18:29:01 +00:00
Kp fab8afe96c Simplify always-true title_screen::allow_keys
The value is always true, so delete tests for it and remove the
variable.
2020-08-01 18:29:01 +00:00
Kp 8ebfee3c41 Remove unused show_title_screen parameters
- allow_keys is always 1
- from_hog_only was ignored in the callee because PhysFS does not
  support it.
2020-08-01 18:29:01 +00:00
Kp 519c14a407 Use timestamped savegame description if none is given
Instead of a generic "-no title-", insert the time of the save.  This
conveys some information to users, who may find it helpful for
distinguishing individual saves.
2020-07-22 03:11:18 +00:00
Kp 1d24a2f942 Fix off-by-one in save slot memory
Save menus have a non-selectable first element used to allocate extra
space for the save game's embedded screenshot.  The memorized save game
slot failed to account for this, causing the game to suggest a slot one
less than the last used slot.  Attentive users could override the
suggestion, but the game should suggest the correct slot automatically.

Reported-by: ziplantil <https://github.com/dxx-rebirth/dxx-rebirth/issues/524>
2020-07-22 03:11:18 +00:00
Kp d7bc4fb0df Fix global array overflow in kbuild.cpp error message 2020-07-22 03:11:18 +00:00
Kp ec6a78c481 Use enum class for marker index types 2020-07-22 03:11:18 +00:00
Kp 0c9adb9d4a Use enum for net_udp_can_join_netgame result
This enum preserves the original numeric codes and logic.
2020-07-22 03:11:18 +00:00
Kp bb6bf76b0f Centralize computing height of some fullscreen gauges
Gauges aligned to the left side of the screen try to move up in
multiplayer, and move farther in large multiplayer games.  However, the
logic for this was inconsistent, and could draw shields and afterburner
state on the same line.  Fix this by computing the starting point once,
and passing it down to the functions that need it.

Reported-by: snytek <https://github.com/dxx-rebirth/dxx-rebirth/issues/521>
2020-07-16 02:31:04 +00:00
Kp d738f6c21e Change enum side_type to enum class side_type 2020-07-16 02:31:04 +00:00