- a few minor bugfixes
This commit is contained in:
parent
0f195ca9e4
commit
c751c1a2cf
|
@ -126,8 +126,10 @@ void SoundRenderer::update() {
|
||||||
if(runThreadSafe == true) {
|
if(runThreadSafe == true) {
|
||||||
safeMutex.setMutex(&mutex);
|
safeMutex.setMutex(&mutex);
|
||||||
}
|
}
|
||||||
|
if(soundPlayer) {
|
||||||
soundPlayer->updateStreams();
|
soundPlayer->updateStreams();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ======================= Music ============================
|
// ======================= Music ============================
|
||||||
|
@ -142,9 +144,11 @@ 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) {
|
||||||
|
@ -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) {
|
||||||
|
@ -167,6 +172,7 @@ void SoundRenderer::stopMusic(StrSound *strSound) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ======================= Fx ============================
|
// ======================= Fx ============================
|
||||||
|
@ -191,10 +197,12 @@ 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) {
|
||||||
|
@ -206,9 +214,11 @@ void SoundRenderer::playFx(StaticSound *staticSound) {
|
||||||
safeMutex.setMutex(&mutex);
|
safeMutex.setMutex(&mutex);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(soundPlayer) {
|
||||||
soundPlayer->play(staticSound);
|
soundPlayer->play(staticSound);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ======================= Ambient ============================
|
// ======================= Ambient ============================
|
||||||
|
@ -222,9 +232,11 @@ 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) {
|
||||||
|
@ -234,8 +246,10 @@ void SoundRenderer::stopAmbient(StrSound *strSound) {
|
||||||
safeMutex.setMutex(&mutex);
|
safeMutex.setMutex(&mutex);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(soundPlayer) {
|
||||||
soundPlayer->stop(strSound, ambientFade);
|
soundPlayer->stop(strSound, ambientFade);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ======================= Misc ============================
|
// ======================= Misc ============================
|
||||||
|
@ -247,8 +261,10 @@ 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 {
|
||||||
|
|
|
@ -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