Merge branch 'master' into jgrpp

# Conflicts:
#	src/bridge_map.h
#	src/crashlog.cpp
#	src/industry.h
#	src/linkgraph/linkgraph_type.h
#	src/order_type.h
#	src/saveload/afterload.cpp
#	src/settings.cpp
#	src/settings_type.h
#	src/smallmap_gui.cpp
#	src/spritecache.cpp
#	src/stdafx.h
#	src/table/settings.h.preamble
#	src/train.h
#	src/vehicle.cpp
#	src/viewport.cpp
#	src/viewport_func.h
#	src/widgets/station_widget.h
#	src/zoom_func.h
#	src/zoom_type.h
This commit is contained in:
Jonathan G Rennison
2019-07-08 16:19:07 +01:00
136 changed files with 706 additions and 501 deletions

View File

@@ -3169,36 +3169,3 @@ void FileToSaveLoad::SetTitle(const char *title)
{
strecpy(this->title, title, lastof(this->title));
}
#if 0
/**
* Function to get the type of the savegame by looking at the file header.
* NOTICE: Not used right now, but could be used if extensions of savegames are garbled
* @param file Savegame to be checked
* @return SL_OLD_LOAD or SL_LOAD of the file
*/
int GetSavegameType(char *file)
{
const SaveLoadFormat *fmt;
uint32 hdr;
FILE *f;
int mode = SL_OLD_LOAD;
f = fopen(file, "rb");
if (fread(&hdr, sizeof(hdr), 1, f) != 1) {
DEBUG(sl, 0, "Savegame is obsolete or invalid format");
mode = SL_LOAD; // don't try to get filename, just show name as it is written
} else {
/* see if we have any loader for this type. */
for (fmt = _saveload_formats; fmt != endof(_saveload_formats); fmt++) {
if (fmt->tag == hdr) {
mode = SL_LOAD; // new type of savegame
break;
}
}
}
fclose(f);
return mode;
}
#endif