Mercurial > hg > openttd
changeset 15337:c37904846c25 draft
(svn r19978) -Add: Read settings during SL_LOAD_CHECK.
author | frosch <frosch@openttd.org> |
---|---|
date | Sun, 13 Jun 2010 14:14:37 +0000 |
parents | 3e790f032a7c |
children | 436c58296c2d |
files | src/fios.h src/fios_gui.cpp src/settings.cpp |
diffstat | 3 files changed, 12 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/src/fios.h +++ b/src/fios.h @@ -17,6 +17,7 @@ #include "core/enum_type.hpp" #include "gfx_type.h" #include "date_type.h" +#include "settings_type.h" /** @@ -30,6 +31,8 @@ uint32 map_size_x, map_size_y; Date current_date; + GameSettings settings; + LoadCheckData() : error_data(NULL) { this->Clear();
--- a/src/fios_gui.cpp +++ b/src/fios_gui.cpp @@ -47,6 +47,7 @@ this->map_size_x = this->map_size_y = 256; // Default for old savegames which do not store mapsize. this->current_date = 0; + memset(&this->settings, 0, sizeof(this->settings)); }
--- a/src/settings.cpp +++ b/src/settings.cpp @@ -65,6 +65,7 @@ #include "engine_base.h" #include "smallmap_gui.h" #include "roadveh.h" +#include "fios.h" #include "void_map.h" #include "station_base.h" @@ -1967,6 +1968,11 @@ LoadSettings(_settings, &_settings_game); } +static void Check_PATS() +{ + LoadSettings(_settings, &_load_check_data.settings); +} + static void Save_PATS() { SaveSettings(_settings, &_settings_game); @@ -1985,8 +1991,8 @@ } extern const ChunkHandler _setting_chunk_handlers[] = { - { 'OPTS', NULL, Load_OPTS, NULL, NULL, CH_RIFF}, - { 'PATS', Save_PATS, Load_PATS, NULL, NULL, CH_RIFF | CH_LAST}, + { 'OPTS', NULL, Load_OPTS, NULL, NULL, CH_RIFF}, + { 'PATS', Save_PATS, Load_PATS, NULL, Check_PATS, CH_RIFF | CH_LAST}, }; static bool IsSignedVarMemType(VarType vt)