- Timestamp:
- Dec 2, 2009, 4:52:42 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/presentation2/src/orxonox/sound/BaseSound.cc
r6190 r6202 50 50 RegisterRootObject(BaseSound); 51 51 52 this->volume_ = 1; 53 this->pitch_ = 1; 54 52 55 if (GameMode::playsSound()) 53 56 { … … 129 132 if (GameMode::playsSound()) 130 133 alSourcei(this->audioSource_, AL_LOOPING, (val ? AL_TRUE : AL_FALSE)); 134 } 135 136 void BaseSound::setPitch(float pitch) 137 { 138 if (pitch > 2 || pitch < 0.5) 139 { 140 COUT(2) << "Sound warning: pitch out of range, cropping value." << std::endl; 141 pitch = pitch > 2 ? 2 : pitch; 142 pitch = pitch < 0.5 ? 0.5 : pitch; 143 } 144 this->pitch_ = pitch; 145 if (GameMode::playsSound()) 146 alSourcei(this->audioSource_, AL_PITCH, pitch); 131 147 } 132 148 … … 194 210 alSource3f(this->audioSource_, AL_POSITION, 0, 0, 0); 195 211 this->updateVolume(); 212 this->setPitch(this->getPitch()); 196 213 alSourcei (this->audioSource_, AL_LOOPING, (this->bLoop_ ? AL_TRUE : AL_FALSE)); 197 214 if (this->isPlaying() || this->isPaused())
Note: See TracChangeset
for help on using the changeset viewer.