[Scummvm-cvs-logs] SF.net SVN: scummvm:[43002] scummvm/branches/branch-1-0-0/engines/gob/ inter_v2.cpp

drmccoy at users.sourceforge.net drmccoy at users.sourceforge.net
Sun Aug 2 15:54:45 CEST 2009


Revision: 43002
          http://scummvm.svn.sourceforge.net/scummvm/?rev=43002&view=rev
Author:   drmccoy
Date:     2009-08-02 13:54:42 +0000 (Sun, 02 Aug 2009)

Log Message:
-----------
Backport: Show a message if saving or loading a game fails.

Modified Paths:
--------------
    scummvm/branches/branch-1-0-0/engines/gob/inter_v2.cpp

Modified: scummvm/branches/branch-1-0-0/engines/gob/inter_v2.cpp
===================================================================
--- scummvm/branches/branch-1-0-0/engines/gob/inter_v2.cpp	2009-08-02 13:54:06 UTC (rev 43001)
+++ scummvm/branches/branch-1-0-0/engines/gob/inter_v2.cpp	2009-08-02 13:54:42 UTC (rev 43002)
@@ -25,6 +25,8 @@
 
 #include "common/endian.h"
 
+#include "gui/message.h"
+
 #include "sound/mixer.h"
 #include "sound/mods/infogrames.h"
 
@@ -1357,10 +1359,19 @@
 
 	mode = _vm->_saveLoad->getSaveMode(file);
 	if (mode == SaveLoad::kSaveModeSave) {
+
 		WRITE_VAR(1, 1);
-		if (_vm->_saveLoad->load(file, dataVar, size, offset))
+
+		if (!_vm->_saveLoad->load(file, dataVar, size, offset)) {
+
+			GUI::MessageDialog dialog("Failed to load game state from file.");
+			dialog.runModal();
+
+		} else
 			WRITE_VAR(1, 0);
+
 		return false;
+
 	} else if (mode == SaveLoad::kSaveModeIgnore)
 		return false;
 
@@ -1431,8 +1442,15 @@
 
 	mode = _vm->_saveLoad->getSaveMode(file);
 	if (mode == SaveLoad::kSaveModeSave) {
-		if (_vm->_saveLoad->save(file, dataVar, size, offset))
+
+		if (!_vm->_saveLoad->save(file, dataVar, size, offset)) {
+
+			GUI::MessageDialog dialog("Failed to save game state to file.");
+			dialog.runModal();
+
+		} else
 			WRITE_VAR(1, 0);
+
 	} else if (mode == SaveLoad::kSaveModeNone)
 		warning("Attempted to write to file \"%s\"", file);
 


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