Changeset - r22432:5e48cf19b6e3
[Not reviewed]
master
0 2 0
alberth - 8 years ago 2016-09-04 12:47:39
alberth@openttd.org
(svn r27639) -Codechange: Also always set the abstract FileToSaveLoad::filetype when setting a mode.
2 files changed with 28 insertions and 1 deletions:
0 comments (0 inline, 0 general)
src/fileio_type.h
Show inline comments
 
@@ -20,6 +20,8 @@ enum AbstractFileType {
 
	FT_SAVEGAME,  ///< old or new savegame
 
	FT_SCENARIO,  ///< old or new scenario
 
	FT_HEIGHTMAP, ///< heightmap file
 

	
 
	FT_INVALID = 7, ///< Invalid or unknown file type.
 
};
 

	
 
/** Elements of a file system that are recognized. */
src/saveload/saveload.cpp
Show inline comments
 
@@ -2893,7 +2893,7 @@ void GenerateDefaultSaveName(char *buf, 
 
}
 

	
 
/**
 
 * Set the mode of the file to save or load based on the type of file entry at the file system.
 
 * Set the mode and file type 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)
 
@@ -2923,6 +2923,31 @@ void FileToSaveLoad::SetMode(FiosType ft
 
			this->mode = SL_INVALID;
 
			break;
 
	}
 

	
 
	switch (ft) {
 
		case FIOS_TYPE_OLDFILE:
 
		case FIOS_TYPE_FILE:
 
			this->filetype = FT_SAVEGAME;
 
			break;
 

	
 
		case FIOS_TYPE_OLD_SCENARIO:
 
		case FIOS_TYPE_SCENARIO:
 
			this->filetype = FT_SCENARIO;
 
			break;
 

	
 
#ifdef WITH_PNG
 
		case FIOS_TYPE_PNG:
 
			/* FALL THROUGH */
 
#endif /* WITH_PNG */
 

	
 
		case FIOS_TYPE_BMP:
 
			this->filetype = FT_HEIGHTMAP;
 
			break;
 

	
 
		default:
 
			this->filetype = FT_INVALID;
 
			break;
 
	}
 
}
 

	
 
#if 0
0 comments (0 inline, 0 general)