mirror of
https://github.com/TombEngine/TombEngine.git
synced 2025-05-02 17:57:59 +03:00
59 lines
No EOL
979 B
C++
59 lines
No EOL
979 B
C++
#pragma once
|
|
#include "ChunkId.h"
|
|
#include "ChunkReader.h"
|
|
#include "ChunkWriter.h"
|
|
#include "LEB128.h"
|
|
#include "Streams.h"
|
|
#include "GameFlowScript.h"
|
|
#include "GameLogicScript.h"
|
|
|
|
constexpr auto SAVEGAME_MAX = 16;
|
|
|
|
struct Stats
|
|
{
|
|
unsigned int Timer;
|
|
unsigned int Distance;
|
|
unsigned int AmmoUsed;
|
|
unsigned int AmmoHits;
|
|
unsigned short Kills;
|
|
unsigned char Secrets;
|
|
unsigned char HealthUsed;
|
|
};
|
|
|
|
struct GameStats
|
|
{
|
|
Stats Game;
|
|
Stats Level;
|
|
};
|
|
|
|
struct SaveGameHeader
|
|
{
|
|
std::string LevelName;
|
|
int Days;
|
|
int Hours;
|
|
int Minutes;
|
|
int Seconds;
|
|
int Level;
|
|
int Timer;
|
|
int Count;
|
|
bool Present;
|
|
};
|
|
|
|
extern GameStats Statistics;
|
|
extern SaveGameHeader SavegameInfos[SAVEGAME_MAX];
|
|
|
|
class SaveGame
|
|
{
|
|
private:
|
|
static FileStream* m_stream;
|
|
static std::vector<LuaVariable> m_luaVariables;
|
|
|
|
public:
|
|
static int LastSaveGame;
|
|
|
|
static bool Load(int slot);
|
|
static bool LoadHeader(int slot, SaveGameHeader* header);
|
|
static bool Save(int slot);
|
|
};
|
|
|
|
void LoadSavegameInfos(); |