ScummVM API documentation
mtropolis.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#ifndef MTROPOLIS_MTROPOLIS_H
23#define MTROPOLIS_MTROPOLIS_H
24
25#include "engines/engine.h"
26
27#include "common/random.h"
28
29#include "mtropolis/detection.h"
30#include "mtropolis/saveload.h"
31
45namespace MTropolis {
46
47class Runtime;
48class RuntimeObject;
49
51protected:
52 // Engine APIs
53 Common::Error run() override;
54
55public:
56 MTropolisEngine(OSystem *syst, const MTropolisGameDescription *gameDesc);
57 ~MTropolisEngine() override;
58
59 bool hasFeature(EngineFeature f) const override;
60 //void syncSoundSettings() override;
61
62 const MTropolisGameDescription *_gameDescription;
63 uint32 getGameID() const;
64 Common::Platform getPlatform() const;
65
66 bool promptSave(ISaveWriter *writer, const Graphics::Surface *screenshotOverride) override;
67 bool namedSave(ISaveWriter *writer, const Graphics::Surface *screenshotOverride, const Common::String &fileName) override;
68 bool autoSave(ISaveWriter *writer) override;
69 bool promptLoad(ISaveReader *reader) override;
70 bool namedLoad(ISaveReader *reader, const Common::String &fileName) override;
71
72 const Graphics::Surface *getSavegameScreenshot() const;
73
74 Common::Error saveGameStream(Common::WriteStream *stream, bool isAutosave) override;
75 bool canSaveAutosaveCurrently() override;
76 bool canSaveGameStateCurrently(Common::U32String *msg = nullptr) override;
77
78public:
79 void handleEvents();
80
81protected:
82 void pauseEngineIntern(bool pause) override;
83
84private:
85 bool save(ISaveWriter *writer, const Graphics::Surface *screenshotOverride, const Common::String &fileName, const Common::String &desc);
86 bool load(ISaveReader *reader, const Common::String &fileName);
87
88 Common::String getUnpromptedSaveFileName(const Common::String &fileName);
89
90 static const uint kCurrentSaveFileVersion = 2;
91 static const uint kEarliestSupportedSaveFileVersion = 2;
92 static const uint kSavegameSignature = 0x6d545356; // mTSV
93
94 ISaveWriter *_saveWriter;
95 bool _isTriggeredAutosave;
96
98};
99
100} // End of namespace MTropolis
101
102#endif /* MTROPOLIS_MTROPOLIS_H */
Definition: error.h:81
Definition: ptr.h:572
Definition: str.h:59
Definition: ustr.h:57
Definition: stream.h:77
Definition: engine.h:149
EngineFeature
Definition: engine.h:282
Definition: mtropolis.h:50
bool canSaveGameStateCurrently(Common::U32String *msg=nullptr) override
bool hasFeature(EngineFeature f) const override
Common::Error saveGameStream(Common::WriteStream *stream, bool isAutosave) override
bool canSaveAutosaveCurrently() override
Common::Error run() override
void pauseEngineIntern(bool pause) override
Definition: system.h:166
Platform
Definition: platform.h:93
Definition: actions.h:25
Definition: surface.h:67
Definition: saveload.h:64
Definition: saveload.h:59
Definition: saveload.h:50
Definition: saveload.h:54
Definition: saveload.h:46
Definition: detection.h:210