- Timestamp:
- May 17, 2005, 2:05:57 AM (20 years ago)
- Location:
- orxonox/branches/openAL/src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/branches/openAL/src/lib/sound/sound_engine.cc
r4203 r4204 24 24 #include "list.h" 25 25 #include "AL/alc.h" 26 26 #include "resource_manager.h" 27 27 using namespace std; 28 28 … … 164 164 SoundEngine::singletonRef = NULL; 165 165 166 } 166 // deleting all the Resources 167 tIterator<SoundSource>* sourceIterator = this->sourceList->getIterator(); 168 SoundSource* enumSource = sourceIterator->nextElement(); 169 while (enumSource) 170 { 171 delete enumSource; 172 enumSource = sourceIterator->nextElement(); 173 } 174 delete sourceIterator; 175 176 tIterator<SoundBuffer>* bufferIterator = this->bufferList->getIterator(); 177 SoundBuffer* enumBuffer = bufferIterator->nextElement(); 178 while (enumBuffer) 179 { 180 ResourceManager::getInstance()->unload(enumBuffer); 181 enumBuffer = bufferIterator->nextElement(); 182 } 183 delete bufferIterator; 184 } 185 186 /** 187 \brief creates a new SoundSource. 188 \param fileName The Name to load the SoundBuffer from 189 \param The sourceNode to bind this SoundSource to. 190 \returns The newly created SoundSource 191 192 acctualy this is nothing more than a wrapper around the ResourceManager. 193 */ 194 SoundSource* SoundEngine::createSource(const char* fileName, PNode* sourceNode) 195 { 196 return new SoundSource((SoundBuffer*)ResourceManager::getInstance()->load(fileName, WAV, RP_LEVEL), sourceNode); 197 } 198 167 199 168 200 /** -
orxonox/branches/openAL/src/lib/sound/sound_engine.h
r4203 r4204 71 71 virtual ~SoundEngine(void); 72 72 73 SoundSource* createSource(const char* fileName, PNode* sourceNode); 74 73 75 void setListener(PNode* listener); 74 76 -
orxonox/branches/openAL/src/story_entities/world.cc
r4200 r4204 491 491 SoundEngine::getInstance()->setListener(tn); 492 492 SoundBuffer* tBuffer = new SoundBuffer(ResourceManager::getFullName("sound/explo.wav")); 493 SoundSource* tSound = new SoundSource(tBuffer, this->localPlayer);494 tSound->setRolloffFactor(0 .1);493 SoundSource* tSound = SoundEngine::getInstance()->createSource("sound/explo.wav", this->localPlayer); 494 tSound->setRolloffFactor(0); 495 495 tSound->play(); 496 496 -
orxonox/branches/openAL/src/util/resource_manager.cc
r4194 r4204 23 23 #include "texture.h" 24 24 #include "text_engine.h" 25 #include "sound_engine.h" 25 26 26 27 #include "list.h" … … 284 285 else 285 286 PRINTF(2)("Sorry, %s does not exist. Not loading Font\n", fullName); 287 break; 288 case WAV: 289 if(isFile(fullName)) 290 tmpResource->pointer = new SoundBuffer(fullName); 286 291 break; 287 292 case IMAGE: … … 369 374 case IMAGE: 370 375 delete (Texture*)resource->pointer; 376 break; 377 case WAV: 378 delete (SoundBuffer*)resource->pointer; 371 379 break; 372 380 case TTF:
Note: See TracChangeset
for help on using the changeset viewer.