diff options
author | smatz <smatz@openttd.org> | 2009-01-04 15:32:25 +0000 |
---|---|---|
committer | smatz <smatz@openttd.org> | 2009-01-04 15:32:25 +0000 |
commit | 7368c740a646c958797b5dff90d6c5b51236e2a4 (patch) | |
tree | 56e0ff1f4048e467cf123e92ca788c3c4bbc0f94 /src/newgrf_config.cpp | |
parent | c9e8fd307e36b3d35f5bf7d01cffe64b1e75b846 (diff) | |
download | openttd-7368c740a646c958797b5dff90d6c5b51236e2a4.tar.xz |
(svn r14828) -Codechange: move most of save/load-specific code to separate files
Diffstat (limited to 'src/newgrf_config.cpp')
-rw-r--r-- | src/newgrf_config.cpp | 46 |
1 files changed, 0 insertions, 46 deletions
diff --git a/src/newgrf_config.cpp b/src/newgrf_config.cpp index 389aeb408..b579e5e98 100644 --- a/src/newgrf_config.cpp +++ b/src/newgrf_config.cpp @@ -6,7 +6,6 @@ #include "openttd.h" #include "debug.h" #include "variables.h" -#include "saveload.h" #include "md5.h" #include "newgrf.h" #include "newgrf_config.h" @@ -495,48 +494,3 @@ bool GRFConfig::IsOpenTTDBaseGRF() const { return (this->grfid & 0x00FFFFFF) == OPENTTD_GRAPHICS_BASE_GRF_ID; } - - -static const SaveLoad _grfconfig_desc[] = { - SLE_STR(GRFConfig, filename, SLE_STR, 0x40), - SLE_VAR(GRFConfig, grfid, SLE_UINT32), - SLE_ARR(GRFConfig, md5sum, SLE_UINT8, 16), - SLE_ARR(GRFConfig, param, SLE_UINT32, 0x80), - SLE_VAR(GRFConfig, num_params, SLE_UINT8), - SLE_CONDVAR(GRFConfig, windows_paletted, SLE_BOOL, 101, SL_MAX_VERSION), - SLE_END() -}; - - -static void Save_NGRF() -{ - int index = 0; - - for (GRFConfig *c = _grfconfig; c != NULL; c = c->next) { - if (HasBit(c->flags, GCF_STATIC)) continue; - SlSetArrayIndex(index++); - SlObject(c, _grfconfig_desc); - } -} - - -static void Load_NGRF() -{ - ClearGRFConfigList(&_grfconfig); - while (SlIterateArray() != -1) { - GRFConfig *c = CallocT<GRFConfig>(1); - SlObject(c, _grfconfig_desc); - if (CheckSavegameVersion(101)) c->windows_paletted = (_use_palette == PAL_WINDOWS); - AppendToGRFConfigList(&_grfconfig, c); - } - - /* Append static NewGRF configuration */ - AppendStaticGRFConfigs(&_grfconfig); -} - -extern const ChunkHandler _newgrf_chunk_handlers[] = { - { 'NGRF', Save_NGRF, Load_NGRF, CH_ARRAY | CH_LAST } -}; - - - |