summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorrubidium42 <rubidium@openttd.org>2021-05-08 14:02:42 +0200
committerrubidium42 <rubidium42@users.noreply.github.com>2021-05-08 14:24:35 +0200
commitde940b1dbc7a1d6f245f3965bc43e8885b690441 (patch)
tree22b48f788132417b9e5502d60831fff8aa4e34f7 /src
parentfa6abe16463de8f252bac2322c9f84b6d02c9abc (diff)
downloadopenttd-de940b1dbc7a1d6f245f3965bc43e8885b690441.tar.xz
Fix fdc11a9: Missing sprite count determined on the wrong file
Diffstat (limited to 'src')
-rw-r--r--src/gfxinit.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/gfxinit.cpp b/src/gfxinit.cpp
index 063d777ed..713f6e543 100644
--- a/src/gfxinit.cpp
+++ b/src/gfxinit.cpp
@@ -195,7 +195,8 @@ static void LoadSpriteTables()
GRFConfig *top = _grfconfig;
/* Default extra graphics */
- GRFConfig *master = new GRFConfig("OPENTTD.GRF");
+ static const char *master_filename = "OPENTTD.GRF";
+ GRFConfig *master = new GRFConfig(master_filename);
master->palette |= GRFP_GRF_DOS;
FillGRFDetails(master, false, BASESET_DIR);
ClrBit(master->flags, GCF_INIT_ONLY);
@@ -222,7 +223,7 @@ static void LoadSpriteTables()
LoadNewGRF(SPR_NEWGRFS_BASE, 2);
uint total_extra_graphics = SPR_NEWGRFS_BASE - SPR_OPENTTD_BASE;
- _missing_extra_graphics = GetSpriteCountForFile(used_set->files[GFT_EXTRA].filename, SPR_OPENTTD_BASE, SPR_NEWGRFS_BASE);
+ _missing_extra_graphics = GetSpriteCountForFile(master_filename, SPR_OPENTTD_BASE, SPR_NEWGRFS_BASE);
DEBUG(sprite, 1, "%u extra sprites, %u from baseset, %u from fallback", total_extra_graphics, total_extra_graphics - _missing_extra_graphics, _missing_extra_graphics);
/* The original baseset extra graphics intentionally make use of the fallback graphics.