mirror of https://github.com/OpenTTD/OpenTTD
(svn r19978) -Add: Read settings during SL_LOAD_CHECK.
parent
86244ad31e
commit
0270ca846e
|
@ -17,6 +17,7 @@
|
||||||
#include "core/enum_type.hpp"
|
#include "core/enum_type.hpp"
|
||||||
#include "gfx_type.h"
|
#include "gfx_type.h"
|
||||||
#include "date_type.h"
|
#include "date_type.h"
|
||||||
|
#include "settings_type.h"
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -30,6 +31,8 @@ struct LoadCheckData {
|
||||||
uint32 map_size_x, map_size_y;
|
uint32 map_size_x, map_size_y;
|
||||||
Date current_date;
|
Date current_date;
|
||||||
|
|
||||||
|
GameSettings settings;
|
||||||
|
|
||||||
LoadCheckData() : error_data(NULL)
|
LoadCheckData() : error_data(NULL)
|
||||||
{
|
{
|
||||||
this->Clear();
|
this->Clear();
|
||||||
|
|
|
@ -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->map_size_x = this->map_size_y = 256; // Default for old savegames which do not store mapsize.
|
||||||
this->current_date = 0;
|
this->current_date = 0;
|
||||||
|
memset(&this->settings, 0, sizeof(this->settings));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -65,6 +65,7 @@
|
||||||
#include "engine_base.h"
|
#include "engine_base.h"
|
||||||
#include "smallmap_gui.h"
|
#include "smallmap_gui.h"
|
||||||
#include "roadveh.h"
|
#include "roadveh.h"
|
||||||
|
#include "fios.h"
|
||||||
|
|
||||||
#include "void_map.h"
|
#include "void_map.h"
|
||||||
#include "station_base.h"
|
#include "station_base.h"
|
||||||
|
@ -1967,6 +1968,11 @@ static void Load_PATS()
|
||||||
LoadSettings(_settings, &_settings_game);
|
LoadSettings(_settings, &_settings_game);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void Check_PATS()
|
||||||
|
{
|
||||||
|
LoadSettings(_settings, &_load_check_data.settings);
|
||||||
|
}
|
||||||
|
|
||||||
static void Save_PATS()
|
static void Save_PATS()
|
||||||
{
|
{
|
||||||
SaveSettings(_settings, &_settings_game);
|
SaveSettings(_settings, &_settings_game);
|
||||||
|
@ -1985,8 +1991,8 @@ void CheckConfig()
|
||||||
}
|
}
|
||||||
|
|
||||||
extern const ChunkHandler _setting_chunk_handlers[] = {
|
extern const ChunkHandler _setting_chunk_handlers[] = {
|
||||||
{ 'OPTS', NULL, Load_OPTS, NULL, NULL, CH_RIFF},
|
{ 'OPTS', NULL, Load_OPTS, NULL, NULL, CH_RIFF},
|
||||||
{ 'PATS', Save_PATS, Load_PATS, NULL, NULL, CH_RIFF | CH_LAST},
|
{ 'PATS', Save_PATS, Load_PATS, NULL, Check_PATS, CH_RIFF | CH_LAST},
|
||||||
};
|
};
|
||||||
|
|
||||||
static bool IsSignedVarMemType(VarType vt)
|
static bool IsSignedVarMemType(VarType vt)
|
||||||
|
|
Loading…
Reference in New Issue