SETTINGS Class Reference

#include <settings.h>

Collaboration diagram for SETTINGS:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 SETTINGS ()
 ~SETTINGS ()
void SaveSettings (CONFIGFILE &c)
void Init ()
void ParseOptionFile ()
void ParseDynamicOptions ()
bool Get (string var_name, float &out_var)
bool Get (string var_name, int &out_var)
bool Get (string var_name, string &out_var)
bool Get (string var_name, bool &out_var)
bool Set (string var_name, float in_var)
bool Set (string var_name, int in_var)
bool Set (string var_name, string in_var)
bool Set (string var_name, bool in_var)
OPTION< float > GetFloatOption (string cat, string name)
OPTION< int > GetIntOption (string cat, string name)
OPTION< bool > GetBoolOption (string cat, string name)
OPTION< string > GetStringOption (string cat, string name)
string GetSettingsDir ()
string GetHomeDir ()
string GetDataDir ()
string GetDataDir (string filename)
string GetLocaleDir ()
string GetGameVersion ()
string GetConfigFileVersion ()
string GetFullDataPath (string filename)
void SetDataDir (string new_data_dir)
void SetDefaultDataDir (string new_data_dir)
vector< string > LoadCarPartsSettings ()
void SaveCarPartsSettings (vector< string > &p_list)
string GetCarPartName (string part_path)
string GetSkinPath ()

Private Member Functions

void ParseSettings (CONFIGFILE &c)
bool FileExists (string path)
void CreateDir (string path)
void FindHomeDir ()
void GetValidVideoModes ()

Private Attributes

CONFIGFILE configfile
CONFIGFILE default_configfile
CONFIGFILE options_configfile
CONFIGFILE car_parts
VIDEOMODES valid_display_modes
vector< string > parts_list
vector< OPTION< float > > float_options
vector< OPTION< int > > int_options
vector< OPTION< bool > > bool_options
vector< OPTION< string > > string_options
string settings_path
string data_directory
string locale_directory
string settings_directory
string home_directory
string config_version
bool spew

Detailed Description

Definition at line 112 of file settings.h.


Constructor & Destructor Documentation

SETTINGS::SETTINGS  ) 
 

Definition at line 22 of file settings.cpp.

References br_find_exe, br_find_exe_dir, br_find_locale_dir, br_find_prefix, br_init, BR_INIT_ERROR_DISABLED, BR_INIT_ERROR_INVALID_MAPS, BR_INIT_ERROR_NOMEM, BR_INIT_ERROR_OPEN_MAPS, BR_INIT_ERROR_READ_MAPS, configfile, data_directory, default_configfile, FileExists(), FindHomeDir(), home_directory, Init(), CONFIGFILE::Load(), locale_directory, options_configfile, ParseSettings(), SETTINGS_DIR, settings_directory, settings_path, spew, verbose_output, and VERSION.

SETTINGS::~SETTINGS  ) 
 

Definition at line 177 of file settings.cpp.

References bool_options, car_parts, CONFIGFILE::Clear(), configfile, default_configfile, float_options, int_options, parts_list, string_options, and CONFIGFILE::Write().


Member Function Documentation

void SETTINGS::CreateDir string  path  )  [private]
 

Definition at line 803 of file settings.cpp.

Referenced by Init().

bool SETTINGS::FileExists string  path  )  [private]
 

Definition at line 862 of file settings.cpp.

Referenced by GetDataDir(), Init(), and SETTINGS().

void SETTINGS::FindHomeDir  )  [private]
 

Definition at line 813 of file settings.cpp.

References home_directory, and NULL.

Referenced by SETTINGS().

bool SETTINGS::Get string  var_name,
bool &  out_var
 

Definition at line 1132 of file settings.cpp.

References bool_options, configfile, CONFIGFILE::GetParam(), CONFIGFILE::SetParam(), and spew.

bool SETTINGS::Get string  var_name,
string &  out_var
 

Definition at line 1099 of file settings.cpp.

