- a few minor bugfixes
This commit is contained in:
parent
0f195ca9e4
commit
c751c1a2cf
|
@ -126,9 +126,11 @@ void SoundRenderer::update() {
|
|||
if(runThreadSafe == true) {
|
||||
safeMutex.setMutex(&mutex);
|
||||
}
|
||||
if(soundPlayer) {
|
||||
soundPlayer->updateStreams();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// ======================= Music ============================
|
||||
|
||||
|
@ -142,10 +144,12 @@ void SoundRenderer::playMusic(StrSound *strSound) {
|
|||
safeMutex.setMutex(&mutex);
|
||||
}
|
||||
|
||||
if(soundPlayer) {
|
||||
soundPlayer->play(strSound);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void SoundRenderer::setMusicVolume(StrSound *strSound) {
|
||||
if(strSound != NULL) {
|
||||
|
@ -160,6 +164,7 @@ void SoundRenderer::stopMusic(StrSound *strSound) {
|
|||
safeMutex.setMutex(&mutex);
|
||||
}
|
||||
|
||||
if(soundPlayer) {
|
||||
soundPlayer->stop(strSound);
|
||||
if(strSound != NULL) {
|
||||
if(strSound->getNext() != NULL) {
|
||||
|
@ -168,6 +173,7 @@ void SoundRenderer::stopMusic(StrSound *strSound) {
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// ======================= Fx ============================
|
||||
|
||||
|
@ -191,11 +197,13 @@ void SoundRenderer::playFx(StaticSound *staticSound, Vec3f soundPos, Vec3f camPo
|
|||
safeMutex.setMutex(&mutex);
|
||||
}
|
||||
|
||||
if(soundPlayer) {
|
||||
soundPlayer->play(staticSound);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void SoundRenderer::playFx(StaticSound *staticSound) {
|
||||
if(staticSound!=NULL){
|
||||
|
@ -206,10 +214,12 @@ void SoundRenderer::playFx(StaticSound *staticSound) {
|
|||
safeMutex.setMutex(&mutex);
|
||||
}
|
||||
|
||||
if(soundPlayer) {
|
||||
soundPlayer->play(staticSound);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// ======================= Ambient ============================
|
||||
|
||||
|
@ -222,10 +232,12 @@ void SoundRenderer::playAmbient(StrSound *strSound) {
|
|||
safeMutex.setMutex(&mutex);
|
||||
}
|
||||
|
||||
if(soundPlayer) {
|
||||
soundPlayer->play(strSound, ambientFade);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void SoundRenderer::stopAmbient(StrSound *strSound) {
|
||||
if(soundPlayer != NULL) {
|
||||
|
@ -234,9 +246,11 @@ void SoundRenderer::stopAmbient(StrSound *strSound) {
|
|||
safeMutex.setMutex(&mutex);
|
||||
}
|
||||
|
||||
if(soundPlayer) {
|
||||
soundPlayer->stop(strSound, ambientFade);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// ======================= Misc ============================
|
||||
|
||||
|
@ -247,9 +261,11 @@ void SoundRenderer::stopAllSounds(int64 fadeOff) {
|
|||
safeMutex.setMutex(&mutex);
|
||||
}
|
||||
|
||||
if(soundPlayer) {
|
||||
soundPlayer->stopAllSounds(fadeOff);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool SoundRenderer::isVolumeTurnedOff() const {
|
||||
return (fxVolume <= 0 && musicVolume <= 0 && ambientVolume <= 0);
|
||||
|
|
|
@ -640,7 +640,7 @@ void UnitParticleSystem::initParticle(Particle *p, int particleIndex){
|
|||
// work out where we start for our shape (set speed and pos)
|
||||
switch(shape){
|
||||
case sSpherical:
|
||||
angle = random.randRange(0,360);
|
||||
angle = (float)random.randRange(0,360);
|
||||
// fall through
|
||||
case sConical:{
|
||||
Vec2f horiz = Vec2f(1,0).rotate(ang);
|
||||
|
|
Loading…
Reference in New Issue