1 /* GemRB - Infinity Engine Emulator
2 * Copyright (C) 2003 The GemRB Project
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version 2
7 * of the License, or (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
24 #include "SaveGameMgr.h"
27 #define GAM_VER_GEMRB 0
29 #define GAM_VER_IWD 11
30 #define GAM_VER_PST 12
31 #define GAM_VER_BG2 20
32 #define GAM_VER_TOB 21
33 #define GAM_VER_IWD2 22
35 class GAMImp
: public SaveGameMgr
{
41 ieDword PCOffset
, PCCount
;
43 ieDword NPCOffset
, NPCCount
;
44 ieDword GlobalOffset
, GlobalCount
;
45 ieDword JournalOffset
, JournalCount
;
46 ieDword KillVarsOffset
, KillVarsCount
;
47 ieDword FamiliarsOffset
;
48 ieDword SavedLocOffset
, SavedLocCount
;
49 ieDword PPLocOffset
, PPLocCount
;
53 bool Open(DataStream
* stream
, bool autoFree
= true);
54 Game
* LoadGame(Game
*newGame
, int ver_override
= 0);
56 int GetStoredFileSize(Game
*game
);
57 /* stores a gane in the savegame folder */
58 int PutGame(DataStream
*stream
, Game
*game
);
65 Actor
* GetActor( ActorMgr
* aM
, bool is_in_party
);
66 void GetPCStats(PCStatsStruct
* ps
);
67 GAMJournalEntry
* GetJournalEntry();
69 int PutHeader(DataStream
*stream
, Game
*game
);
70 int PutActor(DataStream
*stream
, Actor
*ac
, ieDword CRESize
, ieDword CREOffset
, ieDword version
);
71 int PutPCs(DataStream
*stream
, Game
*game
);
72 int PutNPCs(DataStream
*stream
, Game
*game
);
73 int PutJournals(DataStream
*stream
, Game
*game
);
74 int PutVariables( DataStream
*stream
, Game
*game
);
75 int PutKillVars(DataStream
*stream
, Game
*game
);
76 int PutMaze(DataStream
*stream
, Game
*game
);
77 int PutFamiliars(DataStream
*stream
, Game
*game
);
78 int PutSavedLocations(DataStream
*stream
, Game
*game
);
79 int PutPlaneLocations(DataStream
*stream
, Game
*game
);