References configfile, CONFIGFILE::GetParam(), CONFIGFILE::SetParam(), spew, and string_options.

bool SETTINGS::Get string  var_name,
int &  out_var
 

Definition at line 1071 of file settings.cpp.

References configfile, CONFIGFILE::GetParam(), int_options, CONFIGFILE::SetParam(), and spew.

bool SETTINGS::Get string  var_name,
float &  out_var
 

Definition at line 1017 of file settings.cpp.

References configfile, float_options, CONFIGFILE::GetParam(), CONFIGFILE::SetParam(), and spew.

Referenced by Vamos_Body::Gl_Car::exterior_model(), GetSkinPath(), VAMOSWORLD::Init(), BACKDROP::Init(), InitGameData(), SOUNDMANAGER::Load(), LoadCarPartsSettings(), LoadWorld(), VGUI::Gui::ProcessAction(), ReloadDisplay(), VGUI::Toggle::ResetValue(), VGUI::TextBox::ResetValue(), VGUI::SpinningCar::ResetValue(), VGUI::Slider::ResetValue(), VGUI::MultiImage::ResetValue(), VGUI::Wheel2< wheel_t1, wheel_t2 >::ResetValue(), VGUI::Wheel< wheel_t >::ResetValue(), LOGO::run(), snap_screenshot(), UTILITY::TexLoad(), VGUI::Gui::UpdateScreenSize(), VAMOSWORLD::UpdateSettings(), OBJECTS::UpdateSettings(), MULTIPLAY::UpdateSettings(), MOUSE::UpdateSettings(), GAMESTATE::UpdateSettings(), GAMECONTROLS::UpdateSettings(), and SOUNDMANAGER::UpdateSettings().

OPTION< bool > SETTINGS::GetBoolOption string  cat,
string  name
 

Definition at line 1290 of file settings.cpp.

References bool_options.

string SETTINGS::GetCarPartName string  part_path  ) 
 

Definition at line 942 of file settings.cpp.

References GetFullDataPath(), CONFIGFILE::GetParam(), CONFIGFILE::Load(), and settings.

string SETTINGS::GetConfigFileVersion  ) 
 

string SETTINGS::GetDataDir string  filename  ) 
 

Definition at line 957 of file settings.cpp.

References data_directory, FileExists(), and settings_path.

string SETTINGS::GetDataDir  ) 
 

Definition at line 952 of file settings.cpp.

References data_directory.

Referenced by GetFullDataPath(), VGUI::Gui::Init(), TRACK::Load(), KEYMAN::Load(), VGUI::MultiImage::Load(), VGUI::SpinningCar::LoadCar(), LoadWorld(), and TRACK::Write().

OPTION< float > SETTINGS::GetFloatOption string  cat,
string  name
 

Definition at line 1260 of file settings.cpp.

References float_options.

string SETTINGS::GetFullDataPath string  filename  ) 
 

Definition at line 974 of file settings.cpp.

References GetDataDir().

Referenced by REPLAY::BuildFuncMem(), Vamos_Body::Gl_Car::engine_sound(), Vamos_Body::Gl_Car::exterior_model(), GetCarPartName(), VGUI::Gui::Init(), BACKDROP::Init(), Vamos_Body::Gl_Car::interior_model(), SOUNDMANAGER::Load(), FONT::Load(), Vamos_Body::Car::LoadPart(), Vamos_Body::Gl_Car::SetPaint(), and UTILITY::TexLoad().

string SETTINGS::GetGameVersion  )  [inline]
 

Definition at line 145 of file settings.h.

References VERSION.

string SETTINGS::GetHomeDir  ) 
 

Definition at line 979 of file settings.cpp.

References home_directory.

OPTION< int > SETTINGS::GetIntOption string  cat,
string  name
 

Definition at line 1275 of file settings.cpp.

References int_options.

string SETTINGS::GetLocaleDir  ) 
 

string SETTINGS::GetSettingsDir  ) 
 

Definition at line 984 of file settings.cpp.

References settings_path.

