Changeset - r14619:fff04644c054
[Not reviewed]
master
0 6 0
rubidium - 14 years ago 2010-02-22 16:24:23
rubidium@openttd.org
(svn r19206) -Add: concept of fallback base sets, i.e. do not automatically load the NoMusic/NoSound sets when there is another set
6 files changed with 8 insertions and 0 deletions:
0 comments (0 inline, 0 general)
bin/gm/no_music.obm
Show inline comments
 
@@ -6,6 +6,7 @@
 
name              = NoMusic
 
shortname         = NOMU
 
version           = 0
 
fallback          = true
 
description       = A music pack without actual music.
 
description.cs_CZ = Prázná hudební sada.
 
description.de_DE = Ein Musikset ohne Musik.
src/base_media_base.h
Show inline comments
 
@@ -59,6 +59,7 @@ struct BaseSet {
 
	TranslatedStrings description; ///< Description of the base set
 
	uint32 shortname;              ///< Four letter short variant of the name
 
	uint32 version;                ///< The version of this base set
 
	bool fallback;                 ///< This set is a fallback set, i.e. it should be used only as last resort
 

	
 
	MD5File files[NUM_FILES];      ///< All files part of this set
 
	uint found_files;              ///< Number of the files that could be found
src/base_media_func.h
Show inline comments
 
@@ -58,6 +58,9 @@ bool BaseSet<T, Tnum_files, Tsubdir>::Fi
 
	fetch_metadata("version");
 
	this->version = atoi(item->value);
 

	
 
	item = metadata->GetItem("fallback", false);
 
	this->fallback = (item != NULL && strcmp(item->value, "0") != 0 && strcmp(item->value, "false") != 0);
 

	
 
	/* For each of the file types we want to find the file, MD5 checksums and warning messages. */
 
	IniGroup *files  = ini->GetGroup("files");
 
	IniGroup *md5s   = ini->GetGroup("md5s");
src/gfxinit.cpp
Show inline comments
 
@@ -296,6 +296,7 @@ template <class Tbase_set>
 
		if (c->GetNumMissing() != 0) continue;
 

	
 
		if (best == NULL ||
 
				(best->fallback && !c->fallback) ||
 
				best->valid_files < c->valid_files ||
 
				(best->valid_files == c->valid_files && (
 
					(best->shortname == c->shortname && best->version < c->version) ||
src/music.cpp
Show inline comments
 
@@ -45,6 +45,7 @@ template <class Tbase_set>
 
		if (c->GetNumMissing() != 0) continue;
 

	
 
		if (best == NULL ||
 
				(best->fallback && !c->fallback) ||
 
				best->valid_files < c->valid_files ||
 
				(best->valid_files == c->valid_files &&
 
					(best->shortname == c->shortname && best->version < c->version))) {
src/sound.cpp
Show inline comments
 
@@ -301,6 +301,7 @@ template <class Tbase_set>
 
		if (c->GetNumMissing() != 0) continue;
 

	
 
		if (best == NULL ||
 
				(best->fallback && !c->fallback) ||
 
				best->valid_files < c->valid_files ||
 
				(best->valid_files == c->valid_files &&
 
					(best->shortname == c->shortname && best->version < c->version))) {
0 comments (0 inline, 0 general)