Files
source/SaveLoadGame.h
T
Wanne 91087ca8c0 ************************************************************
* Merged Source Code from Development Trunk: Revision 4063 *
************************************************************
- Source Code is merged from: https://81.169.133.124/source/ja2/branches/Wanne/JA2%201.13%20MP
- This will be the Source for the Beta 2011 Test

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@4064 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2011-01-18 09:11:09 +00:00

99 lines
2.5 KiB
C++

#ifndef _SAVE_LOAD_GAME_H_
#define _SAVE_LOAD_GAME_H_
#include "GameSettings.h"
//forward declarations of common classes to eliminate includes
class OBJECTTYPE;
class SOLDIERTYPE;
#define BYTESINMEGABYTE 1048576 //1024*1024
#define REQUIRED_FREE_SPACE (20 * BYTESINMEGABYTE)
#define SIZE_OF_SAVE_GAME_DESC 128
#define GAME_VERSION_LENGTH 16
#define SAVE__ERROR_NUM 99
#define SAVE__END_TURN_NUM 98
// WDS - Automatically try to save when an assertion failure occurs
#define SAVE__ASSERTION_FAILURE 97
#define SAVE__TIMED_AUTOSAVE 19 // WANNE: This slot does not show up in the load/save screen because it is > 18
#define EARLIST_SPECIAL_SAVE 97
typedef struct
{
UINT32 uiSavedGameVersion;
CHAR8 zGameVersionNumber[ GAME_VERSION_LENGTH ];
CHAR16 sSavedGameDesc[ SIZE_OF_SAVE_GAME_DESC ];
UINT32 uiFlags;
#ifdef CRIPPLED_VERSION
UINT8 ubCrippleFiller[20];
#endif
//The following will be used to quickly access info to display in the save/load screen
UINT32 uiDay;
UINT8 ubHour;
UINT8 ubMin;
INT16 sSectorX;
INT16 sSectorY;
INT8 bSectorZ;
UINT8 ubNumOfMercsOnPlayersTeam;
INT32 iCurrentBalance;
UINT32 uiCurrentScreen;
BOOLEAN fAlternateSector;
BOOLEAN fWorldLoaded;
UINT8 ubLoadScreenID; //The load screen that should be used when loading the saved game
GAME_OPTIONS sInitialGameOptions; //need these in the header so we can get the info from it on the save load screen.
UINT32 uiRandom;
UINT8 ubInventorySystem;
UINT8 ubAttachmentSystem;
UINT8 ubFiller[108]; // WANNE: Changed from 109 to 108 because of ubNewAttachmentSystem integration
} SAVED_GAME_HEADER;
extern UINT32 guiScreenToGotoAfterLoadingSavedGame;
extern UINT32 guiCurrentSaveGameVersion;
void CreateSavedGameFileNameFromNumber( UINT8 ubSaveGameID, STR pzNewFileName );
BOOLEAN InitSaveDir();
BOOLEAN SaveGame( int ubSaveGameID, STR16 pGameDesc );
BOOLEAN LoadSavedGame( int ubSavedGameID );
BOOLEAN CopySavedSoldierInfoToNewSoldier( SOLDIERTYPE *pDestSourceInfo, SOLDIERTYPE *pSourceInfo );
BOOLEAN SaveFilesToSavedGame( STR pSrcFileName, HWFILE hFile );
BOOLEAN LoadFilesFromSavedGame( STR pSrcFileName, HWFILE hFile );
BOOLEAN DoesUserHaveEnoughHardDriveSpace();
void GetBestPossibleSectorXYZValues( INT16 *psSectorX, INT16 *psSectorY, INT8 *pbSectorZ );
extern UINT32 guiLastSaveGameNum;
INT8 GetNumberForAutoSave( BOOLEAN fLatestAutoSave );
#endif