Referenced by FONT::FONT(), UTILITY::Init(), TIMER::Lap(), VERTEXD::len(), VERTEX::len(), KEYMAN::Load(), GAMECONTROLS::LoadCalibration(), Vamos_Body::Car::LoadCarDefinition(), LoadCarPartsSettings(), GAMECONTROLS::LoadControls(), main(), OBJECTS::OBJECTS(), REPLAY::PlayStart(), TIMER::ResetBest(), snap_screenshot(), REPLAY::Stop(), TIMER::TIMER(), UTILITY::UTILITY(), GAMECONTROLS::WriteCalibration(), and GAMECONTROLS::WriteControlFile().

string SETTINGS::GetSkinPath  ) 
 

Definition at line 1002 of file settings.cpp.

References Get().

Referenced by VGUI::Button::Button(), VGUI::Calibrate::Calibrate(), VGUI::ControlGrab::ControlGrab(), VGUI::Gui::Gui(), LOGO::run(), VGUI::Slider::Slider(), VGUI::SpinningCar::SpinningCar(), VGUI::TextBox::TextBox(), VGUI::Toggle::Toggle(), VGUI::Wheel< wheel_t >::Wheel(), and VGUI::Wheel2< wheel_t1, wheel_t2 >::Wheel2().

OPTION< string > SETTINGS::GetStringOption string  cat,
string  name
 

Definition at line 1305 of file settings.cpp.

References string_options.

void SETTINGS::GetValidVideoModes  )  [private]
 

Definition at line 753 of file settings.cpp.

References NULL.

Referenced by ParseDynamicOptions().

void SETTINGS::Init  ) 
 

Definition at line 191 of file settings.cpp.

References CreateDir(), default_configfile, FileExists(), settings_path, spew, verbose_output, and CONFIGFILE::Write().

Referenced by SETTINGS().

vector< string > SETTINGS::LoadCarPartsSettings  ) 
 

Definition at line 901 of file settings.cpp.

References car_parts, CONFIGFILE::Clear(), Get(), CONFIGFILE::GetParam(), GetSettingsDir(), CONFIGFILE::Load(), parts_list, settings, and CONFIGFILE::SuppressError().

void SETTINGS::ParseDynamicOptions  ) 
 

Definition at line 665 of file settings.cpp.

References VIDEOMODES::GetModes(), GetValidVideoModes(), int_options, and valid_display_modes.

void SETTINGS::ParseOptionFile  ) 
 

Definition at line 256 of file settings.cpp.

References CONFIGFILE::GetParam(), options_configfile, spew, and verbose_output.

void SETTINGS::ParseSettings CONFIGFILE c  )  [private]
 

Definition at line 880 of file settings.cpp.

References data_directory, and CONFIGFILE::GetParam().

Referenced by SetDefaultDataDir(), and SETTINGS().

void SETTINGS::SaveCarPartsSettings vector< string > &  p_list  ) 
 

Definition at line 926 of file settings.cpp.

References car_parts, and CONFIGFILE::ClearParam().

void SETTINGS::SaveSettings CONFIGFILE c  ) 
 

Definition at line 872 of file settings.cpp.

References config_version, data_directory, and CONFIGFILE::SetParam().

Referenced by SetDefaultDataDir().

bool SETTINGS::Set string  var_name,
bool  in_var
 

Definition at line 1238 of file settings.cpp.

References bool_options, configfile, CONFIGFILE::SetParam(), and spew.

bool SETTINGS::Set string  var_name,
string  in_var
 

Definition at line 1217 of file settings.cpp.

References configfile, CONFIGFILE::SetParam(), spew, and string_options.

bool SETTINGS::Set string  var_name,
int  in_var
 

Definition at line 1196 of file settings.cpp.

References configfile, int_options, CONFIGFILE::SetParam(), and spew.

bool SETTINGS::Set string  var_name,
float  in_var
 

Definition at line 1160 of file settings.cpp.

References configfile, float_options, CONFIGFILE::SetParam(), and spew.

