aboutsummaryrefslogtreecommitdiff
path: root/sword2
diff options
context:
space:
mode:
authorMax Horn2004-06-25 22:39:21 +0000
committerMax Horn2004-06-25 22:39:21 +0000
commit6b722ff11bcaa4622cf662245819993316eb8c5d (patch)
tree32c18fbb30a80698904e50377b5ce2b83739246d /sword2
parent7a8d469c666f162570f633ec465798e1e5720eef (diff)
downloadscummvm-rg350-6b722ff11bcaa4622cf662245819993316eb8c5d.tar.gz
scummvm-rg350-6b722ff11bcaa4622cf662245819993316eb8c5d.tar.bz2
scummvm-rg350-6b722ff11bcaa4622cf662245819993316eb8c5d.zip
Added Engine::_saveFileMan; thus was able to get rid of auto_ptr usage again
svn-id: r14058
Diffstat (limited to 'sword2')
-rw-r--r--sword2/save_rest.cpp18
1 files changed, 4 insertions, 14 deletions
diff --git a/sword2/save_rest.cpp b/sword2/save_rest.cpp
index a3ecbc22a2..a12d498c43 100644
--- a/sword2/save_rest.cpp
+++ b/sword2/save_rest.cpp
@@ -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 @@ uint32 Sword2Engine::saveData(uint16 slotNo, byte *buffer, uint32 bufferSize) {
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 @@ uint32 Sword2Engine::restoreData(uint16 slotNo, byte *buffer, uint32 bufferSize)
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 @@ uint32 Sword2Engine::getSaveDescription(uint16 slotNo, byte *description) {
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 @@ bool Sword2Engine::saveExists(uint16 slotNo) {
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;
}