ScummVM API documentation
saveload.h
1 /* ScummVM - Graphic Adventure Engine
2  *
3  * ScummVM is the legal property of its developers, whose names
4  * are too numerous to list here. Please refer to the COPYRIGHT
5  * file distributed with this source distribution.
6  *
7  * This program is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation, either version 3 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program. If not, see <http://www.gnu.org/licenses/>.
19  *
20  */
21 
22 /*
23  * This code is based on original Mortville Manor DOS source code
24  * Copyright (c) 1987-1989 Lankhor
25  */
26 
27 #ifndef MORTEVIELLE_SAVELOAD_H
28 #define MORTEVIELLE_SAVELOAD_H
29 
30 #include "common/savefile.h"
31 #include "common/serializer.h"
32 #include "graphics/scaler.h"
33 #include "graphics/thumbnail.h"
34 #include "engines/savestate.h"
35 
36 #define SAVEGAME_VERSION 1
37 
38 namespace Mortevielle {
39 
41  uint8 version;
42  Common::String saveName;
43  Graphics::Surface *thumbnail;
44  int saveYear, saveMonth, saveDay;
45  int saveHour, saveMinutes;
46  int totalFrames;
47 };
48 
49 class MortevielleEngine;
50 
52 private:
53  MortevielleEngine *_vm;
54  byte _tabdonSaveBuffer[391];
55 
56  void sync_save(Common::Serializer &sz);
57 public:
59 
60  bool loadSavegame(const Common::String &filename);
61  Common::Error loadGame(const Common::String &filename);
62  Common::Error saveGame(int n, const Common::String &saveName);
63  Common::Error loadGame(int slot);
64  Common::Error saveGame(int slot);
65 
66  void writeSavegameHeader(Common::OutSaveFile *out, const Common::String &saveName);
67  WARN_UNUSED_RESULT static bool readSavegameHeader(Common::InSaveFile *in, SavegameHeader &header, bool skipThumbnail = true);
68  static SaveStateList listSaves(const MetaEngine *metaEngine, const Common::String &target);
69  static SaveStateDescriptor querySaveMetaInfos(const MetaEngine *metaEngine, const Common::String &fileName);
70 };
71 
72 } // End of namespace Mortevielle
73 #endif
Definition: metaengine.h:200
Definition: str.h:59
Definition: debugger.h:28
Definition: surface.h:66
Definition: savefile.h:54
Definition: error.h:84
Definition: stream.h:745
Definition: serializer.h:79
Definition: savestate.h:56
Definition: saveload.h:51
bool skipThumbnail(Common::SeekableReadStream &in)
Definition: saveload.h:40
Definition: mortevielle.h:156