[Scummvm-cvs-logs] CVS: residual engine.cpp,1.64,1.65

Pawel Kolodziejski aquadran at users.sourceforge.net
Fri Jan 14 02:54:10 CET 2005


Update of /cvsroot/scummvm/residual
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31919/residual

Modified Files:
	engine.cpp 
Log Message:
moved code. pause also while restore

Index: engine.cpp
===================================================================
RCS file: /cvsroot/scummvm/residual/engine.cpp,v
retrieving revision 1.64
retrieving revision 1.65
diff -u -d -r1.64 -r1.65
--- engine.cpp	14 Jan 2005 10:51:19 -0000	1.64
+++ engine.cpp	14 Jan 2005 10:53:29 -0000	1.65
@@ -257,6 +257,9 @@
 	g_imuse->stopAllSounds();
 	g_imuse->resetState();
 	g_smush->stop();
+	g_imuse->pause(true);
+	g_smush->pause(true);
+
 	//  free all resource
 	//  lock resources
 
@@ -281,44 +284,10 @@
 	gzclose(_savegameFileHandle);
 
 	//bundle_dofile("patch05.bin");
-	printf("Engine::savegameRestore() finished.\n");
-}
-
-void Engine::savegameCallback() {
-	lua_Object funcParam1;
-	lua_Object funcParam2;
-	bool unk1 = false;
-	bool unk2 = false;
-
-	lua_beginblock();
-	lua_pushobject(lua_getglobal("system"));
-	lua_pushstring("saveGameCallback");
-	funcParam2 = lua_gettable();
 
-	if (lua_istable(funcParam2)) {
-		lua_pushobject(funcParam2);
-		lua_pushstring("saveGameCallback");
-		funcParam1 = lua_gettable();
-		if (lua_isfunction(funcParam1)) {
-			unk1 = true;
-			unk2 = true;
-		} else {
-			assert(false);
-		}
-	} else if (lua_isfunction(funcParam2)) {
-		funcParam1 = funcParam2;
-		unk1 = false;
-		unk2 = true;
-	} else if (!lua_isnil(funcParam2)) {
-		assert(false);
-	}
-	if (unk2) {
-		if (unk1) {
-			lua_pushobject(funcParam2);
-		}
-		lua_callfunction(funcParam1);
-	}
-	lua_endblock();
+	g_imuse->pause(false);
+	g_smush->pause(false);
+	printf("Engine::savegameRestore() finished.\n");
 }
 
 void Engine::savegameSave() {
@@ -364,6 +333,43 @@
 	printf("Engine::savegameSave() finished.\n");
 }
 
+void Engine::savegameCallback() {
+	lua_Object funcParam1;
+	lua_Object funcParam2;
+	bool unk1 = false;
+	bool unk2 = false;
+
+	lua_beginblock();
+	lua_pushobject(lua_getglobal("system"));
+	lua_pushstring("saveGameCallback");
+	funcParam2 = lua_gettable();
+
+	if (lua_istable(funcParam2)) {
+		lua_pushobject(funcParam2);
+		lua_pushstring("saveGameCallback");
+		funcParam1 = lua_gettable();
+		if (lua_isfunction(funcParam1)) {
+			unk1 = true;
+			unk2 = true;
+		} else {
+			assert(false);
+		}
+	} else if (lua_isfunction(funcParam2)) {
+		funcParam1 = funcParam2;
+		unk1 = false;
+		unk2 = true;
+	} else if (!lua_isnil(funcParam2)) {
+		assert(false);
+	}
+	if (unk2) {
+		if (unk1) {
+			lua_pushobject(funcParam2);
+		}
+		lua_callfunction(funcParam1);
+	}
+	lua_endblock();
+}
+
 void Engine::setScene(const char *name) {
 	Block *b = g_resourceloader->getFileBlock(name);
 	if (b == NULL)





More information about the Scummvm-git-logs mailing list