[Scummvm-cvs-logs] CVS: scummvm/sword2 save_rest.cpp,1.76,1.77

Torbjörn Andersson eriktorbjorn at users.sourceforge.net
Sat Nov 5 06:25:05 CET 2005


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

Modified Files:
	save_rest.cpp 
Log Message:
Call flush() in the savegame stream, when saving. I think SAGA, Simon and
BS2 were the last engines that didn't. But I could be mistaken.


Index: save_rest.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sword2/save_rest.cpp,v
retrieving revision 1.76
retrieving revision 1.77
diff -u -d -r1.76 -r1.77
--- save_rest.cpp	29 Oct 2005 21:24:54 -0000	1.76
+++ save_rest.cpp	5 Nov 2005 14:24:13 -0000	1.77
@@ -125,13 +125,15 @@
 		return SR_ERR_FILEOPEN;
 	}
 
-	uint32 itemsWritten = out->write(buffer, bufferSize);
-
-	delete out;
+	out->write(buffer, bufferSize);
+	out->flush();
 
-	if (itemsWritten == bufferSize)
+	if (!out->ioFailed()) {
+		delete out;
 		return SR_OK;
+	}
 
+	delete out;
 	return SR_ERR_WRITEFAIL;
 }
 





More information about the Scummvm-git-logs mailing list