diff options
author | rubidium <rubidium@openttd.org> | 2008-09-03 07:51:07 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2008-09-03 07:51:07 +0000 |
commit | a4cd12274ca31df58c63b5532bbbb22e155b6a76 (patch) | |
tree | 182c569b77749f62a11b272d146ebd2639ad0c24 /src/newgrf.cpp | |
parent | c620d5e5f066e62cf23197d16e40a07c41e2d9f8 (diff) | |
download | openttd-a4cd12274ca31df58c63b5532bbbb22e155b6a76.tar.xz |
(svn r14233) -Feature/Fix [FS#2172]: save the palette of the loaded NewGRFs in the savegame, so joining with a server using Windows palette will make a client with the DOS palette do palette conversion and (thus) not cause a desync due to the different palettes disabling different NewGRFs.
Diffstat (limited to 'src/newgrf.cpp')
-rw-r--r-- | src/newgrf.cpp | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/newgrf.cpp b/src/newgrf.cpp index 842993598..18c95bbd1 100644 --- a/src/newgrf.cpp +++ b/src/newgrf.cpp @@ -3644,11 +3644,7 @@ bool GetGlobalVariable(byte param, uint32 *value) } case 0x0D: // TTD Version, 00=DOS, 01=Windows - if (_palette_remap_grf[_file_index]) { - *value = !_use_palette; - } else { - *value = _use_palette; - } + *value = _cur_grfconfig->windows_paletted; return true; case 0x0E: // Y-offset for train sprites @@ -4100,7 +4096,7 @@ static void GRFInfo(byte *buf, size_t len) _cur_grfconfig->status = _cur_stage < GLS_RESERVE ? GCS_INITIALISED : GCS_ACTIVATED; /* Do swap the GRFID for displaying purposes since people expect that */ - DEBUG(grf, 1, "GRFInfo: Loaded GRFv%d set %08lX - %s", version, BSWAP32(grfid), name); + DEBUG(grf, 1, "GRFInfo: Loaded GRFv%d set %08lX - %s (palette: %s)", version, BSWAP32(grfid), name, _cur_grfconfig->windows_paletted ? "Windows" : "DOS"); } /* Action 0x0A */ @@ -5894,6 +5890,7 @@ void LoadNewGRFFile(GRFConfig *config, uint file_index, GrfLoadingStage stage) FioOpenFile(file_index, filename); _file_index = file_index; // XXX + _palette_remap_grf[_file_index] = (config->windows_paletted != (_use_palette == PAL_WINDOWS)); _cur_grfconfig = config; |