aboutsummaryrefslogtreecommitdiff
path: root/sword1
diff options
context:
space:
mode:
authorMax Horn2005-04-10 15:13:40 +0000
committerMax Horn2005-04-10 15:13:40 +0000
commite79c168d35d9c3633e3dfb618bd05466b0efc307 (patch)
treefe4fa01fd852546eaa3229f62069109d98eb8a67 /sword1
parente03861fdd4ca4cb676788c4ae4ea19647107fd6b (diff)
downloadscummvm-rg350-e79c168d35d9c3633e3dfb618bd05466b0efc307.tar.gz
scummvm-rg350-e79c168d35d9c3633e3dfb618bd05466b0efc307.tar.bz2
scummvm-rg350-e79c168d35d9c3633e3dfb618bd05466b0efc307.zip
split SaveFileManager::openSavefile and class SaveFile into two, each, one for loading and one for saving
svn-id: r17517
Diffstat (limited to 'sword1')
-rw-r--r--sword1/control.cpp28
1 files changed, 14 insertions, 14 deletions
diff --git a/sword1/control.cpp b/sword1/control.cpp
index d8d95a0571..d1bbc9c32a 100644
--- a/sword1/control.cpp
+++ b/sword1/control.cpp
@@ -669,11 +669,11 @@ bool Control::restoreFromFile(void) {
}
void Control::readSavegameDescriptions(void) {
- SaveFile *inf;
- inf = _saveFileMan->openSavefile("SAVEGAME.INF", SAVEFILE_READ);
+ InSaveFile *inf;
+ inf = _saveFileMan->openForLoading("SAVEGAME.INF");
_saveScrollPos = _saveFiles = 0;
_selectedSavegame = 255;
- if (inf && inf->isOpen()) {
+ if (inf) {
uint8 curFileNum = 0;
uint8 ch;
do {
@@ -712,8 +712,8 @@ int Control::displayMessage(const char *altButton, const char *message, ...) {
}
void Control::writeSavegameDescriptions(void) {
- SaveFile *outf;
- outf = _saveFileMan->openSavefile("SAVEGAME.INF", SAVEFILE_WRITE);
+ OutSaveFile *outf;
+ outf = _saveFileMan->openForSaving("SAVEGAME.INF");
if (!outf) {
// Display an error message, and do nothing
@@ -737,9 +737,9 @@ void Control::writeSavegameDescriptions(void) {
bool Control::savegamesExist(void) {
bool retVal = false;
- SaveFile *inf;
- inf = _saveFileMan->openSavefile("SAVEGAME.INF", SAVEFILE_READ);
- if (inf && inf->isOpen())
+ InSaveFile *inf;
+ inf = _saveFileMan->openForLoading("SAVEGAME.INF");
+ if (inf)
retVal = true;
delete inf;
return retVal;
@@ -894,9 +894,9 @@ void Control::saveGameToFile(uint8 slot) {
uint16 cnt;
sprintf(fName, "SAVEGAME.%03d", slot);
uint16 liveBuf[TOTAL_SECTIONS];
- SaveFile *outf;
- outf = _saveFileMan->openSavefile(fName, SAVEFILE_WRITE);
- if (!outf || !outf->isOpen()) {
+ OutSaveFile *outf;
+ outf = _saveFileMan->openForSaving(fName);
+ if (!outf) {
// Display an error message, and do nothing
displayMessage(0, "Unable to create file '%s' in directory '%s'", fName, _saveFileMan->getSavePath());
return;
@@ -927,9 +927,9 @@ bool Control::restoreGameFromFile(uint8 slot) {
char fName[15];
uint16 cnt;
sprintf(fName, "SAVEGAME.%03d", slot);
- SaveFile *inf;
- inf = _saveFileMan->openSavefile(fName, SAVEFILE_READ);
- if (!inf || !inf->isOpen()) {
+ InSaveFile *inf;
+ inf = _saveFileMan->openForLoading(fName);
+ if (!inf) {
// Display an error message, and do nothing
displayMessage(0, "Can't open file '%s' in directory '%s'", fName, _saveFileMan->getSavePath());
return false;