From 45f55128b1c811bd2824e0acfbd5801fc78a2256 Mon Sep 17 00:00:00 2001 From: Arnaud Boutonné Date: Mon, 29 Nov 2010 17:42:08 +0000 Subject: HUGO: Add GMM save/load and RTL svn-id: r54576 --- engines/hugo/hugo.h | 44 ++++++++++++++++++++++++++++++++------------ 1 file changed, 32 insertions(+), 12 deletions(-) (limited to 'engines/hugo/hugo.h') diff --git a/engines/hugo/hugo.h b/engines/hugo/hugo.h index d7dd767b6b..903dd5a7bc 100644 --- a/engines/hugo/hugo.h +++ b/engines/hugo/hugo.h @@ -32,6 +32,7 @@ // This include is here temporarily while the engine is being refactored. #include "hugo/game.h" +#include "hugo/file.h" #define HUGO_DAT_VER_MAJ 0 // 1 byte #define HUGO_DAT_VER_MIN 30 // 1 byte @@ -59,6 +60,8 @@ class RandomSource; */ namespace Hugo { +static const int kSavegameVersion = 2; + enum GameType { kGameTypeNone = 0, kGameTypeHugo1, @@ -114,6 +117,8 @@ public: HugoEngine(OSystem *syst, const HugoGameDescription *gd); ~HugoEngine(); + OSystem *_system; + byte _numVariant; byte _gameVariant; byte _maxInvent; @@ -172,6 +177,7 @@ public: const HugoGameDescription *_gameDescription; uint32 getFeatures() const; + const char *HugoEngine::getGameId() const; GameType getGameType() const; Common::Platform getPlatform() const; @@ -183,17 +189,17 @@ public: return *s_Engine; } - void initGame(const HugoGameDescription *gd); - void initGamePart(const HugoGameDescription *gd); + bool canLoadGameStateCurrently(); + bool canSaveGameStateCurrently(); bool loadHugoDat(); - int getMouseX() const { - return _mouseX; - } - int getMouseY() const { - return _mouseY; - } + char *useBG(char *name); + int deltaX(int x1, int x2, int vx, int y); + int deltaY(int x1, int x2, int vy, int y); + + void initGame(const HugoGameDescription *gd); + void initGamePart(const HugoGameDescription *gd); void boundaryCollision(object_t *obj); void clearBoundary(int x1, int x2, int y); void endGame(); @@ -204,10 +210,12 @@ public: void shutdown(); void storeBoundary(int x1, int x2, int y); - char *useBG(char *name); - - int deltaX(int x1, int x2, int vx, int y); - int deltaY(int x1, int x2, int vy, int y); + int getMouseX() const { + return _mouseX; + } + int getMouseY() const { + return _mouseY; + } overlay_t &getBoundaryOverlay() { return _boundary; @@ -242,6 +250,18 @@ public: byte getIntroSize() { return _introXSize; } + Common::Error saveGameState(int slot, const char *desc) { + + return (_file->saveGame(slot, desc) ? Common::kWritingFailed : Common::kNoError); + } + + Common::Error loadGameState(int slot) { + return (_file->restoreGame(slot) ? Common::kReadingFailed : Common::kNoError); + } + + bool hasFeature(EngineFeature f) const { + return (f == kSupportsRTL) || (f == kSupportsLoadingDuringRuntime) || (f == kSupportsSavingDuringRuntime); + } FileManager *_file; Scheduler *_scheduler; -- cgit v1.2.3