From 7138fb673ac3df46b9cb5f23d0d74e70fdd2b6b3 Mon Sep 17 00:00:00 2001 From: Monroe Williams Date: Thu, 2 Aug 2007 01:18:34 +0000 Subject: Merge down from Branch_1-18-1: svn merge --ignore-ancestry svn+ssh://svn.lindenlab.com/svn/linden/release@66449 svn+ssh://svn.lindenlab.com/svn/linden/branches/Branch_1-18-1@67131 --- indra/newview/llviewerobject.cpp | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) (limited to 'indra/newview/llviewerobject.cpp') diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp index e53f779473..bbb69594da 100644 --- a/indra/newview/llviewerobject.cpp +++ b/indra/newview/llviewerobject.cpp @@ -156,6 +156,7 @@ LLViewerObject::LLViewerObject(const LLUUID &id, const LLPCode pcode, LLViewerRe mLatestRecvPacketID(0), mData(NULL), mAudioSourcep(NULL), + mAudioGain(1.f), mAppAngle(0.f), mPixelArea(1024.f), mInventory(NULL), @@ -2697,6 +2698,12 @@ void LLViewerObject::setPixelAreaAndAngle(LLAgent &agent) BOOL LLViewerObject::updateLOD() { + // Update volume of looping sounds + if (mAudioSourcep && mAudioSourcep->isLoop()) + { + F32 volume = mAudioGain * gSavedSettings.getF32("AudioLevelSFX"); + mAudioSourcep->setGain(volume); + } return FALSE; } @@ -4037,7 +4044,7 @@ void LLViewerObject::unpackParticleSource(const S32 block_num, const LLUUID& own { LLPointer pss = LLViewerPartSourceScript::unpackPSS(this, NULL, block_num); //If the owner is muted, don't create the system - if(gMuteListp->isMuted(owner_id)) return; + if(gMuteListp->isMuted(owner_id, LLMute::flagParticles)) return; // We need to be able to deal with a particle source that hasn't changed, but still got an update! if (pss) @@ -4086,7 +4093,7 @@ void LLViewerObject::unpackParticleSource(LLDataPacker &dp, const LLUUID& owner_ { LLPointer pss = LLViewerPartSourceScript::unpackPSS(this, NULL, dp); //If the owner is muted, don't create the system - if(gMuteListp->isMuted(owner_id)) return; + if(gMuteListp->isMuted(owner_id, LLMute::flagParticles)) return; // We need to be able to deal with a particle source that hasn't changed, but still got an update! if (pss) { @@ -4204,7 +4211,9 @@ void LLViewerObject::setAttachedSound(const LLUUID &audio_uuid, const LLUUID& ow if (mAudioSourcep) { BOOL queue = flags & LL_SOUND_FLAG_QUEUE; - mAudioSourcep->setGain(gain); + mAudioGain = gain; + F32 volume = gain * gSavedSettings.getF32("AudioLevelSFX"); + mAudioSourcep->setGain(volume); mAudioSourcep->setLoop(flags & LL_SOUND_FLAG_LOOP); mAudioSourcep->setSyncMaster(flags & LL_SOUND_FLAG_SYNC_MASTER); mAudioSourcep->setSyncSlave(flags & LL_SOUND_FLAG_SYNC_SLAVE); @@ -4239,12 +4248,12 @@ void LLViewerObject::adjustAudioGain(const F32 gain) { return; } - - if (!mAudioSourcep) + if (mAudioSourcep) { - return; + mAudioGain = gain; + F32 volume = mAudioGain * gSavedSettings.getF32("AudioLevelSFX"); + mAudioSourcep->setGain(volume); } - mAudioSourcep->setGain(gain); } //---------------------------------------------------------------------------- -- cgit v1.2.3