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"
28 #define GAM_VER_GEMRB 0
30 #define GAM_VER_IWD 11
31 #define GAM_VER_PST 12
32 #define GAM_VER_BG2 20
33 #define GAM_VER_TOB 21
34 #define GAM_VER_IWD2 22
36 class GAMImporter
: public SaveGameMgr
{
42 ieDword PCOffset
, PCCount
;
44 ieDword NPCOffset
, NPCCount
;
45 ieDword GlobalOffset
, GlobalCount
;
46 ieDword JournalOffset
, JournalCount
;
47 ieDword KillVarsOffset
, KillVarsCount
;
48 ieDword FamiliarsOffset
;
49 ieDword SavedLocOffset
, SavedLocCount
;
50 ieDword PPLocOffset
, PPLocCount
;
54 bool Open(DataStream
* stream
, bool autoFree
= true);
55 Game
* LoadGame(Game
*newGame
, int ver_override
= 0);
57 int GetStoredFileSize(Game
*game
);
58 /* stores a gane in the savegame folder */
59 int PutGame(DataStream
*stream
, Game
*game
);
61 Actor
* GetActor(Holder
<ActorMgr
> aM
, bool is_in_party
);
62 void GetPCStats(PCStatsStruct
* ps
);
63 GAMJournalEntry
* GetJournalEntry();
65 int PutHeader(DataStream
*stream
, Game
*game
);
66 int PutActor(DataStream
*stream
, Actor
*ac
, ieDword CRESize
, ieDword CREOffset
, ieDword version
);
67 int PutPCs(DataStream
*stream
, Game
*game
);
68 int PutNPCs(DataStream
*stream
, Game
*game
);
69 int PutJournals(DataStream
*stream
, Game
*game
);
70 int PutVariables( DataStream
*stream
, Game
*game
);
71 int PutKillVars(DataStream
*stream
, Game
*game
);
72 int PutMaze(DataStream
*stream
, Game
*game
);
73 int PutFamiliars(DataStream
*stream
, Game
*game
);
74 int PutSavedLocations(DataStream
*stream
, Game
*game
);
75 int PutPlaneLocations(DataStream
*stream
, Game
*game
);