aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorMatthew Hoops2007-09-03 01:55:56 +0000
committerMatthew Hoops2007-09-03 01:55:56 +0000
commit5a5e994e4fdcfd1c509fdedeae5c4d8157996627 (patch)
tree68cad06d4940021aa5af9079d30fa4ae0cdfaaa7 /engines
parent30c479a7e460f035d85313a91ae6fc6be4cfe565 (diff)
downloadscummvm-rg350-5a5e994e4fdcfd1c509fdedeae5c4d8157996627.tar.gz
scummvm-rg350-5a5e994e4fdcfd1c509fdedeae5c4d8157996627.tar.bz2
scummvm-rg350-5a5e994e4fdcfd1c509fdedeae5c4d8157996627.zip
make Mickey use the SaveFileManager for saving/loading
svn-id: r28843
Diffstat (limited to 'engines')
-rw-r--r--engines/agi/agi.h3
-rw-r--r--engines/agi/preagi_mickey.cpp17
2 files changed, 12 insertions, 8 deletions
diff --git a/engines/agi/agi.h b/engines/agi/agi.h
index 1dce3f46a9..25516229e9 100644
--- a/engines/agi/agi.h
+++ b/engines/agi/agi.h
@@ -1013,6 +1013,9 @@ public:
void drawStrMiddle(int row, int attr, const char *buffer);
void clearTextArea();
void clearRow(int row);
+
+ // Saved Games
+ Common::SaveFileManager* getSaveFileMan() { return _saveFileMan; }
};
} // End of namespace Agi
diff --git a/engines/agi/preagi_mickey.cpp b/engines/agi/preagi_mickey.cpp
index 275ee06e25..b5d0471c7f 100644
--- a/engines/agi/preagi_mickey.cpp
+++ b/engines/agi/preagi_mickey.cpp
@@ -25,6 +25,7 @@
#include "common/stdafx.h"
#include "common/events.h"
+#include "common/savefile.h"
#include "agi/preagi_mickey.h"
#include "agi/graphics.h"
@@ -824,7 +825,7 @@ void Mickey::printRoomDesc() {
}
bool Mickey::loadGame() {
- Common::File infile;
+ Common::InSaveFile *infile;
char szFile[256] = {0};
bool diskerror = true;
int sel;
@@ -836,14 +837,14 @@ bool Mickey::loadGame() {
// load game
sprintf(szFile, "%s.s%2d", _vm->getTargetName().c_str(), sel);
- if (!infile.open(szFile)) {
+ if (!(infile = _vm->getSaveFileMan()->openForLoading(szFile))) {
printExeStr(IDO_MSA_CHECK_DISK_DRIVE);
if (!_vm->waitAnyKeyChoice())
return false;
} else {
- infile.read(&game, sizeof(MSA_GAME));
+ infile->read(&game, sizeof(MSA_GAME));
diskerror = false;
- infile.close();
+ delete infile;
}
}
@@ -852,7 +853,7 @@ bool Mickey::loadGame() {
}
void Mickey::saveGame() {
- Common::File outfile;
+ Common::OutSaveFile* outfile;
char szFile[256] = {0};
bool diskerror = true;
int sel;
@@ -882,14 +883,14 @@ void Mickey::saveGame() {
// save game
sprintf(szFile, "%s.s%2d", _vm->getTargetName().c_str(), sel);
- if (!outfile.open(szFile)) {
+ if (!(outfile = _vm->getSaveFileMan()->openForSaving(szFile))) {
printExeStr(IDO_MSA_CHECK_DISK_DRIVE);
if (!_vm->waitAnyKeyChoice())
return;
} else {
- outfile.write(&game, sizeof(MSA_GAME));
+ outfile->write(&game, sizeof(MSA_GAME));
diskerror = false;
- outfile.close();
+ delete outfile;
}
}