[Scummvm-cvs-logs] SF.net SVN: scummvm:[49685] scummvm/trunk/engines/sci/engine/savegame.cpp

thebluegr at users.sourceforge.net thebluegr at users.sourceforge.net
Tue Jun 15 09:25:09 CEST 2010


Revision: 49685
          http://scummvm.svn.sourceforge.net/scummvm/?rev=49685&view=rev
Author:   thebluegr
Date:     2010-06-15 07:25:09 +0000 (Tue, 15 Jun 2010)

Log Message:
-----------
Reorganized functions a bit

Modified Paths:
--------------
    scummvm/trunk/engines/sci/engine/savegame.cpp

Modified: scummvm/trunk/engines/sci/engine/savegame.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/savegame.cpp	2010-06-15 07:21:52 UTC (rev 49684)
+++ scummvm/trunk/engines/sci/engine/savegame.cpp	2010-06-15 07:25:09 UTC (rev 49685)
@@ -738,33 +738,6 @@
 }
 #endif
 
-#pragma mark -
-
-
-int gamestate_save(EngineState *s, Common::WriteStream *fh, const char* savename, const char *version) {
-	TimeDate curTime;
-	g_system->getTimeAndDate(curTime);
-
-	SavegameMetadata meta;
-	meta.savegame_version = CURRENT_SAVEGAME_VERSION;
-	meta.savegame_name = savename;
-	meta.game_version = version;
-	meta.savegame_date = ((curTime.tm_mday & 0xFF) << 24) | (((curTime.tm_mon + 1) & 0xFF) << 16) | ((curTime.tm_year + 1900) & 0xFFFF);
-	meta.savegame_time = ((curTime.tm_hour & 0xFF) << 16) | (((curTime.tm_min) & 0xFF) << 8) | ((curTime.tm_sec) & 0xFF);
-
-	if (s->executionStackBase) {
-		warning("Cannot save from below kernel function");
-		return 1;
-	}
-
-	Common::Serializer ser(0, fh);
-	sync_SavegameMetadata(ser, meta);
-	Graphics::saveThumbnail(*fh);
-	s->saveLoadWithSerializer(ser);		// FIXME: Error handling?
-
-	return 0;
-}
-
 void SegManager::reconstructStack(EngineState *s) {
 	DataStack *stack = (DataStack *)(_heap[findSegmentByType(SEG_TYPE_STACK)]);
 	s->stack_base = stack->_entries;
@@ -874,6 +847,34 @@
 }
 #endif
 
+
+#pragma mark -
+
+
+int gamestate_save(EngineState *s, Common::WriteStream *fh, const char* savename, const char *version) {
+	TimeDate curTime;
+	g_system->getTimeAndDate(curTime);
+
+	SavegameMetadata meta;
+	meta.savegame_version = CURRENT_SAVEGAME_VERSION;
+	meta.savegame_name = savename;
+	meta.game_version = version;
+	meta.savegame_date = ((curTime.tm_mday & 0xFF) << 24) | (((curTime.tm_mon + 1) & 0xFF) << 16) | ((curTime.tm_year + 1900) & 0xFFFF);
+	meta.savegame_time = ((curTime.tm_hour & 0xFF) << 16) | (((curTime.tm_min) & 0xFF) << 8) | ((curTime.tm_sec) & 0xFF);
+
+	if (s->executionStackBase) {
+		warning("Cannot save from below kernel function");
+		return 1;
+	}
+
+	Common::Serializer ser(0, fh);
+	sync_SavegameMetadata(ser, meta);
+	Graphics::saveThumbnail(*fh);
+	s->saveLoadWithSerializer(ser);		// FIXME: Error handling?
+
+	return 0;
+}
+
 void gamestate_restore(EngineState *s, Common::SeekableReadStream *fh) {
 #ifdef USE_OLD_MUSIC_FUNCTIONS
 	SongLibrary temp;


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