- Timestamp:
- Apr 14, 2006, 10:28:24 AM (19 years ago)
- Location:
- trunk/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lib/sound/sound_engine.cc
r7290 r7291 75 75 while(!this->ALSources.empty()) 76 76 { 77 alDeleteSources(1, &this->ALSources.top()); 78 SoundEngine::checkError("Deleting Source", __LINE__); 77 if (alIsSource(this->ALSources.top())) 78 { 79 alDeleteSources(1, &this->ALSources.top()); 80 SoundEngine::checkError("Deleting Source", __LINE__); 81 } 82 else 83 PRINTF(1)("%d is not a Source\n", this->ALSources.top()); 84 79 85 this->ALSources.pop(); 80 86 } … … 169 175 ALfloat orientation [6] = {1,0,0, absDirV.x, absDirV.y, absDirV.z}; 170 176 alListenerfv(AL_ORIENTATION, orientation); 177 SoundEngine::checkError("SoundEngine::update() - Listener Error", __LINE__); 171 178 } 172 179 else … … 185 192 int play = 0x000; 186 193 alGetSourcei(source->getID(), AL_SOURCE_STATE, &play); 194 if (DEBUG > 2) 195 SoundEngine::checkError("SoundEngine::update() Play", __LINE__); 187 196 if(play == AL_PLAYING) 188 197 { … … 193 202 source->getNode()->getAbsCoor().y, 194 203 source->getNode()->getAbsCoor().z); 204 if (DEBUG > 2) 205 SoundEngine::checkError("SoundEngine::update() Set Source Position", __LINE__); 195 206 alSource3f(source->getID(), AL_VELOCITY, 196 207 source->getNode()->getVelocity().x, 197 208 source->getNode()->getVelocity().y, 198 209 source->getNode()->getVelocity().z); 210 if (DEBUG > 2) 211 SoundEngine::checkError("SoundEngine::update() Set Source Velocity", __LINE__); 199 212 } 200 213 } -
trunk/src/lib/sound/sound_source.cc
r7290 r7291 46 46 SoundSource::~SoundSource() 47 47 { 48 SoundEngine::getInstance()->pushALSource(this->sourceID);48 this->stop(); 49 49 } 50 50 … … 69 69 { 70 70 if (unlikely(this->sourceID == 0)) 71 { 71 72 SoundEngine::getInstance()->popALSource(this->sourceID); 73 if (sourceID == 0) 74 { 75 PRINTF(2)("No more Free source\n"); 76 return; 77 } 78 } 72 79 // assert (this->sourceID != 0); 73 80 … … 90 97 { 91 98 this->bPlay = false; 92 alSourceStop(this->sourceID); 93 SoundEngine::getInstance()->pushALSource(this->sourceID); 99 if (this->sourceID != 0) 100 { 101 alSourceStop(this->sourceID); 102 if (DEBUG >= 3) 103 SoundEngine::checkError("StopSource", __LINE__); 104 SoundEngine::getInstance()->pushALSource(this->sourceID); 105 this->sourceID = 0; 106 } 94 107 } 95 108 -
trunk/src/story_entities/game_world.cc
r7290 r7291 136 136 int GameWorld::createAudioThread(void* gameWorld) 137 137 { 138 /*GameWorld* gw = (GameWorld*)gameWorld;138 GameWorld* gw = (GameWorld*)gameWorld; 139 139 printf("STARTIG AUDIO THREAD\n"); 140 140 if(gw->dataTank && gw->dataTank->music != NULL) … … 146 146 gw->dataTank->music->update(); 147 147 SDL_Delay(1); 148 } */148 } 149 149 printf("End the AudioThread\n"); 150 150 }
Note: See TracChangeset
for help on using the changeset viewer.