(svn r10038) -Fix (r8634): Sprite resulting from '?' substitution was reloaded into the cache entry for SPR_IMG_QUERY instead of the original sprite cache entry. This resulted in unaccounted missing sprite cache memory, and was exacerbated because the original missing sprite was not cached, so it did it again and again and again. Slowdowns and boom. Etc.
authorpeter1138
Mon, 04 Jun 2007 20:42:49 +0000
changeset 7295 4af0cd4cab3d
parent 7294 47874c9a52ef
child 7296 341c1174517d
(svn r10038) -Fix (r8634): Sprite resulting from '?' substitution was reloaded into the cache entry for SPR_IMG_QUERY instead of the original sprite cache entry. This resulted in unaccounted missing sprite cache memory, and was exacerbated because the original missing sprite was not cached, so it did it again and again and again. Slowdowns and boom. Etc.
src/spritecache.cpp
--- a/src/spritecache.cpp	Mon Jun 04 20:06:54 2007 +0000
+++ b/src/spritecache.cpp	Mon Jun 04 20:42:49 2007 +0000
@@ -121,6 +121,7 @@
 {
 	uint num;
 	byte type;
+	uint32 file_pos = sc->file_pos;
 
 	DEBUG(sprite, 9, "Load sprite %d", id);
 
@@ -129,10 +130,10 @@
 
 		/* SPR_IMG_QUERY is a BIG FAT RED ? */
 		id = SPR_IMG_QUERY;
-		sc = GetSpriteCache(SPR_IMG_QUERY);
+		file_pos = GetSpriteCache(SPR_IMG_QUERY)->file_pos;
 	}
 
-	FioSeekToFile(sc->file_pos);
+	FioSeekToFile(file_pos);
 
 	num  = FioReadWord();
 	type = FioReadByte();