[Scummvm-cvs-logs] SF.net SVN: scummvm:[54576] scummvm/trunk/engines/hugo

strangerke at users.sourceforge.net strangerke at users.sourceforge.net
Mon Nov 29 18:42:09 CET 2010


Revision: 54576
          http://scummvm.svn.sourceforge.net/scummvm/?rev=54576&view=rev
Author:   strangerke
Date:     2010-11-29 17:42:08 +0000 (Mon, 29 Nov 2010)

Log Message:
-----------
HUGO: Add GMM save/load and RTL

Modified Paths:
--------------
    scummvm/trunk/engines/hugo/detection.cpp
    scummvm/trunk/engines/hugo/file.cpp
    scummvm/trunk/engines/hugo/file.h
    scummvm/trunk/engines/hugo/game.h
    scummvm/trunk/engines/hugo/global.h
    scummvm/trunk/engines/hugo/hugo.cpp
    scummvm/trunk/engines/hugo/hugo.h
    scummvm/trunk/engines/hugo/parser.cpp
    scummvm/trunk/engines/hugo/parser_v1d.cpp
    scummvm/trunk/engines/hugo/parser_v1w.cpp
    scummvm/trunk/engines/hugo/parser_v2d.cpp
    scummvm/trunk/engines/hugo/parser_v3d.cpp

Modified: scummvm/trunk/engines/hugo/detection.cpp
===================================================================
--- scummvm/trunk/engines/hugo/detection.cpp	2010-11-29 16:35:29 UTC (rev 54575)
+++ scummvm/trunk/engines/hugo/detection.cpp	2010-11-29 17:42:08 UTC (rev 54576)
@@ -24,6 +24,10 @@
  */
 
 #include "engines/advancedDetector.h"
+#include "common/system.h"
+#include "common/savefile.h"
+#include "graphics/thumbnail.h"
+#include "graphics/surface.h"
 
 #include "hugo/hugo.h"
 
@@ -38,6 +42,11 @@
 	return _gameDescription->desc.flags;
 }
 
+const char *HugoEngine::getGameId() const {
+	return _gameDescription->desc.gameid;
+}
+
+
 static const PlainGameDescriptor hugoGames[] = {
 	// Games
 	{"hugo1", "Hugo 1: Hugo's House of Horrors"},
@@ -162,8 +171,12 @@
 	}
 
 	bool createInstance(OSystem *syst, Engine **engine, const ADGameDescription *gd) const;
+	bool hasFeature(MetaEngineFeature f) const;
 
-	bool hasFeature(MetaEngineFeature f) const;
+	int getMaximumSaveSlot() const;
+	SaveStateList listSaves(const char *target) const;
+	SaveStateDescriptor querySaveMetaInfos(const char *target, int slot) const;
+	void removeSaveState(const char *target, int slot) const;
 };
 
 bool HugoMetaEngine::createInstance(OSystem *syst, Engine **engine, const ADGameDescription *gd) const {
@@ -175,9 +188,117 @@
 }
 
 bool HugoMetaEngine::hasFeature(MetaEngineFeature f) const {
-	return false;
+	return
+	    (f == kSupportsListSaves) ||
+	    (f == kSupportsLoadingDuringStartup) ||
+	    (f == kSupportsDeleteSave) ||
+	    (f == kSavesSupportMetaInfo) ||
+	    (f == kSavesSupportThumbnail) ||
+	    (f == kSavesSupportCreationDate);
 }
 
