mirror of
https://github.com/LostArtefacts/TRX.git
synced 2025-04-28 12:47:58 +03:00
tr2/savegame: hide legacy functions
This updates callers to use the Savgame_Save and Savegame_Load functions in order to hide the current legacy approach. TR1 also had duplicated function declarations, so these are removed.
This commit is contained in:
parent
8d2c897e9f
commit
d4523dde14
4 changed files with 8 additions and 6 deletions
|
@ -59,8 +59,6 @@ void Savegame_InitCurrentInfo(void);
|
|||
|
||||
int32_t Savegame_GetLevelNumber(int32_t slot_num);
|
||||
|
||||
bool Savegame_Load(int32_t slot_num);
|
||||
bool Savegame_Save(int32_t slot_num);
|
||||
bool Savegame_UpdateDeathCounters(int32_t slot_num, GAME_INFO *game_info);
|
||||
bool Savegame_LoadOnlyResumeInfo(int32_t slot_num, GAME_INFO *game_info);
|
||||
|
||||
|
|
|
@ -192,7 +192,7 @@ static GF_COMMAND M_Finish(INV_RING *const ring, const bool apply_changes)
|
|||
// first passport page: load game.
|
||||
if (apply_changes) {
|
||||
Inv_RemoveAllItems();
|
||||
if (!S_LoadGame(g_Inv_ExtraData[1])) {
|
||||
if (!Savegame_Load(g_Inv_ExtraData[1])) {
|
||||
return (GF_COMMAND) {
|
||||
.action = GF_EXIT_TO_TITLE,
|
||||
};
|
||||
|
@ -243,8 +243,7 @@ static GF_COMMAND M_Finish(INV_RING *const ring, const bool apply_changes)
|
|||
} else {
|
||||
if (apply_changes) {
|
||||
Music_Unpause();
|
||||
CreateSaveGameInfo();
|
||||
S_SaveGame(g_Inv_ExtraData[1]);
|
||||
Savegame_Save(g_Inv_ExtraData[1]);
|
||||
}
|
||||
return (GF_COMMAND) { .action = GF_NOOP };
|
||||
}
|
||||
|
|
|
@ -53,6 +53,11 @@ bool Savegame_Save(const int32_t slot_idx)
|
|||
return true;
|
||||
}
|
||||
|
||||
bool Savegame_Load(const int32_t slot_idx)
|
||||
{
|
||||
return S_LoadGame(slot_idx);
|
||||
}
|
||||
|
||||
RESUME_INFO *Savegame_GetCurrentInfo(const GF_LEVEL *const level)
|
||||
{
|
||||
ASSERT(g_SaveGame.resume != nullptr);
|
||||
|
|
|
@ -476,7 +476,7 @@ void Shell_Main(void)
|
|||
}
|
||||
|
||||
case GF_START_SAVED_GAME: {
|
||||
if (!S_LoadGame(gf_cmd.param)) {
|
||||
if (!Savegame_Load(gf_cmd.param)) {
|
||||
gf_cmd = (GF_COMMAND) { .action = GF_EXIT_TO_TITLE };
|
||||
} else {
|
||||
const GF_LEVEL *const level =
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue