[Scummvm-cvs-logs] CVS: scummvm/sword1 control.cpp,1.50,1.51
Max Horn
fingolfin at users.sourceforge.net
Sun Apr 10 08:14:16 CEST 2005
Update of /cvsroot/scummvm/scummvm/sword1
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2778/sword1
Modified Files:
control.cpp
Log Message:
split SaveFileManager::openSavefile and class SaveFile into two, each, one for loading and one for saving
Index: control.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sword1/control.cpp,v
retrieving revision 1.50
retrieving revision 1.51
diff -u -d -r1.50 -r1.51
--- control.cpp 9 Apr 2005 01:52:43 -0000 1.50
+++ control.cpp 10 Apr 2005 15:13:40 -0000 1.51
@@ -669,11 +669,11 @@
}
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 @@
}
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 @@
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 @@
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 @@
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;
More information about the Scummvm-git-logs
mailing list