(svn r19978) -Add: Read settings during SL_LOAD_CHECK.

This commit is contained in:
frosch 2010-06-13 14:14:37 +00:00
parent 86244ad31e
commit 0270ca846e
3 changed files with 12 additions and 2 deletions

View File

@ -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 @@ struct LoadCheckData {
uint32 map_size_x, map_size_y;
Date current_date;
GameSettings settings;
LoadCheckData() : error_data(NULL)
{
this->Clear();

View File

@ -47,6 +47,7 @@ void LoadCheckData::Clear()
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));
}

View File

@ -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 @@ static void Load_PATS()
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 @@ void CheckConfig()
}
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)