Changeset 5924 in orxonox.OLD for branches/avi_play/src/lib/sound/sound_engine.cc
- Timestamp:
- Dec 4, 2005, 11:37:49 PM (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/avi_play/src/lib/sound/sound_engine.cc
r5834 r5924 137 137 if (this->sourceList != NULL) 138 138 { 139 list<BaseObject*>:: iterator source;139 list<BaseObject*>::const_iterator source; 140 140 for (source = this->sourceList->begin(); source != this->sourceList->end(); source++) 141 141 { … … 182 182 if (likely(this->sourceList != NULL)) 183 183 { 184 list<BaseObject*>:: iterator sourceIT;184 list<BaseObject*>::const_iterator sourceIT; 185 185 SoundSource* source; 186 186 for (sourceIT = this->sourceList->begin(); sourceIT != this->sourceList->end(); sourceIT++) … … 281 281 282 282 // INITIALIZING THE DEVICE: 283 ALchar deviceName[] = 283 #ifndef AL_VERSION_1_1 284 ALubyte deviceName[] = 285 #else 286 ALCchar deviceName[] = 287 #endif 284 288 #ifdef __WIN32__ 285 " native";289 "Direct3D"; 286 290 #else 287 "'( ( devices '( native artsnull ) ) )";291 "'( ( devices '( native null ) ) )"; 288 292 #endif 289 293 // … … 301 305 } 302 306 307 308 /** 309 * Allocates openAL sources 310 * @param count how many sources to allocate 311 * @returns true on success, false if at least one source could not be allocated 312 */ 313 bool SoundEngine::allocateSources(unsigned int count) 314 { 315 ALuint* sourceList = new ALuint[count]; 316 ALenum result; 317 318 alGenSources(count, sourceList); 319 if ((result = alGetError()) != AL_NO_ERROR) 320 { 321 SoundEngine::PrintALErrorString(result); 322 return false; 323 } 324 325 /// @TODO check syntax 326 327 328 // Setting default values. 329 for (int i = 0; i < count; i++) 330 { 331 alSourcef (sourceList[i], AL_PITCH, 1.0 ); 332 alSourcef (sourceList[i], AL_GAIN, this->getEffectsVolume() ); 333 alSourcei (sourceList[i], AL_LOOPING, AL_FALSE ); 334 this->ALSources.push(sourceList[i]); 335 } 336 return true; 337 } 338 303 339 /** 304 340 * Transforms AL-errors into something readable
Note: See TracChangeset
for help on using the changeset viewer.