settings_func.h

Go to the documentation of this file.
00001 /* $Id$ */
00002 
00003 /*
00004  * This file is part of OpenTTD.
00005  * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
00006  * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
00007  * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
00008  */
00009 
00012 #ifndef SETTINGS_FUNC_H
00013 #define SETTINGS_FUNC_H
00014 
00015 #include "core/smallvec_type.hpp"
00016 #include "company_type.h"
00017 
00018 struct IniFile;
00019 
00020 void IConsoleSetSetting(const char *name, const char *value, bool force_newgame = false);
00021 void IConsoleSetSetting(const char *name, int32 value);
00022 void IConsoleGetSetting(const char *name, bool force_newgame = false);
00023 void IConsoleListSettings(const char *prefilter);
00024 
00025 void LoadFromConfig(bool minimal = false);
00026 void SaveToConfig();
00027 void CheckConfig();
00028 
00029 void IniLoadWindowSettings(IniFile *ini, const char *grpname, void *desc);
00030 void IniSaveWindowSettings(IniFile *ini, const char *grpname, void *desc);
00031 
00032 /* Functions to load and save NewGRF settings to a separate
00033  * configuration file, used for presets. */
00034 typedef AutoFreeSmallVector<char *, 4> GRFPresetList;
00035 
00036 void GetGRFPresetList(GRFPresetList *list);
00037 struct GRFConfig *LoadGRFPresetFromConfig(const char *config_name);
00038 void SaveGRFPresetToConfig(const char *config_name, struct GRFConfig *config);
00039 void DeleteGRFPresetFromConfig(const char *config_name);
00040 
00041 uint GetCompanySettingIndex(const char *name);
00042 void SetDefaultCompanySettings(CompanyID cid);
00043 
00044 #if defined(ENABLE_NETWORK)
00045 void SyncCompanySettings();
00046 #else /* ENABLE_NETWORK */
00047 static inline void SyncCompanySettings() {}
00048 #endif /* ENABLE_NETWORK */
00049 
00050 #endif /* SETTINGS_FUNC_H */