diff options
author | Monroe Williams <monroe@lindenlab.com> | 2007-08-02 01:18:34 +0000 |
---|---|---|
committer | Monroe Williams <monroe@lindenlab.com> | 2007-08-02 01:18:34 +0000 |
commit | 7138fb673ac3df46b9cb5f23d0d74e70fdd2b6b3 (patch) | |
tree | 3c34a3a180b5275bd4166b0056765c5868f56447 /indra/newview/llviewerobject.cpp | |
parent | f6a10b3214d79df4e8f5768acaa68edbd2de5620 (diff) |
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
Diffstat (limited to 'indra/newview/llviewerobject.cpp')
-rw-r--r-- | indra/newview/llviewerobject.cpp | 23 |
1 files changed, 16 insertions, 7 deletions
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<LLViewerPartSourceScript> 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<LLViewerPartSourceScript> 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); } //---------------------------------------------------------------------------- |