summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2010-08-02 15:29:31 +0000
committerrubidium <rubidium@openttd.org>2010-08-02 15:29:31 +0000
commitdfb0a2c9a5a91e7c100fc383096f8c633710c687 (patch)
treed5fe778f61ac264dd828dd02959b7c56a83769c4 /src
parentcded122da519b72a00c0432a7129a5a9f8ee97e7 (diff)
downloadopenttd-dfb0a2c9a5a91e7c100fc383096f8c633710c687.tar.xz
(svn r20305) -Change: reduce OpenTTD's install size by roughly 460 KiB by only providing the "extra" base graphics in one palette and doing the conversion upon loading; the conversion has existed for a while, but now the NewGRF can tell its palette using Action 14 thus it can enable the conversion for only that NewGRF.
Diffstat (limited to 'src')
-rw-r--r--src/gfxinit.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/gfxinit.cpp b/src/gfxinit.cpp
index 42aca582f..269ee8ade 100644
--- a/src/gfxinit.cpp
+++ b/src/gfxinit.cpp
@@ -179,8 +179,15 @@ static void LoadSpriteTables()
*/
GRFConfig *top = _grfconfig;
GRFConfig *master = new GRFConfig(used_set->files[GFT_EXTRA].filename);
+
+ /* We know the palette of the base set, so if the base NewGRF is not
+ * setting one, use the palette of the base set and not the global
+ * one which might be the wrong palette for this base NewGRF. */
+ PaletteType old_palette_type = _use_palette;
+ _use_palette = used_set->palette;
FillGRFDetails(master, false);
- master->palette = (used_set->palette == PAL_WINDOWS) ? GRFP_USE_WINDOWS : GRFP_USE_DOS;
+ _use_palette = old_palette_type;
+
ClrBit(master->flags, GCF_INIT_ONLY);
master->next = top;
_grfconfig = master;