Referenced by VGUI::Gui::ProcessAction(), VGUI::Toggle::Save(), VGUI::TextBox::Save(), VGUI::Slider::Save(), VGUI::Wheel2< wheel_t1, wheel_t2 >::Save(), VGUI::Wheel< wheel_t >::Save(), VAMOSWORLD::SetCameraMode(), GAMESTATE::SetCarName(), GAMESTATE::SetCarPaint(), GAMESTATE::SetGameMode(), GAMESTATE::SetTrackName(), snap_screenshot(), and GAMECONTROLS::WriteControlFile().

void SETTINGS::SetDataDir string  new_data_dir  ) 
 

Definition at line 989 of file settings.cpp.

References data_directory.

void SETTINGS::SetDefaultDataDir string  new_data_dir  ) 
 

Definition at line 994 of file settings.cpp.

References data_directory, ParseSettings(), and SaveSettings().


Member Data Documentation

vector< OPTION<bool> > SETTINGS::bool_options [private]
 

Definition at line 179 of file settings.h.

Referenced by Get(), GetBoolOption(), Set(), and ~SETTINGS().

CONFIGFILE SETTINGS::car_parts [private]
 

Definition at line 166 of file settings.h.

Referenced by LoadCarPartsSettings(), SaveCarPartsSettings(), and ~SETTINGS().

string SETTINGS::config_version [private]
 

Definition at line 188 of file settings.h.

Referenced by SaveSettings().

CONFIGFILE SETTINGS::configfile [private]
 

Definition at line 163 of file settings.h.

Referenced by Get(), Set(), SETTINGS(), and ~SETTINGS().

string SETTINGS::data_directory [private]
 

Definition at line 184 of file settings.h.

Referenced by GetDataDir(), ParseSettings(), SaveSettings(), SetDataDir(), SetDefaultDataDir(), and SETTINGS().

CONFIGFILE SETTINGS::default_configfile [private]
 

Definition at line 164 of file settings.h.

Referenced by Init(), SETTINGS(), and ~SETTINGS().

vector< OPTION<float> > SETTINGS::float_options [private]
 

Definition at line 177 of file settings.h.

Referenced by Get(), GetFloatOption(), Set(), and ~SETTINGS().

string SETTINGS::home_directory [private]
 

Definition at line 187 of file settings.h.

Referenced by FindHomeDir(), GetHomeDir(), and SETTINGS().

vector< OPTION<int> > SETTINGS::int_options [private]
 

Definition at line 178 of file settings.h.

Referenced by Get(), GetIntOption(), ParseDynamicOptions(), Set(), and ~SETTINGS().

string SETTINGS::locale_directory [private]
 

Definition at line 185 of file settings.h.

Referenced by SETTINGS().

CONFIGFILE SETTINGS::options_configfile [private]
 

Definition at line 165 of file settings.h.

Referenced by ParseOptionFile(), and SETTINGS().

vector<string> SETTINGS::parts_list [private]
 

Definition at line 170 of file settings.h.

Referenced by LoadCarPartsSettings(), and ~SETTINGS().

string SETTINGS::settings_directory [private]
 

Definition at line 186 of file settings.h.

Referenced by SETTINGS().

string SETTINGS::settings_path [private]
 

Definition at line 183 of file settings.h.

Referenced by GetDataDir(), GetSettingsDir(), Init(), and SETTINGS().

bool SETTINGS::spew [private]
 

Definition at line 190 of file settings.h.

Referenced by Get(), Init(), ParseOptionFile(), Set(), and SETTINGS().

vector< OPTION<string> > SETTINGS::string_options [private]
 

Definition at line 180 of file settings.h.

Referenced by Get(), GetStringOption(), Set(), and ~SETTINGS().

VIDEOMODES SETTINGS::valid_display_modes [private]
 

Definition at line 168 of file settings.h.

Referenced by ParseDynamicOptions().


The documentation for this class was generated from the following files:
Generated on Thu Oct 19 04:12:28 2006 by  doxygen 1.4.6