Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 6840 in orxonox.OLD


Ignore:
Timestamp:
Jan 30, 2006, 1:12:29 AM (18 years ago)
Author:
bensch
Message:

trunk: some minor stupid bug, that held me up for two hours

Location:
trunk/src
Files:
3 edited

Legend:

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

    r6836 r6840  
    101101  const char* channels = iniParser->getVar(CONFIG_NAME_AUDIO_CHANNELS, CONFIG_SECTION_AUDIO, "32");
    102102  this->maxSourceCount = atoi(channels);
    103   const char* musicVolume = iniParser->getVar(CONFIG_NAME_MUSIC_VOLUME, CONFIG_SECTION_AUDIO, "80");
    104   this->musicVolume = atof(musicVolume)/100.0;
    105103
    106104  const char* effectsVolume = iniParser->getVar(CONFIG_NAME_EFFECTS_VOLUME, CONFIG_SECTION_AUDIO, "80");
    107105  this->effectsVolume = atof(effectsVolume)/100.0;
    108106
    109   this->allocateSources(this->maxSourceCount);
     107  const char* musicVolume = iniParser->getVar(CONFIG_NAME_MUSIC_VOLUME, CONFIG_SECTION_AUDIO, "75");
     108  this->musicVolume = atof(musicVolume)/100.0;
    110109}
    111110
     
    131130{
    132131  alDopplerFactor(dopplerFactor);
     132  this->checkError("Setting Doppler Factor", __LINE__);
     133
    133134  alDopplerVelocity(dopplerVelocity);
     135  this->checkError("Setting Doppler Velocity", __LINE__);
    134136}
    135137
     
    291293  }
    292294  // INITIALIZING THE DEVICE:
    293 
     295/*
    294296#ifdef AL_VERSION_1_1
    295297  ALCchar deviceName[] =
     
    306308
    307309  alcMakeContextCurrent(this->context);
    308 #else
     310#else*/
    309311  this->device = alcOpenDevice(NULL);
    310 
     312  SoundEngine::checkError("Error opening Device", __LINE__);
    311313  this->context = alcCreateContext(this->device, NULL);
    312 
     314  SoundEngine::checkError("Error creating Context", __LINE__);
    313315  alcMakeContextCurrent(this->context);
    314   //
    315 #endif
     316  this->checkError("Making Context Current", __LINE__);
     317// #endif
    316318
    317319  if ((result = alGetError()) != AL_NO_ERROR)
     
    319321
    320322  this->setDopplerValues(SOUND_DOPPLER_FACTOR, SOUND_DOPPLER_VELOCITY);
     323  this->allocateSources(this->maxSourceCount);
    321324}
    322325
     
    329332bool SoundEngine::allocateSources(unsigned int count)
    330333{
    331   // Setting default values.
    332334  for (unsigned int i = 0; i < count; i++)
    333335  {
     
    335337
    336338    alGenSources(1, &source);
    337     this->checkError("loading Sources", __LINE__);
     339    printf("%d %d\n", i, source);
     340    this->checkError("allocate Source", __LINE__);
    338341
    339342    alSourcef (source, AL_PITCH,    1.0      );
  • trunk/src/lib/sound/sound_engine.h

    r6836 r6840  
    1717
    1818#define SOUND_DOPPLER_FACTOR       0.001          //!< A factor for the audible doppler effect
    19 #define SOUND_DOPPLER_VELOCITY     5000000        //!< A factor for the TravelSpeed of sound
     19#define SOUND_DOPPLER_VELOCITY     500            //!< A factor for the TravelSpeed of sound
    2020
    2121// FORWARD DECLARATION
  • trunk/src/orxonox.cc

    r6833 r6840  
    248248  PRINT(3)("> Initializing sound\n");
    249249  // SDL_InitSubSystem(SDL_INIT_AUDIO);
     250  SoundEngine::getInstance();
     251
     252  SoundEngine::getInstance()->loadSettings(this->iniParser);
    250253  SoundEngine::getInstance()->initAudio();
    251 
    252   SoundEngine::getInstance()->loadSettings(this->iniParser);
    253254  return 0;
    254255}
Note: See TracChangeset for help on using the changeset viewer.