Define separate enum values for rotation data in both the high bits,
where it is usually kept, and the low bits, where it is sometimes used
for math or comparisons.
Define an enum value to represent the composite of the index and the
rotation, since the composite is not suitable for use as an array
subscript. Add helper functions to extract the component pieces.
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.
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.
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>
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.
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>
It's possible to enter empty savegame descriptions,
which is no problem itself, but it looks quite
confusing in the save/load menus: you can't see
the currently selected item, for instance.
This commit replaces an empty description with a
placeholder text ("no title") upon saving.
This is particularly useful when controlling
the game only with a joystick, where entering
a proper description isn't possible.
Returning from a secret level clears the player's `hostages_on_board` to
0 as part of initializing a "new" ship, but this is not desirable
behavior. Copy the counter out before and back afterward.
```
Thread 1 "d2x-rebirth-edi" hit Hardware watchpoint 1: -location d2x::LevelUniqueObjectState.Objects._M_elems[0].ctype.player_info.mission.hostages_on_board
Old value = 5 '\005'
New value = 0 '\000'
#0 d2x::init_player_stats_ship (GameTime64=<optimized out>, plrobj=...) at similar/main/gameseq.cpp:613
#1 d2x::init_player_stats_level (secret_flag=d2x::secret_restore::survived, plrobj=..., plr=...) at similar/main/gameseq.cpp:615
#2 d2x::StartNewLevelSub (level_num=level_num@entry=3, page_in_textures=page_in_textures@entry=1, secret_flag=secret_flag@entry=d2x::secret_restore::survived) at similar/main/gameseq.cpp:1901
#3 d2x::state_restore_all_sub (LevelSharedDestructibleLightState=..., secret=d2x::secret_restore::survived, filename=<optimized out>) at similar/main/state.cpp:1670
#4 d2x::state_restore_all (in_game=in_game@entry=1, secret=secret@entry=d2x::secret_restore::survived, filename_override=<optimized out>, blind=blind@entry=dcx::blind_save::no) at similar/main/state.cpp:1490
#5 d2x::ExitSecretLevel ()
```
Reported-by: teratorn <https://github.com/dxx-rebirth/dxx-rebirth/issues/495>
The historical savegame format cannot support finding a mission in a
subdirectory. Add a backwards-incompatible modification to store the
full path in the savegame, and store it in a way that old versions will
fail gracefully.[1] When loading demos, or legacy savegames, search for
the mission in all available directories. Demos are still written with
an unqualified path because the demo loading code would crash if given
an oversized path. Mission names sent over the network as part of
multiplayer use the guess logic now, so that guests do not need to have
the mission in the same path as the host.
[1] Versions affected by issue #486 may fail ungracefully.
Reported-by: AlumiuN <https://github.com/dxx-rebirth/dxx-rebirth/issues/491>
Only the console player's last position needs to be remembered across
frames. Copy the console player's position out before processsing
object movement. For all other objects, retain a temporary for use by
the position recovery code.
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[]")
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.