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

strangerke at users.sourceforge.net strangerke at users.sourceforge.net
Sat Nov 27 00:17:17 CET 2010


Revision: 54503
          http://scummvm.svn.sourceforge.net/scummvm/?rev=54503&view=rev
Author:   strangerke
Date:     2010-11-26 23:17:16 +0000 (Fri, 26 Nov 2010)

Log Message:
-----------
HUGO: Get rid of initial savegame

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/hugo.cpp
    scummvm/trunk/engines/hugo/hugo.h
    scummvm/trunk/engines/hugo/intro_v1w.cpp

Modified: scummvm/trunk/engines/hugo/detection.cpp
===================================================================
--- scummvm/trunk/engines/hugo/detection.cpp	2010-11-26 22:15:31 UTC (rev 54502)
+++ scummvm/trunk/engines/hugo/detection.cpp	2010-11-26 23:17:16 UTC (rev 54503)
@@ -194,8 +194,7 @@
 	_packedFl = (getFeatures() & GF_PACKED);
 	_gameVariant = _gameType - 1 + ((_platform == Common::kPlatformWindows) ? 0 : 3);
 
-	// Generate filenames
-	_initFilename = _targetName + "-00.SAV";
+	// Generate filename
 	_saveFilename = _targetName + "-%d.SAV";
 }
 

