(svn r7950) -Backport from trunk (r7760, r7766): 0.5
authorDarkvater
Sun, 07 Jan 2007 12:11:54 +0000
branch0.5
changeset 5393 55e249a41db4
parent 5392 e5a79cd6bcf4
child 5394 58afc8e5ff3e
(svn r7950) -Backport from trunk (r7760, r7766):
- Sprite usage debug message showed the starting sprite, not current sprite, and only do this during activation (r7760).
- [OSX] Remove incorrect debug message about missing grf files.
gfxinit.c
newgrf.c
--- a/gfxinit.c	Sun Jan 07 12:07:07 2007 +0000
+++ b/gfxinit.c	Sun Jan 07 12:11:54 2007 +0000
@@ -121,6 +121,20 @@
 	}
 #endif
 
+#if defined SECOND_DATA_DIR
+	/* If we failed to find the file in the first data directory, we will try the other one */
+
+	if (f == NULL) {
+		snprintf(buf, lengthof(buf), "%s%s", _paths.second_data_dir, file.filename);
+		f = fopen(buf, "rb");
+
+		if (f == NULL) {
+			strtolower(buf + strlen(_paths.second_data_dir) - 1);
+			f = fopen(buf, "rb");
+		}
+	}
+#endif
+
 	if (f != NULL) {
 		md5_state_t filemd5state;
 		md5_byte_t buffer[1024];
--- a/newgrf.c	Sun Jan 07 12:07:07 2007 +0000
+++ b/newgrf.c	Sun Jan 07 12:11:54 2007 +0000
@@ -3793,8 +3793,11 @@
 
 			if (stage == GLS_LABELSCAN) InitNewGRFFile(c, _cur_spriteid);
 			LoadNewGRFFile(c, slot++, stage);
-			if (stage == GLS_ACTIVATION) ClearTemporaryNewGRFData();
-			DEBUG(spritecache, 2) ("Currently %i sprites are loaded", load_index);
+
+			if (stage == GLS_ACTIVATION) {
+				ClearTemporaryNewGRFData();
+				DEBUG(spritecache, 2) ("Currently %i sprites are loaded", _cur_spriteid);
+			}
 		}
 	}