From 1277599c303585c48de391e5098246e66b542029 Mon Sep 17 00:00:00 2001 From: Darkvater Date: Sun, 7 Jan 2007 12:11:54 +0000 Subject: [PATCH] (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 | 14 ++++++++++++++ newgrf.c | 7 +++++-- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/gfxinit.c b/gfxinit.c index 1ac0a30d6b..fc3d28008d 100644 --- a/gfxinit.c +++ b/gfxinit.c @@ -121,6 +121,20 @@ static bool FileMD5(const MD5File file, bool warn) } #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]; diff --git a/newgrf.c b/newgrf.c index b0915c16ec..63071e207c 100644 --- a/newgrf.c +++ b/newgrf.c @@ -3793,8 +3793,11 @@ void LoadNewGRF(uint load_index, uint file_index) 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); + } } }