Modified: scummvm/trunk/engines/hugo/file.cpp
===================================================================
--- scummvm/trunk/engines/hugo/file.cpp	2010-11-26 22:15:31 UTC (rev 54502)
+++ scummvm/trunk/engines/hugo/file.cpp	2010-11-26 23:17:16 UTC (rev 54503)
@@ -297,19 +297,13 @@
 }
 
 /**
-* Save game to supplied slot (-1 is INITFILE)
+* Save game to supplied slot
 */
 void FileManager::saveGame(int16 slot, const char *descrip) {
 	debugC(1, kDebugFile, "saveGame(%d, %s)", slot, descrip);
 
 	// Get full path of saved game file - note test for INITFILE
-	Common::String path; // Full path of saved game
-
-	if (slot == -1)
-		path = _vm->_initFilename;
-	else
-		path = Common::String::format(_vm->_saveFilename.c_str(), slot);
-
+	Common::String path = Common::String::format(_vm->_saveFilename.c_str(), slot);
 	Common::WriteStream *out = _vm->getSaveFileManager()->openForSaving(path);
 	if (!out) {
 		warning("Can't create file '%s', game not saved", path.c_str());
@@ -374,7 +368,7 @@
 }
 
 /**
-* Restore game from supplied slot number (-1 is INITFILE)
+* Restore game from supplied slot number
 */
 void FileManager::restoreGame(int16 slot) {
 	debugC(1, kDebugFile, "restoreGame(%d)", slot);
@@ -385,10 +379,7 @@
 	// Get full path of saved game file - note test for INITFILE
 	Common::String path; // Full path of saved game
 
-	if (slot == -1)
-		path = _vm->_initFilename;
-	else
-		path = Common::String::format(_vm->_saveFilename.c_str(), slot);
+	path = Common::String::format(_vm->_saveFilename.c_str(), slot);
 
 	Common::SeekableReadStream *in = _vm->getSaveFileManager()->openForLoading(path);
 	if (!in)
@@ -458,41 +449,6 @@
 }
 
 /**
-* Initialize the size of a saved game (from the fixed initial game).
-* If status.initsave is TRUE, or the initial saved game is not found,
-* force a save to create one.  Normally the game will be shipped with
-* the initial game file but useful to force a write during development
-* when the size is changeable.
-* The net result is a valid INITFILE, with status.savesize initialized.
-*/
-void FileManager::initSavedGame() {
-	debugC(1, kDebugFile, "initSavedGame");
-
-	// Force save of initial game
-	if (_vm->getGameStatus().initSaveFl)
-		saveGame(-1, "");
-
-	// If initial game doesn't exist, create it
-	Common::SeekableReadStream *in = _vm->getSaveFileManager()->openForLoading(_vm->_initFilename);
-	if (!in) {
-		saveGame(-1, "");
-		in = _vm->getSaveFileManager()->openForLoading(_vm->_initFilename);
-		if (!in) {
-			warning("Unable to write file: %s", _vm->_initFilename.c_str());
-			return;
-		}
-	}
-
-	// Must have an open saved game now
-	_vm->getGameStatus().saveSize = in->size();
-	delete in;
-
-	// Check sanity - maybe disk full or path set to read-only drive?
-	if (_vm->getGameStatus().saveSize <= 0)
-		warning("Unable to write file: %s", _vm->_initFilename.c_str());
-}
-
-/**
 * Read the encrypted text from the boot file and print it
 */
 void FileManager::printBootText() {

Modified: scummvm/trunk/engines/hugo/file.h
===================================================================
--- scummvm/trunk/engines/hugo/file.h	2010-11-26 22:15:31 UTC (rev 54502)
+++ scummvm/trunk/engines/hugo/file.h	2010-11-26 23:17:16 UTC (rev 54503)
@@ -58,7 +58,6 @@
 	bool     fileExists(char *filename);
 	sound_pt getSound(short sound, uint16 *size);
 
-	void     initSavedGame();
 	void     instructions();
 	void     readBootFile();
 	void     readImage(int objNum, object_t *objPtr);

Modified: scummvm/trunk/engines/hugo/game.h
===================================================================
--- scummvm/trunk/engines/hugo/game.h	2010-11-26 22:15:31 UTC (rev 54502)
+++ scummvm/trunk/engines/hugo/game.h	2010-11-26 23:17:16 UTC (rev 54503)
@@ -818,11 +818,9 @@
 };
 
 struct status_t {                                   // Game status (not saved)
-	bool     initSaveFl;                            // Force save of initial game
 	bool     storyModeFl;                           // Game is telling story - no commands
 	bool     gameOverFl;                            // Game is over - hero knobbled
 	bool     demoFl;                                // Game is in demo mode
-	bool     debugFl;                               // Game is in debug mode
 	bool     textBoxFl;                             // Game is (halted) in text box
 	bool     lookFl;                                // Toolbar "look" button pressed
 	bool     recallFl;                              // Toolbar "recall" button pressed
@@ -842,16 +840,16 @@
 	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
-	long     saveSize;                              // Size of a saved game
 	int16    saveSlot;                              // Current slot to save/restore game
-	int16    screenWidth;                           // Desktop screen width
 	int16    song;                                  // Current song
 	int16    cx, cy;                                // Cursor position (dib coords)
+
 // Strangerke - Suppress as related to playback
 //	bool     playbackFl;                            // Game is in playback mode
 //	bool     recordFl;                              // Game is in record mode
 // Strangerke - Not used ?
 //	bool     mmtimeFl;                              // Multimedia timer supported
+//	int16    screenWidth;                           // Desktop screen width
 //	uint32   saveTick;                              // Time of last save in ticks
 };
 

Modified: scummvm/trunk/engines/hugo/hugo.cpp
===================================================================
--- scummvm/trunk/engines/hugo/hugo.cpp	2010-11-26 22:15:31 UTC (rev 54502)
+++ scummvm/trunk/engines/hugo/hugo.cpp	2010-11-26 23:17:16 UTC (rev 54503)
@@ -254,8 +254,6 @@
 	initialize();
 	initConfig(RESET);                              // Reset user's config
 
-	_file->restoreGame(-1);
-
 	initMachine();
 
 	// Start the state machine
@@ -903,16 +901,10 @@
 */
 void HugoEngine::initStatus() {
 	debugC(1, kDebugEngine, "initStatus");
-	_status.initSaveFl    = true;                   // Force initial save
 	_status.storyModeFl   = false;                  // Not in story mode
 	_status.gameOverFl    = false;                  // Hero not knobbled yet
-// Strangerke - Suppress as related to playback
-//	_status.recordFl      = false;                  // Not record mode
-//	_status.playbackFl    = false;                  // Not playback mode
 	_status.demoFl        = false;                  // Not demo mode
 	_status.textBoxFl     = false;                  // Not processing a text box
-// Strangerke - Not used ?
-//	_status.mmtime        = false;                   // Multimedia timer support
 	_status.lookFl        = false;                  // Toolbar "look" button
 	_status.recallFl      = false;                  // Toolbar "recall" button
 	_status.leftButtonFl  = false;                  // Left mouse button pressed
@@ -924,11 +916,9 @@
 	_status.doQuitFl      = false;
 	_status.path[0]       = 0;                      // Path to write files
 	_status.saveSlot      = 0;                      // Slot to save/restore game
-	_status.screenWidth   = 0;                      // Desktop screen width
 
 	// Initialize every start of new game
 	_status.tick            = 0;                    // Tick count
-//	_status.saveTick        = 0;                    // Time of last save
 	_status.viewState       = V_IDLE;               // View state
 	_status.inventoryState  = I_OFF;                // Inventory icon bar state
 	_status.inventoryHeight = 0;                    // Inventory icon bar pos
@@ -936,6 +926,14 @@
 	_status.routeIndex      = -1;                   // Hero not following a route
 	_status.go_for          = GO_SPACE;             // Hero walking to space
 	_status.go_id           = -1;                   // Hero not walking to anything
+
+// Strangerke - Suppress as related to playback
+//	_status.recordFl      = false;                  // Not record mode
+//	_status.playbackFl    = false;                  // Not playback mode
+// Strangerke - Not used ?
+//	_status.mmtime        = false;                  // Multimedia timer support
+//	_status.screenWidth   = 0;                      // Desktop screen width
+//	_status.saveTick      = 0;                      // Time of last save
 }
 
 /**
@@ -965,8 +963,6 @@
 				break;
 			}
 		}
-
-		_file->initSavedGame();   // Initialize saved game
 		break;
 	case RESTORE:
 		warning("Unhandled action RESTORE");

Modified: scummvm/trunk/engines/hugo/hugo.h
===================================================================
--- scummvm/trunk/engines/hugo/hugo.h	2010-11-26 22:15:31 UTC (rev 54502)
+++ scummvm/trunk/engines/hugo/hugo.h	2010-11-26 23:17:16 UTC (rev 54503)
@@ -165,7 +165,7 @@
 	const char *_episode;
 	const char *_picDir;
 
-	Common::String _initFilename, _saveFilename;
+	Common::String _saveFilename;
 
 	command_t _statusLine;
 	command_t _scoreLine;

Modified: scummvm/trunk/engines/hugo/intro_v1w.cpp
===================================================================
--- scummvm/trunk/engines/hugo/intro_v1w.cpp	2010-11-26 22:15:31 UTC (rev 54502)
+++ scummvm/trunk/engines/hugo/intro_v1w.cpp	2010-11-26 23:17:16 UTC (rev 54503)
@@ -49,7 +49,6 @@
 * Auto-start a new game
 */
 void intro_v1w::preNewGame() {
-	_vm->_file->restoreGame(-1);
 	_vm->getGameStatus().viewState = V_INTROINIT;
 }
 


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