(svn r1884) Change palette detection algorithm: Use the DOS palette if there are no Windows .grfs but at least one DOS .grf
authortron
Fri, 18 Feb 2005 08:29:17 +0000
changeset 1380 72aa0a5df4db
parent 1379 496ceb83c845
child 1381 6cfd0991443d
(svn r1884) Change palette detection algorithm: Use the DOS palette if there are no Windows .grfs but at least one DOS .grf
spritecache.c
--- a/spritecache.c	Thu Feb 17 17:38:17 2005 +0000
+++ b/spritecache.c	Fri Feb 18 08:29:17 2005 +0000
@@ -834,11 +834,17 @@
 	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;
 	}
 }