raSystem  1.0 bata
raConfigLoader.cpp
Go to the documentation of this file.
1 #include "..\include\raMain.h"
2 
3 namespace System
4 {
5  raConfig raConfigLoader::m_config;
6 
8  {
9  m_config.Hoehe = 800;
10  m_config.weite = 600;
11  m_config.FullScreen = false;
12  m_config.vsync = true;
13  m_config.MultiSamplingQualitet = 0;
14  m_config.MultiSamplingCount = 8;
15 
16  m_config.Soundkarte = 0;
17  m_config.Driver = 1;
18  m_config.Channels = 2;
19  m_config.SampleRate = 48000;
20  m_config.Bit = 16;
21 
22  std::cout << "Use std Config " << std::endl;
23  return true;
24  }
25 
27  {
28  if(!mconfig)
29  {
30  RERROR_NULLPOINTER("mconfig");
31  LoadStandardConfig();
32  return false;
33  }
34 
35  m_config.Hoehe = mconfig->GetInt("grafik", "hoehe");
36  m_config.weite = mconfig->GetInt("grafik", "weite");
37  m_config.FullScreen = mconfig->GetBool("grafik", "fullscreen");
38  m_config.vsync = mconfig->GetBool("grafik", "vsync");
39  m_config.MultiSamplingQualitet = mconfig->GetInt("grafik", "multisamplingqualitet");
40  m_config.MultiSamplingCount = mconfig->GetInt("grafik", "multisamplingcount");
41 
42  m_config.Soundkarte = mconfig->GetInt("sound", "soundkarte");
43  m_config.Driver = mconfig->GetInt("sound", "ausgabe");
44  m_config.Channels = mconfig->GetInt("sound", "channels");
45  m_config.SampleRate = mconfig->GetInt("sound", "samplerate");
46  m_config.Bit = mconfig->GetInt("sound", "bit");
47 
48  if(m_config.Hoehe == -1 ||
49  m_config.weite == -1 ||
50  m_config.MultiSamplingQualitet == -1 ||
51  m_config.MultiSamplingCount == -1 ||
52  m_config.Soundkarte == -1 ||
53  m_config.Driver == -1 ||
54  m_config.Channels == -1 ||
55  m_config.SampleRate == -1 ||
56  m_config.Bit == -1)
57  {
58  LoadStandardConfig();
59  }
60 
61  return true;
62  }
63 };
static bool LoadConfig(IConfigFile *mconfig)
static bool LoadStandardConfig()
virtual int GetInt(const char section[], const char key[])
Definition: IConfigFile.h:19
void RAPI RERROR_NULLPOINTER(raString x)
Definition: raMain.cpp:134
virtual bool GetBool(const char section[], const char key[])
Definition: IConfigFile.h:21