Changeset 7247 in orxonox.OLD for branches/preferences/src/lib
- Timestamp:
- Mar 24, 2006, 6:24:41 PM (19 years ago)
- Location:
- branches/preferences/src/lib
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/preferences/src/lib/graphics/graphics_engine.cc
r7221 r7247 30 30 31 31 #include "parser/ini_parser/ini_parser.h" 32 #include "util/preferences.h" 32 33 #include "substring.h" 33 34 #include "text.h" … … 154 155 * @returns nothing usefull 155 156 */ 156 int GraphicsEngine::initFrom IniFile(IniParser* iniParser)157 int GraphicsEngine::initFromPreferences() 157 158 { 158 159 // looking if we are in fullscreen-mode 159 const std::string fullscreen = iniParser->getVar(CONFIG_NAME_FULLSCREEN, CONFIG_SECTION_VIDEO, "0"); 160 const std::string fullscreen = Preferences::getInstance()->getString(CONFIG_SECTION_VIDEO, CONFIG_NAME_FULLSCREEN, "0"); 161 160 162 if (fullscreen[0] == '1' || fullscreen == "true") 161 163 this->fullscreenFlag = SDL_FULLSCREEN; 162 164 163 165 // looking if we are in fullscreen-mode 164 const std::string textures = iniParser->getVar(CONFIG_NAME_TEXTURES, CONFIG_SECTION_VIDEO_ADVANCED, "0");166 const std::string textures = Preferences::getInstance()->getString(CONFIG_SECTION_VIDEO_ADVANCED, CONFIG_NAME_TEXTURES, "0"); 165 167 if (textures[0] == '1' || textures == "true") 166 168 Texture::setTextureEnableState(true); … … 169 171 170 172 // searching for a usefull resolution 171 SubString resolution( iniParser->getVar(CONFIG_NAME_RESOLUTION, CONFIG_SECTION_VIDEO, "640x480").c_str(), 'x'); ///FIXME173 SubString resolution(Preferences::getInstance()->getString(CONFIG_SECTION_VIDEO, CONFIG_NAME_RESOLUTION, "640x480").c_str(), 'x'); ///FIXME 172 174 //resolution.debug(); 173 175 MultiType x = resolution.getString(0), y = resolution.getString(1); -
branches/preferences/src/lib/graphics/graphics_engine.h
r7221 r7247 39 39 40 40 int init(); 41 int initFrom IniFile(IniParser* iniParser);41 int initFromPreferences(); 42 42 43 43 void setWindowName(const std::string& windowName, const std::string& icon); -
branches/preferences/src/lib/sound/sound_engine.cc
r7225 r7247 26 26 #include "util/loading/resource_manager.h" 27 27 #include "debug.h" 28 #include " parser/ini_parser/ini_parser.h"28 #include "util/preferences.h" 29 29 #include "globals.h" 30 30 … … 97 97 * @param iniParser the IniParser of the inifile 98 98 */ 99 void SoundEngine::loadSettings( IniParser* iniParser)100 { 101 MultiType channels = iniParser->getVar(CONFIG_NAME_AUDIO_CHANNELS, CONFIG_SECTION_AUDIO, "32");99 void SoundEngine::loadSettings() 100 { 101 MultiType channels = Preferences::getInstance()->getString(CONFIG_SECTION_AUDIO, CONFIG_NAME_AUDIO_CHANNELS, "32"); 102 102 this->maxSourceCount = channels.getInt(); 103 103 104 MultiType effectsVolume = iniParser->getVar(CONFIG_NAME_EFFECTS_VOLUME, CONFIG_SECTION_AUDIO, "80");104 MultiType effectsVolume = Preferences::getInstance()->getString(CONFIG_SECTION_AUDIO, CONFIG_NAME_EFFECTS_VOLUME, "80"); 105 105 this->effectsVolume = effectsVolume.getFloat()/100.0; 106 106 107 MultiType musicVolume = iniParser->getVar(CONFIG_NAME_MUSIC_VOLUME, CONFIG_SECTION_AUDIO, "75");107 MultiType musicVolume = Preferences::getInstance()->getString(CONFIG_SECTION_AUDIO, CONFIG_NAME_MUSIC_VOLUME, "75"); 108 108 this->musicVolume = musicVolume.getFloat()/100.0; 109 109 } -
branches/preferences/src/lib/sound/sound_engine.h
r7225 r7247 31 31 inline static SoundEngine* getInstance() { if (!SoundEngine::singletonRef) SoundEngine::singletonRef = new SoundEngine(); return SoundEngine::singletonRef; }; 32 32 33 void loadSettings( IniParser* iniParser);33 void loadSettings(); 34 34 35 35 SoundSource* createSource(const std::string& fileName, PNode* sourceNode = NULL);
Note: See TracChangeset
for help on using the changeset viewer.