aboutsummaryrefslogtreecommitdiff
path: root/simon
diff options
context:
space:
mode:
authorMax Horn2004-06-25 22:39:21 +0000
committerMax Horn2004-06-25 22:39:21 +0000
commit6b722ff11bcaa4622cf662245819993316eb8c5d (patch)
tree32c18fbb30a80698904e50377b5ce2b83739246d /simon
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 'simon')
-rw-r--r--simon/simon.cpp23
1 files changed, 6 insertions, 17 deletions
diff --git a/simon/simon.cpp b/simon/simon.cpp
index 9d30c14b47..1ef3aa8c7e 100644
--- a/simon/simon.cpp
+++ b/simon/simon.cpp
@@ -42,8 +42,6 @@
#include <errno.h>
#include <time.h>
-#include <memory>
-
#ifdef __PALM_OS__
#include "globals.h"
#endif
@@ -2625,15 +2623,13 @@ int SimonEngine::count_savegames() {
uint i = 1;
bool marks[256];
- const std::auto_ptr<SaveFileManager> mgr(_system->get_savefile_manager());
-
char *prefix = gen_savename(999);
prefix[strlen(prefix)-3] = '\0';
- mgr->list_savefiles(prefix, getSavePath(), marks, 256);
+ _saveFileMan->list_savefiles(prefix, getSavePath(), marks, 256);
while (i < 256) {
if (marks[i] &&
- (f = mgr->open_savefile(gen_savename(i), getSavePath(),
+ (f = _saveFileMan->open_savefile(gen_savename(i), getSavePath(),
false))) {
i++;
delete f;
@@ -2653,11 +2649,8 @@ int SimonEngine::display_savegame_list(int curpos, bool load, char *dst) {
slot = curpos;
- const std::auto_ptr<SaveFileManager> mgr(_system->get_savefile_manager());
-
-
while (curpos + 6 > slot) {
- if(!(in = mgr->open_savefile(gen_savename(slot), getSavePath(), false)))
+ if(!(in = _saveFileMan->open_savefile(gen_savename(slot), getSavePath(), false)))
break;
in->read(dst, 18);
@@ -2681,7 +2674,7 @@ int SimonEngine::display_savegame_list(int curpos, bool load, char *dst) {
}
} else {
if (curpos + 6 == slot) {
- if((in = mgr->open_savefile(gen_savename(slot), getSavePath(), false))) {
+ if((in = _saveFileMan->open_savefile(gen_savename(slot), getSavePath(), false))) {
slot++;
delete in;
}
@@ -4807,10 +4800,8 @@ bool SimonEngine::save_game(uint slot, char *caption) {
errno = 0;
#endif
- const std::auto_ptr<SaveFileManager> mgr(_system->get_savefile_manager());
-
- f = mgr->open_savefile(gen_savename(slot), getSavePath(), true);
+ f = _saveFileMan->open_savefile(gen_savename(slot), getSavePath(), true);
if (f == NULL) {
_lock_word &= ~0x100;
return false;
@@ -4910,10 +4901,8 @@ bool SimonEngine::load_game(uint slot) {
errno = 0;
#endif
- const std::auto_ptr<SaveFileManager> mgr(_system->get_savefile_manager());
-
- f = mgr->open_savefile(gen_savename(slot), getSavePath(), false);
+ f = _saveFileMan->open_savefile(gen_savename(slot), getSavePath(), false);
if (f == NULL) {
_lock_word &= ~0x100;
return false;