+int HugoMetaEngine::getMaximumSaveSlot() const { return 99; }
+
+SaveStateList HugoMetaEngine::listSaves(const char *target) const {
+	Common::SaveFileManager *saveFileMan = g_system->getSavefileManager();
+	Common::StringArray filenames;
+	Common::String pattern = target;
+	pattern += "-??.SAV";
+
+	filenames = saveFileMan->listSavefiles(pattern);
+	sort(filenames.begin(), filenames.end());   // Sort (hopefully ensuring we are sorted numerically..)
+
+	SaveStateList saveList;
+	int slotNum = 0;
+	for (Common::StringArray::const_iterator filename = filenames.begin(); filename != filenames.end(); ++filename) {
+		// Obtain the last 3 digits of the filename, since they correspond to the save slot
+		slotNum = atoi(filename->c_str() + filename->size() - 3);
+
+		if (slotNum >= 0 && slotNum <= getMaximumSaveSlot()) {
+			Common::InSaveFile *file = saveFileMan->openForLoading(*filename);
+			if (file) {
+				int saveVersion = file->readByte();
+
+				if (saveVersion != kSavegameVersion) {
+					warning("Savegame of incompatible version");
+					delete file;
+					continue;
+				}
+
+				// read name
+				uint16 nameSize = file->readUint16BE();
+				if (nameSize >= 255) {
+					delete file;
+					continue;
+				}
+				char name[256];
+				file->read(name, nameSize);
+				name[nameSize] = 0;
+
+				saveList.push_back(SaveStateDescriptor(slotNum, name));
+				delete file;
+			}
+		}
+	}
+
+	return saveList;
+}
+
+SaveStateDescriptor HugoMetaEngine::querySaveMetaInfos(const char *target, int slot) const {
+	Common::String fileName = Common::String::format("%s-%02d.SAV", target, slot);
+	Common::InSaveFile *file = g_system->getSavefileManager()->openForLoading(fileName);
+
+	if (file) {
+		int saveVersion = file->readByte();
+
+		if (saveVersion != kSavegameVersion) {
+			warning("Savegame of incompatible version");
+			delete file;
+			return SaveStateDescriptor();
+		}
+
+		uint32 saveNameLength = file->readUint16BE();
+		char saveName[256];
+		file->read(saveName, saveNameLength);
+		saveName[saveNameLength] = 0;
+
+		SaveStateDescriptor desc(slot, saveName);
+
+		Graphics::Surface *thumbnail = new Graphics::Surface();
+		assert(thumbnail);
+		if (!Graphics::loadThumbnail(*file, *thumbnail)) {
+			delete thumbnail;
+			thumbnail = 0;
+		}
+		desc.setThumbnail(thumbnail);
+
+		desc.setDeletableFlag(true);
+		desc.setWriteProtectedFlag(false);
+
+		uint32 saveDate = file->readUint32BE();
+		uint16 saveTime = file->readUint16BE();
+
+		int day = (saveDate >> 24) & 0xFF;
+		int month = (saveDate >> 16) & 0xFF;
+		int year = saveDate & 0xFFFF;
+
+		desc.setSaveDate(year, month, day);
+
+		int hour = (saveTime >> 8) & 0xFF;
+		int minutes = saveTime & 0xFF;
+
+		desc.setSaveTime(hour, minutes);
+
+		delete file;
+		return desc;
+	}
+	return SaveStateDescriptor();
+}
+
+void HugoMetaEngine::removeSaveState(const char *target, int slot) const {
+	Common::String fileName = Common::String::format("%s-%02d.SAV", target, slot);
+	g_system->getSavefileManager()->removeSavefile(fileName);
+}
 } // End of namespace Hugo
 
 #if PLUGIN_ENABLED_DYNAMIC(HUGO)
@@ -195,7 +316,7 @@
 	_gameVariant = _gameType - 1 + ((_platform == Common::kPlatformWindows) ? 0 : 3);
 
 	// Generate filename
-	_saveFilename = _targetName + "-%d.SAV";
+	_saveFilename = _targetName + "-%02d.SAV";
 }
 
 } // End of namespace Hugo

Modified: scummvm/trunk/engines/hugo/file.cpp
===================================================================
--- scummvm/trunk/engines/hugo/file.cpp	2010-11-29 16:35:29 UTC (rev 54575)
+++ scummvm/trunk/engines/hugo/file.cpp	2010-11-29 17:42:08 UTC (rev 54576)
@@ -32,6 +32,9 @@
 
 #include "common/system.h"
 #include "common/savefile.h"
+#include "common/config-manager.h"
+#include "graphics/thumbnail.h"
+#include "gui/saveload.h"
 
 #include "hugo/hugo.h"
 #include "hugo/file.h"
@@ -299,23 +302,62 @@
 /**
 * Save game to supplied slot
 */
