summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpeter1138 <peter1138@openttd.org>2006-11-24 12:39:13 +0000
committerpeter1138 <peter1138@openttd.org>2006-11-24 12:39:13 +0000
commitb13a6f0a9c7b65298fb0339485e43a96c68b53c9 (patch)
treecd8c2ed9e10b4abd82365cb43cd82acca28f287a
parent1ce4eda5761f37445e676c92ee3f0affbf4e8e79 (diff)
downloadopenttd-b13a6f0a9c7b65298fb0339485e43a96c68b53c9.tar.xz
(svn r7246) -Codechange: Always reload sprite and NewGRF data when loading or starting a game, instead of only when the climate type is different.
-rw-r--r--gfxinit.c22
1 files changed, 8 insertions, 14 deletions
diff --git a/gfxinit.c b/gfxinit.c
index d1c3c60b3..5b88eaf3f 100644
--- a/gfxinit.c
+++ b/gfxinit.c
@@ -321,7 +321,6 @@ static const SpriteID _openttd_grf_indexes[] = {
END
};
-static byte _sprite_page_to_load = 0xFF;
static void LoadSpriteTables(void)
{
@@ -339,10 +338,11 @@ static void LoadSpriteTables(void)
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 @@ static void LoadSpriteTables(void)
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();
}