aboutsummaryrefslogtreecommitdiff
path: root/engines/toltecs/toltecs.h
diff options
context:
space:
mode:
Diffstat (limited to 'engines/toltecs/toltecs.h')
-rw-r--r--engines/toltecs/toltecs.h46
1 files changed, 37 insertions, 9 deletions
diff --git a/engines/toltecs/toltecs.h b/engines/toltecs/toltecs.h
index b9d08c3d59..0794a26b9d 100644
--- a/engines/toltecs/toltecs.h
+++ b/engines/toltecs/toltecs.h
@@ -43,10 +43,6 @@
namespace Toltecs {
-enum ToltecsGameFeatures {
- GF_PACKED = (1 << 0)
-};
-
struct ToltecsGameDescription;
class AnimationPlayer;
@@ -65,14 +61,17 @@ class ToltecsEngine : public ::Engine {
Common::KeyState _keyPressed;
protected:
- int init();
- int go();
+ Common::Error init();
+ Common::Error go();
// void shutdown();
public:
ToltecsEngine(OSystem *syst, const ToltecsGameDescription *gameDesc);
virtual ~ToltecsEngine();
+ virtual bool hasFeature(EngineFeature f) const;
+ virtual void syncSoundSettings();
+
Common::RandomSource *_rnd;
const ToltecsGameDescription *_gameDescription;
uint32 getFeatures() const;
@@ -99,10 +98,8 @@ public:
int16 findRectAtPoint(byte *rectData, int16 x, int16 y, int16 index, int16 itemSize);
- void savegame(const char *filename);
- void loadgame(const char *filename);
-
public:
+
AnimationPlayer *_anim;
ArchiveReader *_arc;
Input *_input;
@@ -140,6 +137,37 @@ public:
int16 _mouseDisabled;
bool _leftButtonDown, _rightButtonDown;
+ /* Save/load */
+
+ enum kReadSaveHeaderError {
+ kRSHENoError = 0,
+ kRSHEInvalidType = 1,
+ kRSHEInvalidVersion = 2,
+ kRSHEIoError = 3
+ };
+
+ struct SaveHeader {
+ Common::String description;
+ uint32 version;
+ byte gameID;
+ uint32 flags;
+ Graphics::Surface *thumbnail;
+ };
+
+ bool _isSaveAllowed;
+
+ bool canLoadGameStateCurrently() { return _isSaveAllowed; }
+ bool canSaveGameStateCurrently() { return _isSaveAllowed; }
+ Common::Error loadGameState(int slot);
+ Common::Error saveGameState(int slot, const char *description);
+ void savegame(const char *filename, const char *description);
+ void loadgame(const char *filename);
+
+ const char *getSavegameFilename(int num);
+ static Common::String getSavegameFilename(const Common::String &target, int num);
+
+ static kReadSaveHeaderError readSaveHeader(Common::SeekableReadStream *in, bool loadThumbnail, SaveHeader &header);
+
};
} // End of namespace Toltecs