Mercurial > hg > openttd
changeset 14629:b314a1ba4eab draft
(svn r19206) -Add: concept of fallback base sets, i.e. do not automatically load the NoMusic/NoSound sets when there is another set
author | rubidium <rubidium@openttd.org> |
---|---|
date | Mon, 22 Feb 2010 16:24:23 +0000 (2010-02-22) |
parents | 24e8054e9cda |
children | f72341b623a3 |
files | bin/gm/no_music.obm src/base_media_base.h src/base_media_func.h src/gfxinit.cpp src/music.cpp src/sound.cpp |
diffstat | 6 files changed, 8 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/bin/gm/no_music.obm +++ b/bin/gm/no_music.obm @@ -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.
--- a/src/base_media_base.h +++ b/src/base_media_base.h @@ -59,6 +59,7 @@ 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
--- a/src/base_media_func.h +++ b/src/base_media_func.h @@ -58,6 +58,9 @@ 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");
--- a/src/gfxinit.cpp +++ b/src/gfxinit.cpp @@ -296,6 +296,7 @@ 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) ||
--- a/src/music.cpp +++ b/src/music.cpp @@ -45,6 +45,7 @@ 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))) {
--- a/src/sound.cpp +++ b/src/sound.cpp @@ -301,6 +301,7 @@ 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))) {