From dfe3d8b4ceab85f3831ad4fe7fb0fa587c1e67fa Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Wed, 8 Jan 2014 23:31:34 -0500 Subject: VOYEUR: Preliminary savegame functionality --- engines/voyeur/voyeur.h | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'engines/voyeur/voyeur.h') diff --git a/engines/voyeur/voyeur.h b/engines/voyeur/voyeur.h index 4ee5f84b02..1622524108 100644 --- a/engines/voyeur/voyeur.h +++ b/engines/voyeur/voyeur.h @@ -33,6 +33,8 @@ #include "common/system.h" #include "common/error.h" #include "common/random.h" +#include "common/savefile.h" +#include "common/serializer.h" #include "common/util.h" #include "engines/engine.h" #include "graphics/surface.h" @@ -134,6 +136,11 @@ private: void playAVideoEvent(int eventIndex); int getChooseButton(); + + /** + * Synchronizes the game data + */ + void synchronize(Common::Serializer &s); protected: // Engine APIs virtual Common::Error run(); @@ -169,7 +176,9 @@ public: int _timeBarVal; int _checkPhoneVal; Common::Point _mansionViewPos; + ThreadResource *_mainThread; VoyeurArea _voyeurArea; + int _loadGameSlot; public: VoyeurEngine(OSystem *syst, const VoyeurGameDescription *gameDesc); virtual ~VoyeurEngine(); @@ -187,6 +196,7 @@ public: virtual bool canSaveGameStateCurrently(); virtual Common::Error loadGameState(int slot); virtual Common::Error saveGameState(int slot, const Common::String &desc); + void loadGame(int slot); void playRL2Video(const Common::String &filename); void doTransitionCard(const Common::String &time, const Common::String &location); @@ -243,6 +253,20 @@ public: Common::String getTimeOfDay(); }; +#define VOYEUR_SAVEGAME_VERSION 1 + +struct VoyeurSavegameHeader { + uint8 _version; + Common::String _saveName; + Graphics::Surface *_thumbnail; + int _saveYear, _saveMonth, _saveDay; + int _saveHour, _saveMinutes; + int _totalFrames; + + bool read(Common::InSaveFile *f); + void write(Common::OutSaveFile *f, VoyeurEngine *vm, const Common::String &saveName); +}; + } // End of namespace Voyeur #endif /* VOYEUR_VOYEUR_H */ -- cgit v1.2.3