Changeset 6840 in orxonox.OLD for trunk/src/lib
- Timestamp:
- Jan 30, 2006, 1:12:29 AM (19 years ago)
- Location:
- trunk/src/lib/sound
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lib/sound/sound_engine.cc
r6836 r6840 101 101 const char* channels = iniParser->getVar(CONFIG_NAME_AUDIO_CHANNELS, CONFIG_SECTION_AUDIO, "32"); 102 102 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;105 103 106 104 const char* effectsVolume = iniParser->getVar(CONFIG_NAME_EFFECTS_VOLUME, CONFIG_SECTION_AUDIO, "80"); 107 105 this->effectsVolume = atof(effectsVolume)/100.0; 108 106 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; 110 109 } 111 110 … … 131 130 { 132 131 alDopplerFactor(dopplerFactor); 132 this->checkError("Setting Doppler Factor", __LINE__); 133 133 134 alDopplerVelocity(dopplerVelocity); 135 this->checkError("Setting Doppler Velocity", __LINE__); 134 136 } 135 137 … … 291 293 } 292 294 // INITIALIZING THE DEVICE: 293 295 /* 294 296 #ifdef AL_VERSION_1_1 295 297 ALCchar deviceName[] = … … 306 308 307 309 alcMakeContextCurrent(this->context); 308 #else 310 #else*/ 309 311 this->device = alcOpenDevice(NULL); 310 312 SoundEngine::checkError("Error opening Device", __LINE__); 311 313 this->context = alcCreateContext(this->device, NULL); 312 314 SoundEngine::checkError("Error creating Context", __LINE__); 313 315 alcMakeContextCurrent(this->context); 314 //315 #endif316 this->checkError("Making Context Current", __LINE__); 317 // #endif 316 318 317 319 if ((result = alGetError()) != AL_NO_ERROR) … … 319 321 320 322 this->setDopplerValues(SOUND_DOPPLER_FACTOR, SOUND_DOPPLER_VELOCITY); 323 this->allocateSources(this->maxSourceCount); 321 324 } 322 325 … … 329 332 bool SoundEngine::allocateSources(unsigned int count) 330 333 { 331 // Setting default values.332 334 for (unsigned int i = 0; i < count; i++) 333 335 { … … 335 337 336 338 alGenSources(1, &source); 337 this->checkError("loading Sources", __LINE__); 339 printf("%d %d\n", i, source); 340 this->checkError("allocate Source", __LINE__); 338 341 339 342 alSourcef (source, AL_PITCH, 1.0 ); -
trunk/src/lib/sound/sound_engine.h
r6836 r6840 17 17 18 18 #define SOUND_DOPPLER_FACTOR 0.001 //!< A factor for the audible doppler effect 19 #define SOUND_DOPPLER_VELOCITY 500 0000//!< A factor for the TravelSpeed of sound19 #define SOUND_DOPPLER_VELOCITY 500 //!< A factor for the TravelSpeed of sound 20 20 21 21 // FORWARD DECLARATION
Note: See TracChangeset
for help on using the changeset viewer.