Changeset 6070
- Timestamp:
- Nov 15, 2009, 3:53:12 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/sound3/src/orxonox/sound/BaseSound.cc
r6069 r6070 46 46 { 47 47 RegisterRootObject(BaseSound); 48 49 if (GameMode::playsSound()) 50 alGenSources(1, &this->audioSource_); 48 51 } 49 52 … … 51 54 { 52 55 this->setSource(""); 56 if (this->audioSource_) 57 alDeleteSources(1, &this->audioSource_); 53 58 } 54 59 … … 124 129 } 125 130 126 if (alIsSource(this->audio Source_))131 if (alIsSource(this->audioBuffer_)) 127 132 { 128 133 this->stop(); 129 134 // Unload old sound first 130 135 alSourcei(this->audioSource_, AL_BUFFER, 0); 131 alDeleteSources(1, &this->audioSource_);132 this->audioSource_ = 0;133 136 alDeleteBuffers(1, &this->audioBuffer_); 134 137 this->audioBuffer_ = 0; … … 172 175 } 173 176 174 alGenSources(1, &this->audioSource_);175 177 alSourcei(this->audioSource_, AL_BUFFER, this->audioBuffer_); 176 178 if (alGetError() != AL_NO_ERROR)
Note: See TracChangeset
for help on using the changeset viewer.