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