2006-03-20 17:12:09 +00:00
|
|
|
/*
|
2014-06-01 17:55:23 +00:00
|
|
|
* Portions of this file are copyright Rebirth contributors and licensed as
|
|
|
|
* described in COPYING.txt.
|
|
|
|
* Portions of this file are copyright Parallax Software and licensed
|
|
|
|
* according to the Parallax license below.
|
|
|
|
* See COPYING.txt for license details.
|
|
|
|
|
2006-03-20 17:12:09 +00:00
|
|
|
THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX
|
|
|
|
SOFTWARE CORPORATION ("PARALLAX"). PARALLAX, IN DISTRIBUTING THE CODE TO
|
|
|
|
END-USERS, AND SUBJECT TO ALL OF THE TERMS AND CONDITIONS HEREIN, GRANTS A
|
|
|
|
ROYALTY-FREE, PERPETUAL LICENSE TO SUCH END-USERS FOR USE BY SUCH END-USERS
|
|
|
|
IN USING, DISPLAYING, AND CREATING DERIVATIVE WORKS THEREOF, SO LONG AS
|
|
|
|
SUCH USE, DISPLAY OR CREATION IS FOR NON-COMMERCIAL, ROYALTY OR REVENUE
|
|
|
|
FREE PURPOSES. IN NO EVENT SHALL THE END-USER USE THE COMPUTER CODE
|
|
|
|
CONTAINED HEREIN FOR REVENUE-BEARING PURPOSES. THE END-USER UNDERSTANDS
|
|
|
|
AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE.
|
|
|
|
COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*
|
|
|
|
*
|
|
|
|
* Prototypes for state saving functions.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2014-12-30 02:09:23 +00:00
|
|
|
#pragma once
|
2006-03-20 17:12:09 +00:00
|
|
|
|
2013-03-03 01:03:33 +00:00
|
|
|
#if defined(DXX_BUILD_DESCENT_I)
|
|
|
|
#elif defined(DXX_BUILD_DESCENT_II)
|
2013-10-06 21:04:29 +00:00
|
|
|
#define SECRETB_FILENAME PLAYER_DIRECTORY_STRING("secret.sgb")
|
|
|
|
#define SECRETC_FILENAME PLAYER_DIRECTORY_STRING("secret.sgc")
|
2013-03-03 01:03:33 +00:00
|
|
|
#endif
|
2007-05-21 11:24:27 +00:00
|
|
|
|
2012-11-11 22:12:51 +00:00
|
|
|
#ifdef __cplusplus
|
2014-12-30 02:09:23 +00:00
|
|
|
#include <cstddef>
|
2006-03-20 17:12:09 +00:00
|
|
|
|
2013-10-26 03:40:25 +00:00
|
|
|
extern unsigned state_game_id;
|
2010-07-19 17:07:12 +00:00
|
|
|
extern int state_quick_item;
|
2006-03-20 17:12:09 +00:00
|
|
|
|
2016-01-09 16:38:15 +00:00
|
|
|
#ifdef dsx
|
|
|
|
namespace dsx {
|
|
|
|
|
2015-04-19 04:18:49 +00:00
|
|
|
enum class secret_save
|
|
|
|
{
|
|
|
|
none,
|
|
|
|
#if defined(DXX_BUILD_DESCENT_II)
|
|
|
|
b,
|
|
|
|
c,
|
|
|
|
#endif
|
|
|
|
};
|
|
|
|
|
|
|
|
enum class secret_restore
|
|
|
|
{
|
|
|
|
none,
|
|
|
|
#if defined(DXX_BUILD_DESCENT_II)
|
|
|
|
survived,
|
|
|
|
died,
|
|
|
|
#endif
|
|
|
|
};
|
|
|
|
|
2016-01-09 16:38:15 +00:00
|
|
|
}
|
2016-01-26 03:45:06 +00:00
|
|
|
#endif
|
2016-01-09 16:38:15 +00:00
|
|
|
|
|
|
|
namespace dcx {
|
|
|
|
|
2015-04-19 04:18:49 +00:00
|
|
|
enum class blind_save
|
|
|
|
{
|
|
|
|
no,
|
|
|
|
yes,
|
|
|
|
};
|
|
|
|
|
2016-01-09 16:38:15 +00:00
|
|
|
}
|
|
|
|
|
2015-12-13 18:00:49 +00:00
|
|
|
namespace dsx {
|
2013-06-08 22:24:17 +00:00
|
|
|
int state_save_all_sub(const char *filename, const char *desc);
|
2011-02-09 11:58:32 +00:00
|
|
|
|
2015-04-19 04:18:49 +00:00
|
|
|
int state_get_save_file(char *fname, char * dsc, blind_save);
|
|
|
|
int state_get_restore_file(char *fname, blind_save);
|
2016-01-26 03:45:06 +00:00
|
|
|
}
|
2013-06-08 22:24:17 +00:00
|
|
|
int state_get_game_id(const char *filename);
|
2015-04-19 04:18:49 +00:00
|
|
|
|
2016-01-09 16:38:15 +00:00
|
|
|
#ifdef dsx
|
2015-12-13 18:00:49 +00:00
|
|
|
namespace dsx {
|
2012-11-11 00:14:30 +00:00
|
|
|
#if defined(DXX_BUILD_DESCENT_I)
|
2015-04-02 02:36:53 +00:00
|
|
|
int state_restore_all_sub(const char *filename);
|
2015-04-19 04:18:49 +00:00
|
|
|
static inline int state_restore_all_sub(const char *filename, secret_restore)
|
2015-04-02 02:36:53 +00:00
|
|
|
{
|
|
|
|
return state_restore_all_sub(filename);
|
|
|
|
}
|
2012-11-11 00:14:30 +00:00
|
|
|
static inline void set_pos_from_return_segment(void)
|
|
|
|
{
|
|
|
|
}
|
2015-04-19 04:18:49 +00:00
|
|
|
int state_save_all(blind_save b);
|
|
|
|
static inline int state_save_all(secret_save, blind_save b)
|
2015-04-02 02:36:53 +00:00
|
|
|
{
|
2015-04-19 04:18:49 +00:00
|
|
|
return state_save_all(b);
|
2015-04-02 02:36:53 +00:00
|
|
|
}
|
2015-04-19 04:18:49 +00:00
|
|
|
int state_restore_all(int in_game, std::nullptr_t, blind_save);
|
|
|
|
static inline int state_restore_all(int in_game, secret_restore, std::nullptr_t, blind_save blind)
|
2015-04-02 02:36:53 +00:00
|
|
|
{
|
|
|
|
return state_restore_all(in_game, nullptr, blind);
|
|
|
|
}
|
|
|
|
void StartNewLevelSub(int level_num, int page_in_textures);
|
|
|
|
// Actually does the work to start new level
|
2015-04-19 04:18:49 +00:00
|
|
|
static inline void StartNewLevelSub(int level_num, int page_in_textures, secret_restore)
|
2015-04-02 02:36:53 +00:00
|
|
|
{
|
|
|
|
StartNewLevelSub(level_num, page_in_textures);
|
|
|
|
}
|
|
|
|
void init_player_stats_level();
|
2015-04-19 04:18:49 +00:00
|
|
|
static inline void init_player_stats_level(secret_restore)
|
2015-04-02 02:36:53 +00:00
|
|
|
{
|
|
|
|
init_player_stats_level();
|
|
|
|
}
|
2012-11-11 00:14:30 +00:00
|
|
|
#elif defined(DXX_BUILD_DESCENT_II)
|
2015-04-19 04:18:49 +00:00
|
|
|
int state_restore_all_sub(const char *filename, secret_restore);
|
2012-11-11 00:14:30 +00:00
|
|
|
void set_pos_from_return_segment(void);
|
2015-04-19 04:18:49 +00:00
|
|
|
int state_save_all(secret_save, blind_save);
|
|
|
|
int state_restore_all(int in_game, secret_restore, const char *filename_override, blind_save);
|
|
|
|
void StartNewLevelSub(int level_num, int page_in_textures, secret_restore);
|
|
|
|
void init_player_stats_level(secret_restore);
|
2012-11-11 00:14:30 +00:00
|
|
|
#endif
|
2015-12-13 18:00:48 +00:00
|
|
|
}
|
|
|
|
#endif
|
2006-03-20 17:12:09 +00:00
|
|
|
|
2012-11-11 22:12:51 +00:00
|
|
|
#endif
|