(svn r27638) -Codechange: Move FiosType enum, move and rename SetFiosType function.

This commit is contained in:
alberth
2016-09-04 12:47:07 +00:00
parent b5eb50da7b
commit e78627f2f1
7 changed files with 54 additions and 48 deletions

View File

@@ -2892,6 +2892,39 @@ void GenerateDefaultSaveName(char *buf, const char *last)
SanitizeFilename(buf);
}
/**
* Set the mode of the file to save or load based on the type of file entry at the file system.
* @param ft Type of file entry of the file system.
*/
void FileToSaveLoad::SetMode(FiosType ft)
{
switch (ft) {
case FIOS_TYPE_FILE:
case FIOS_TYPE_SCENARIO:
this->mode = SL_LOAD;
break;
case FIOS_TYPE_OLDFILE:
case FIOS_TYPE_OLD_SCENARIO:
this->mode = SL_OLD_LOAD;
break;
#ifdef WITH_PNG
case FIOS_TYPE_PNG:
this->mode = SL_PNG;
break;
#endif /* WITH_PNG */
case FIOS_TYPE_BMP:
this->mode = SL_BMP;
break;
default:
this->mode = SL_INVALID;
break;
}
}
#if 0
/**
* Function to get the type of the savegame by looking at the file header.