summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortron <tron@openttd.org>2005-02-18 08:29:17 +0000
committertron <tron@openttd.org>2005-02-18 08:29:17 +0000
commit431447ef8789cf51eb954e4b45ad81642a251258 (patch)
tree7024a0738bec93d58bf62f34bd436970337eecb7
parent73c0f213633d023ff8063766338b4747f48b946d (diff)
downloadopenttd-431447ef8789cf51eb954e4b45ad81642a251258.tar.xz
(svn r1884) Change palette detection algorithm: Use the DOS palette if there are no Windows .grfs but at least one DOS .grf
-rw-r--r--spritecache.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/spritecache.c b/spritecache.c
index 0235bf186..59d17512e 100644
--- a/spritecache.c
+++ b/spritecache.c
@@ -834,11 +834,17 @@ void CheckExternalFiles(void)
if (!FileMD5(sample_cat_win, false) && !FileMD5(sample_cat_dos, false))
printf("Your sample.cat file is corrupted or missing!");
- if (win == 5) { // always use the Windows palette if all Windows files are present
+ /*
+ * all Windows files present -> Windows palette
+ * all DOS files present -> DOS palette
+ * no Windows files present and any DOS file present -> DOS palette
+ * otherwise -> Windows palette
+ */
+ if (win == 5) {
_use_dos_palette = false;
- } else if (dos == 5) { // else use the DOS palette if all DOS files are present
+ } else if (dos == 5 || (win == 0 && dos > 0) {
_use_dos_palette = true;
- } else { // some files are missing, regardless of palette. Use Windows
+ } else {
_use_dos_palette = false;
}
}