[Scummvm-cvs-logs] CVS: scummvm/sword2 save_rest.cpp,1.56,1.57

Max Horn fingolfin at users.sourceforge.net
Fri Jun 25 15:40:04 CEST 2004


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

Modified Files:
	save_rest.cpp 
Log Message:
Added Engine::_saveFileMan; thus was able to get rid of auto_ptr usage again

Index: save_rest.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sword2/save_rest.cpp,v
retrieving revision 1.56
retrieving revision 1.57
diff -u -d -r1.56 -r1.57
--- save_rest.cpp	25 Jun 2004 22:12:54 -0000	1.56
+++ save_rest.cpp	25 Jun 2004 22:39:21 -0000	1.57
@@ -33,8 +33,6 @@
 #include "sword2/logic.h"
 #include "sword2/resman.h"
 
-#include <memory>
-
 namespace Sword2 {
 
 // A savegame consists of a header and the global variables
@@ -165,11 +163,9 @@
 
 	sprintf(saveFileName, "%s.%.3d", _targetName, slotNo);
 
-	const std::auto_ptr<SaveFileManager> mgr(_system->get_savefile_manager());
-
 	SaveFile *out;
 
-	if (!(out = mgr->open_savefile(saveFileName, getSavePath(), true))) {
+	if (!(out = _saveFileMan->open_savefile(saveFileName, getSavePath(), true))) {
 		return SR_ERR_FILEOPEN;
 	}
 
@@ -214,11 +210,9 @@
 
 	sprintf(saveFileName, "%s.%.3d", _targetName, slotNo);
 
-	const std::auto_ptr<SaveFileManager> mgr(_system->get_savefile_manager());
-
 	SaveFile *in;
 
-	if (!(in = mgr->open_savefile(saveFileName, getSavePath(), false))) {
+	if (!(in = _saveFileMan->open_savefile(saveFileName, getSavePath(), false))) {
 		// error: couldn't open file
 		return SR_ERR_FILEOPEN;
 	}
@@ -361,11 +355,9 @@
 
 	sprintf(saveFileName, "%s.%.3d", _targetName, slotNo);
 
-	const std::auto_ptr<SaveFileManager> mgr(_system->get_savefile_manager());
-
 	SaveFile *in;
 
-	if (!(in = mgr->open_savefile(saveFileName, getSavePath(), false))) {
+	if (!(in = _saveFileMan->open_savefile(saveFileName, getSavePath(), false))) {
 		return SR_ERR_FILEOPEN;
 	}
 
@@ -390,11 +382,9 @@
 
 	sprintf(saveFileName, "%s.%.3d", _targetName, slotNo);
 
-	const std::auto_ptr<SaveFileManager> mgr(_system->get_savefile_manager());
-
 	SaveFile *in;
 
-	if (!(in = mgr->open_savefile(saveFileName, getSavePath(), false))) {
+	if (!(in = _saveFileMan->open_savefile(saveFileName, getSavePath(), false))) {
 		return false;
 	}
 





More information about the Scummvm-git-logs mailing list