Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 4985 in orxonox.OLD for orxonox/trunk/src/lib/sound/sound_engine.cc


Ignore:
Timestamp:
Aug 12, 2005, 12:55:21 AM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: loading some stuff from ths sound-engine

File:
1 edited

Legend:

Unmodified
Added
Removed
  • orxonox/trunk/src/lib/sound/sound_engine.cc

    r4984 r4985  
    2828#include "resource_manager.h"
    2929#include "debug.h"
     30#include "ini_parser.h"
    3031
    3132using namespace std;
    32 
    3333
    3434//////////////////
     
    110110    alSourcei (this->sourceID, AL_BUFFER,   this->buffer->getID());
    111111  alSourcef (this->sourceID, AL_PITCH,    1.0      );
    112   alSourcef (this->sourceID, AL_GAIN,     1.0      );
     112  alSourcef (this->sourceID, AL_GAIN,     SoundEngine::getInstance()->getEffectsVolume() );
    113113  alSourcei (sourceID, AL_LOOPING,  AL_FALSE     );
    114114}
     
    239239  alutExit();
    240240}
     241
     242/**
     243 * loads the settings of the SoundEngine from an ini-file
     244 * @param iniParser the IniParser of the inifile
     245 */
     246void SoundEngine::loadSettings(IniParser* iniParser)
     247{
     248  const char* musicVolume = iniParser->getVar(CONFIG_NAME_MUSIC_VOLUME, CONFIG_SECTION_AUDIO, "80");
     249  this->musicVolume = atof(musicVolume)/100.0;
     250
     251  const char* effectsVolume = iniParser->getVar(CONFIG_NAME_EFFECTS_VOLUME, CONFIG_SECTION_AUDIO, "80");
     252  this->effectsVolume = atof(effectsVolume)/100.0;
     253}
     254
     255
    241256
    242257/**
Note: See TracChangeset for help on using the changeset viewer.