-void FileManager::saveGame(int16 slot, const char *descrip) {
+bool FileManager::saveGame(int16 slot, Common::String descrip) {
 	debugC(1, kDebugFile, "saveGame(%d, %s)", slot, descrip);
 
-	// Get full path of saved game file - note test for INITFILE
-	Common::String path = Common::String::format(_vm->_saveFilename.c_str(), slot);
-	Common::WriteStream *out = _vm->getSaveFileManager()->openForSaving(path);
+	const EnginePlugin *plugin = NULL;
+	int16 savegameId;
+	Common::String savegameDescription;
+	EngineMan.findGame(_vm->getGameId(), &plugin);
+
+	if (slot == -1) {
+		GUI::SaveLoadChooser *dialog = new GUI::SaveLoadChooser("Save game:", "Save");
+		dialog->setSaveMode(true);
+		savegameId = dialog->runModal(plugin, ConfMan.getActiveDomainName());
+		savegameDescription = dialog->getResultString();
+		delete dialog;
+	} else {
+		savegameId = slot;
+		if (!descrip.empty()) {
+			savegameDescription = descrip;
+		} else {
+			savegameDescription = Common::String::format("Quick save #%d", slot);
+		}
+	}
+
+	if (savegameId < 0)                             // dialog aborted
+		return false;
+
+	Common::String savegameFile = Common::String::format(_vm->_saveFilename.c_str(), savegameId);
+	Common::SaveFileManager *saveMan = g_system->getSavefileManager();
+	Common::OutSaveFile *out = saveMan->openForSaving(savegameFile);
+
 	if (!out) {
-		warning("Can't create file '%s', game not saved", path.c_str());
-		return;
+		warning("Can't create file '%s', game not saved", savegameFile.c_str());
+		return false;
 	}
 
 	// Write version.  We can't restore from obsolete versions
 	out->writeByte(kSavegameVersion);
 
-	// Save description of saved game
-	out->write(descrip, DESCRIPLEN);
+	if (savegameDescription == "") {
+		savegameDescription = "Untitled savegame";
+	}
 
+	out->writeSint16BE(savegameDescription.size() + 1);
+	out->write(savegameDescription.c_str(), savegameDescription.size() + 1);
+
+	Graphics::saveThumbnail(*out);
+
+	TimeDate curTime;
+	_vm->_system->getTimeAndDate(curTime);
+
+	uint32 saveDate = (curTime.tm_mday & 0xFF) << 24 | ((curTime.tm_mon + 1) & 0xFF) << 16 | ((curTime.tm_year + 1900) & 0xFFFF);
+	uint16 saveTime = (curTime.tm_hour & 0xFF) << 8 | ((curTime.tm_min) & 0xFF);
+
+	out->writeUint32BE(saveDate);
+	out->writeUint16BE(saveTime);
+
 	_vm->_object->saveObjects(out);
 
 	const status_t &gameStatus = _vm->getGameStatus();
@@ -365,36 +407,58 @@
 	out->finalize();
 
 	delete out;
+
+	return true;
 }
 
 /**
 * Restore game from supplied slot number
 */
-void FileManager::restoreGame(int16 slot) {
+bool FileManager::restoreGame(int16 slot) {
 	debugC(1, kDebugFile, "restoreGame(%d)", slot);
 
-	// Initialize new-game status
-	_vm->initStatus();
+	const EnginePlugin *plugin = NULL;
+	int16 savegameId;
+	EngineMan.findGame(_vm->getGameId(), &plugin);
 
-	// Get full path of saved game file - note test for INITFILE
-	Common::String path; // Full path of saved game
+	if (slot == -1) {
+		GUI::SaveLoadChooser *dialog = new GUI::SaveLoadChooser("Restore game:", "Restore");
+		dialog->setSaveMode(false);
+		savegameId = dialog->runModal(plugin, ConfMan.getActiveDomainName());
+		delete dialog;
+	} else {
+		savegameId = slot;
+	}
 
-	path = Common::String::format(_vm->_saveFilename.c_str(), slot);
+	if (savegameId < 0)                             // dialog aborted
+		return false;
 
-	Common::SeekableReadStream *in = _vm->getSaveFileManager()->openForLoading(path);
+	Common::String savegameFile = Common::String::format(_vm->_saveFilename.c_str(), savegameId);
+	Common::SaveFileManager *saveMan = g_system->getSavefileManager();
+	Common::InSaveFile *in = saveMan->openForLoading(savegameFile);
+
 	if (!in)
-		return;
+		return false;
 
+	// Initialize new-game status
+	_vm->initStatus();
+
 	// Check version, can't restore from different versions
 	int saveVersion = in->readByte();
 	if (saveVersion != kSavegameVersion) {
-		error("Savegame of incompatible version");
-		return;
+		warning("Savegame of incompatible version");
+		delete in;
+		return false;
 	}
 
 	// Skip over description
-	in->seek(DESCRIPLEN, SEEK_CUR);
+	int32 saveGameNameSize = in->readSint16BE();
+	in->skip(saveGameNameSize);
 
+	Graphics::skipThumbnail(*in);
+
+	in->skip(6);                                    // Skip date & time
+
 	// If hero image is currently swapped, swap it back before restore
 	if (_vm->_heroImage != HERO)
 		_vm->_object->swapImages(HERO, _vm->_heroImage);
@@ -446,6 +510,7 @@
 	_maze.firstScreenIndex = in->readByte();
 
 	delete in;
+	return true;
 }
 
 /**

Modified: scummvm/trunk/engines/hugo/file.h
===================================================================
--- scummvm/trunk/engines/hugo/file.h	2010-11-29 16:35:29 UTC (rev 54575)
+++ scummvm/trunk/engines/hugo/file.h	2010-11-29 17:42:08 UTC (rev 54576)
@@ -63,8 +63,8 @@
 	void     readImage(int objNum, object_t *objPtr);
 	void     readUIFImages();
 	void     readUIFItem(int16 id, byte *buf);
-	void     restoreGame(int16 slot);
-	void     saveGame(int16 slot, const char *descrip);
+	bool     restoreGame(int16 slot);
+	bool     saveGame(int16 slot, Common::String descrip);
 
 	virtual void openDatabaseFiles() = 0;
 	virtual void closeDatabaseFiles() = 0;

Modified: scummvm/trunk/engines/hugo/game.h
===================================================================
--- scummvm/trunk/engines/hugo/game.h	2010-11-29 16:35:29 UTC (rev 54575)
+++ scummvm/trunk/engines/hugo/game.h	2010-11-29 17:42:08 UTC (rev 54576)
@@ -836,7 +836,6 @@
 	go_t     go_for;                                // Purpose of an automatic route
 	int16    go_id;                                 // Index of exit of object walking to
 	fpath_t  path;                                  // Alternate path for saved files
-	int16    saveSlot;                              // Current slot to save/restore game
 	int16    song;                                  // Current song
 	int16    cx, cy;                                // Cursor position (dib coords)
 
@@ -847,6 +846,7 @@
 //	bool     mmtimeFl;                              // Multimedia timer supported
 //	int16    screenWidth;                           // Desktop screen width
 //	uint32   saveTick;                              // Time of last save in ticks
+//	int16    saveSlot;                              // Current slot to save/restore game
 };
 
 struct config_t {                                   // User's config (saved)

Modified: scummvm/trunk/engines/hugo/global.h
===================================================================
--- scummvm/trunk/engines/hugo/global.h	2010-11-29 16:35:29 UTC (rev 54575)
+++ scummvm/trunk/engines/hugo/global.h	2010-11-29 17:42:08 UTC (rev 54576)
@@ -47,7 +47,4 @@
 // User interface database (Windows Only)
 // This file contains, between others, the bitmaps of the fonts used in the application
 #define UIF_FILE   "uif.dat"
-
-static const int kSavegameVersion = 1;
-
 } // End of namespace Hugo

Modified: scummvm/trunk/engines/hugo/hugo.cpp
===================================================================
--- scummvm/trunk/engines/hugo/hugo.cpp	2010-11-29 16:35:29 UTC (rev 54575)
+++ scummvm/trunk/engines/hugo/hugo.cpp	2010-11-29 17:42:08 UTC (rev 54576)
@@ -69,6 +69,7 @@
 	_backgroundObjectsSize(0), _screenActsSize(0), _usesSize(0)
 
 {
+	_system = syst;
 	DebugMan.addDebugChannel(kDebugSchedule, "Schedule", "Script Schedule debug level");
 	DebugMan.addDebugChannel(kDebugEngine, "Engine", "Engine debug level");
 	DebugMan.addDebugChannel(kDebugDisplay, "Display", "Display debug level");
@@ -915,7 +916,6 @@
 	_status.helpFl        = false;                  // Not calling WinHelp()
 	_status.doQuitFl      = false;
 	_status.path[0]       = 0;                      // Path to write files
-	_status.saveSlot      = 0;                      // Slot to save/restore game
 
 	// Initialize every start of new game
 	_status.tick            = 0;                    // Tick count
@@ -934,6 +934,7 @@
 //	_status.mmtime        = false;                  // Multimedia timer support
 //	_status.screenWidth   = 0;                      // Desktop screen width
 //	_status.saveTick      = 0;                      // Time of last save
+//	_status.saveSlot      = 0;                      // Slot to save/restore game
 }
 
 /**
@@ -1256,4 +1257,12 @@
 	_status.viewState = V_EXIT;
 }
 
+bool HugoEngine::canLoadGameStateCurrently() {
+	return true;
+}
+
+bool HugoEngine::canSaveGameStateCurrently() {
+	return (_status.viewState == V_PLAY);
+}
+
 } // End of namespace Hugo

Modified: scummvm/trunk/engines/hugo/hugo.h
===================================================================
--- scummvm/trunk/engines/hugo/hugo.h	2010-11-29 16:35:29 UTC (rev 54575)
+++ scummvm/trunk/engines/hugo/hugo.h	2010-11-29 17:42:08 UTC (rev 54576)
@@ -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 @@
  */
 namespace Hugo {
 
+static const int kSavegameVersion = 2;
+
 enum GameType {
 	kGameTypeNone  = 0,
 	kGameTypeHugo1,
@@ -114,6 +117,8 @@
 	HugoEngine(OSystem *syst, const HugoGameDescription *gd);
 	~HugoEngine();
 
+	OSystem *_system;
+
 	byte   _numVariant;
 	byte   _gameVariant;
 	byte   _maxInvent;
@@ -172,6 +177,7 @@
 
 	const HugoGameDescription *_gameDescription;
 	uint32 getFeatures() const;
+	const char *HugoEngine::getGameId() const;
 
 	GameType getGameType() const;
 	Common::Platform getPlatform() const;
@@ -183,17 +189,17 @@
 		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,11 +210,13 @@
 	void shutdown();
 	void storeBoundary(int x1, int x2, int y);
 
-	char *useBG(char *name);
+	int getMouseX() const {
+		return _mouseX;
+	}
+	int getMouseY() const {
+		return _mouseY;
+	}
 
-	int deltaX(int x1, int x2, int vx, int y);
-	int deltaY(int x1, int x2, int vy, int y);
-
 	overlay_t &getBoundaryOverlay() {
 		return _boundary;
 	}
@@ -242,7 +250,19 @@
 	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;
 	Screen *_screen;

Modified: scummvm/trunk/engines/hugo/parser.cpp
===================================================================
--- scummvm/trunk/engines/hugo/parser.cpp	2010-11-29 16:35:29 UTC (rev 54575)
+++ scummvm/trunk/engines/hugo/parser.cpp	2010-11-29 17:42:08 UTC (rev 54576)
@@ -100,13 +100,11 @@
 		gameStatus.recallFl = true;
 		break;
 	case Common::KEYCODE_F4:                        // Save game
-		// TODO: Add a proper screen to select saveslot
 		if (gameStatus.viewState == V_PLAY)
-			_vm->_file->saveGame(gameStatus.saveSlot, "Current game");
+			_vm->_file->saveGame(-1, Common::String());
 		break;
 	case Common::KEYCODE_F5:                        // Restore game
-		// TODO: Add a proper screen to specify saveslot and description
-		_vm->_file->restoreGame(gameStatus.saveSlot);
+		_vm->_file->restoreGame(-1);
 		_vm->_scheduler->restoreScreen(*_vm->_screen_p);
 		gameStatus.viewState = V_PLAY;
 		break;

Modified: scummvm/trunk/engines/hugo/parser_v1d.cpp
===================================================================
--- scummvm/trunk/engines/hugo/parser_v1d.cpp	2010-11-29 16:35:29 UTC (rev 54575)
+++ scummvm/trunk/engines/hugo/parser_v1d.cpp	2010-11-29 17:42:08 UTC (rev 54576)
@@ -320,18 +320,12 @@
 		if (gameStatus.gameOverFl)
 			Utils::gameOverMsg();
 		else
-//			_vm->_file->saveOrRestore(true);
-			warning("STUB: saveOrRestore()");
-			// HACK: Currently use Win code
-			_vm->_file->saveGame(gameStatus.saveSlot, "Current game");
+			_vm->_file->saveGame(-1, Common::String());
 		return;
 	}
 
 	if (!strcmp("restore", _line)) {
-//		_vm->_file->saveOrRestore(false);
-		warning("STUB: saveOrRestore()");
-		// HACK: Currently use Win code
-		_vm->_file->restoreGame(gameStatus.saveSlot);
+		_vm->_file->restoreGame(-1);
 		_vm->_scheduler->restoreScreen(*_vm->_screen_p);
 		gameStatus.viewState = V_PLAY;
 		return;

Modified: scummvm/trunk/engines/hugo/parser_v1w.cpp
===================================================================
--- scummvm/trunk/engines/hugo/parser_v1w.cpp	2010-11-29 16:35:29 UTC (rev 54575)
+++ scummvm/trunk/engines/hugo/parser_v1w.cpp	2010-11-29 17:42:08 UTC (rev 54576)
@@ -369,12 +369,12 @@
 
 	// SAVE/RESTORE
 	if (!strcmp("save", _line) && gameStatus.viewState == V_PLAY) {
-		_vm->_file->saveGame(gameStatus.saveSlot, "Current game");
+		_vm->_file->saveGame(-1, Common::String());
 		return;
 	}
 
 	if (!strcmp("restore", _line) && (gameStatus.viewState == V_PLAY || gameStatus.viewState == V_IDLE)) {
-		_vm->_file->restoreGame(gameStatus.saveSlot);
+		_vm->_file->restoreGame(-1);
 		_vm->_scheduler->restoreScreen(*_vm->_screen_p);
 		gameStatus.viewState = V_PLAY;
 		return;

Modified: scummvm/trunk/engines/hugo/parser_v2d.cpp
===================================================================
--- scummvm/trunk/engines/hugo/parser_v2d.cpp	2010-11-29 16:35:29 UTC (rev 54575)
+++ scummvm/trunk/engines/hugo/parser_v2d.cpp	2010-11-29 17:42:08 UTC (rev 54576)
@@ -75,19 +75,13 @@
 		if (gameStatus.gameOverFl)
 			Utils::gameOverMsg();
 		else
-//			_vm->_file->saveOrRestore(true);
-			warning("STUB: saveOrRestore()");
-			// HACK: Currently use Win code
-			_vm->_file->saveGame(gameStatus.saveSlot, "Current game");
+			_vm->_file->saveGame(-1, Common::String());
 		return;
 	}
 
 	if (!strcmp("restore", _line)) {
 		_config.soundFl = false;
-//		_vm->_file->saveOrRestore(false);
-		warning("STUB: saveOrRestore()");
-		// HACK: Currently use Win code
-		_vm->_file->restoreGame(gameStatus.saveSlot);
+		_vm->_file->restoreGame(-1);
 		_vm->_scheduler->restoreScreen(*_vm->_screen_p);
 		gameStatus.viewState = V_PLAY;
 		return;

Modified: scummvm/trunk/engines/hugo/parser_v3d.cpp
===================================================================
--- scummvm/trunk/engines/hugo/parser_v3d.cpp	2010-11-29 16:35:29 UTC (rev 54575)
+++ scummvm/trunk/engines/hugo/parser_v3d.cpp	2010-11-29 17:42:08 UTC (rev 54576)
@@ -127,19 +127,13 @@
 		if (gameStatus.gameOverFl)
 			Utils::gameOverMsg();
 		else
-//			_vm->_file->saveOrRestore(true);
-			warning("STUB: saveOrRestore()");
-			// HACK: Currently use Win code
-			_vm->_file->saveGame(gameStatus.saveSlot, "Current game");
+			_vm->_file->saveGame(-1, Common::String());
 		return;
 	}
 
 	if (!strcmp("restore", _line)) {
 		_config.soundFl = false;
-//		_vm->_file->saveOrRestore(false);
-		warning("STUB: saveOrRestore()");
-		// HACK: Currently use Win code
-		_vm->_file->restoreGame(gameStatus.saveSlot);
+		_vm->_file->restoreGame(-1);
 		_vm->_scheduler->restoreScreen(*_vm->_screen_p);
 		gameStatus.viewState = V_PLAY;
 		return;


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list