(svn r7246) -Codechange: Always reload sprite and NewGRF data when loading or starting a game, instead of only when the climate type is different.
authorpeter1138
Fri, 24 Nov 2006 12:39:13 +0000
changeset 5151 0f939d1c0896
parent 5150 247343201280
child 5152 91b9ee4e54e8
(svn r7246) -Codechange: Always reload sprite and NewGRF data when loading or starting a game, instead of only when the climate type is different.
gfxinit.c
--- a/gfxinit.c	Thu Nov 23 21:19:43 2006 +0000
+++ b/gfxinit.c	Fri Nov 24 12:39:13 2006 +0000
@@ -321,7 +321,6 @@
 	END
 };
 
-static byte _sprite_page_to_load = 0xFF;
 
 static void LoadSpriteTables(void)
 {
@@ -339,10 +338,11 @@
 		load_index += LoadGrfFile(files->basic[i].filename, load_index, i);
 	}
 
-	if (_sprite_page_to_load != 0) {
+	/* Load additional sprites for climates other than temperate */
+	if (_opt.landscape != LT_NORMAL) {
 		LoadGrfIndexed(
-			files->landscape[_sprite_page_to_load - 1].filename,
-			_landscape_spriteindexes[_sprite_page_to_load - 1],
+			files->landscape[_opt.landscape - 1].filename,
+			_landscape_spriteindexes[_opt.landscape - 1],
 			i++
 		);
 	}
@@ -378,15 +378,9 @@
 
 void GfxLoadSprites(void)
 {
-	// Need to reload the sprites only if the landscape changed
-	if (_sprite_page_to_load != _opt.landscape) {
-		_sprite_page_to_load = _opt.landscape;
+	DEBUG(spritecache, 1) ("Loading sprite set %d.", _opt.landscape);
 
-		// Sprite cache
-		DEBUG(spritecache, 1) ("Loading sprite set %d.", _sprite_page_to_load);
-
-		GfxInitSpriteMem();
-		LoadSpriteTables();
-		GfxInitPalettes();
-	}
+	GfxInitSpriteMem();
+	LoadSpriteTables();
+	GfxInitPalettes();
 }