diff options
Diffstat (limited to 'linden/indra/newview/llviewerobject.cpp')
-rw-r--r-- | linden/indra/newview/llviewerobject.cpp | 85 |
1 files changed, 61 insertions, 24 deletions
diff --git a/linden/indra/newview/llviewerobject.cpp b/linden/indra/newview/llviewerobject.cpp index 5a7ef9d..d237614 100644 --- a/linden/indra/newview/llviewerobject.cpp +++ b/linden/indra/newview/llviewerobject.cpp | |||
@@ -1571,7 +1571,7 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys, | |||
1571 | // Bad, we got a cycle somehow. | 1571 | // Bad, we got a cycle somehow. |
1572 | // Kill both the parent and the child, and | 1572 | // Kill both the parent and the child, and |
1573 | // set cache misses for both of them. | 1573 | // set cache misses for both of them. |
1574 | llwarns << "Attempting to recover from parenting cycle!" << llendl | 1574 | llwarns << "Attempting to recover from parenting cycle!" << llendl; |
1575 | llwarns << "Killing " << sent_parentp->getID() << " and " << getID() << llendl; | 1575 | llwarns << "Killing " << sent_parentp->getID() << " and " << getID() << llendl; |
1576 | llwarns << "Adding to cache miss list" << llendl; | 1576 | llwarns << "Adding to cache miss list" << llendl; |
1577 | setParent(NULL); | 1577 | setParent(NULL); |
@@ -1595,6 +1595,24 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys, | |||
1595 | sent_parentp->addChild(this); | 1595 | sent_parentp->addChild(this); |
1596 | } | 1596 | } |
1597 | 1597 | ||
1598 | if( mPartSourcep.notNull() ) | ||
1599 | { | ||
1600 | LLViewerPartSourceScript *partSourceScript = mPartSourcep.get(); | ||
1601 | partSourceScript->setSuspended( FALSE ); | ||
1602 | } | ||
1603 | |||
1604 | if( mText.notNull() ) | ||
1605 | { | ||
1606 | LLHUDText *hudText = mText.get(); | ||
1607 | hudText->setHidden( FALSE ); | ||
1608 | } | ||
1609 | |||
1610 | if( mIcon.notNull() ) | ||
1611 | { | ||
1612 | LLHUDIcon *hudIcon = mIcon.get(); | ||
1613 | hudIcon->setHidden( FALSE ); | ||
1614 | } | ||
1615 | |||
1598 | setChanged(MOVED | SILHOUETTE); | 1616 | setChanged(MOVED | SILHOUETTE); |
1599 | } | 1617 | } |
1600 | else | 1618 | else |
@@ -1609,6 +1627,23 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys, | |||
1609 | U32 port = mesgsys->getSenderPort(); | 1627 | U32 port = mesgsys->getSenderPort(); |
1610 | 1628 | ||
1611 | gObjectList.orphanize(this, parent_id, ip, port); | 1629 | gObjectList.orphanize(this, parent_id, ip, port); |
1630 | if( mPartSourcep.notNull() ) | ||
1631 | { | ||
1632 | LLViewerPartSourceScript *partSourceScript = mPartSourcep.get(); | ||
1633 | partSourceScript->setSuspended( TRUE ); | ||
1634 | } | ||
1635 | |||
1636 | if( mText.notNull() ) | ||
1637 | { | ||
1638 | LLHUDText *hudText = mText.get(); | ||
1639 | hudText->setHidden( TRUE ); | ||
1640 | } | ||
1641 | |||
1642 | if( mIcon.notNull() ) | ||
1643 | { | ||
1644 | LLHUDIcon *hudIcon = mIcon.get(); | ||
1645 | hudIcon->setHidden( TRUE ); | ||
1646 | } | ||
1612 | } | 1647 | } |
1613 | } | 1648 | } |
1614 | } | 1649 | } |
@@ -1686,7 +1721,7 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys, | |||
1686 | // Bad, we got a cycle somehow. | 1721 | // Bad, we got a cycle somehow. |
1687 | // Kill both the parent and the child, and | 1722 | // Kill both the parent and the child, and |
1688 | // set cache misses for both of them. | 1723 | // set cache misses for both of them. |
1689 | llwarns << "Attempting to recover from parenting cycle!" << llendl | 1724 | llwarns << "Attempting to recover from parenting cycle!" << llendl; |
1690 | llwarns << "Killing " << sent_parentp->getID() << " and " << getID() << llendl; | 1725 | llwarns << "Killing " << sent_parentp->getID() << " and " << getID() << llendl; |
1691 | llwarns << "Adding to cache miss list" << llendl; | 1726 | llwarns << "Adding to cache miss list" << llendl; |
1692 | setParent(NULL); | 1727 | setParent(NULL); |
@@ -4148,7 +4183,11 @@ void LLViewerObject::setAttachedSound(const LLUUID &audio_uuid, const LLUUID& ow | |||
4148 | 4183 | ||
4149 | if (audio_uuid.isNull()) | 4184 | if (audio_uuid.isNull()) |
4150 | { | 4185 | { |
4151 | if (mAudioSourcep && mAudioSourcep->isLoop() && !mAudioSourcep->hasPendingPreloads()) | 4186 | if (!mAudioSourcep) |
4187 | { | ||
4188 | return; | ||
4189 | } | ||
4190 | if (mAudioSourcep->isLoop() && !mAudioSourcep->hasPendingPreloads()) | ||
4152 | { | 4191 | { |
4153 | // We don't clear the sound if it's a loop, it'll go away on its own. | 4192 | // We don't clear the sound if it's a loop, it'll go away on its own. |
4154 | // At least, this appears to be how the scripts work. | 4193 | // At least, this appears to be how the scripts work. |
@@ -4158,29 +4197,22 @@ void LLViewerObject::setAttachedSound(const LLUUID &audio_uuid, const LLUUID& ow | |||
4158 | gAudiop->cleanupAudioSource(mAudioSourcep); | 4197 | gAudiop->cleanupAudioSource(mAudioSourcep); |
4159 | mAudioSourcep = NULL; | 4198 | mAudioSourcep = NULL; |
4160 | } | 4199 | } |
4161 | else if (mAudioSourcep) | 4200 | else if (flags & LL_SOUND_FLAG_STOP) |
4162 | { | 4201 | { |
4163 | if (mAudioSourcep->isLoop()) | 4202 | // Just shut off the sound |
4164 | { | 4203 | mAudioSourcep->play(LLUUID::null); |
4165 | // Just shut off the sound | ||
4166 | mAudioSourcep->play(LLUUID::null); | ||
4167 | } | ||
4168 | } | 4204 | } |
4169 | return; | 4205 | return; |
4170 | } | 4206 | } |
4171 | if (flags & LL_SOUND_FLAG_LOOP) | 4207 | if (flags & LL_SOUND_FLAG_LOOP |
4208 | && mAudioSourcep && mAudioSourcep->isLoop() && mAudioSourcep->getCurrentData() | ||
4209 | && mAudioSourcep->getCurrentData()->getID() == audio_uuid) | ||
4172 | { | 4210 | { |
4173 | if (mAudioSourcep && mAudioSourcep->isLoop() && mAudioSourcep->getCurrentData()) | 4211 | //llinfos << "Already playing this sound on a loop, ignoring" << llendl; |
4174 | { | 4212 | return; |
4175 | if (mAudioSourcep->getCurrentData()->getID() == audio_uuid) | ||
4176 | { | ||
4177 | //llinfos << "Already playing this sound on a loop, ignoring" << llendl; | ||
4178 | return; | ||
4179 | } | ||
4180 | } | ||
4181 | } | 4213 | } |
4182 | 4214 | ||
4183 | // don't clean up before previous sound is done. Solves: SL-33486 | 4215 | // don't clean up before previous sound is done. Solves: SL-33486 |
4184 | if ( mAudioSourcep && mAudioSourcep->isDone() ) | 4216 | if ( mAudioSourcep && mAudioSourcep->isDone() ) |
4185 | { | 4217 | { |
4186 | gAudiop->cleanupAudioSource(mAudioSourcep); | 4218 | gAudiop->cleanupAudioSource(mAudioSourcep); |
@@ -4191,11 +4223,16 @@ void LLViewerObject::setAttachedSound(const LLUUID &audio_uuid, const LLUUID& ow | |||
4191 | 4223 | ||
4192 | if (mAudioSourcep) | 4224 | if (mAudioSourcep) |
4193 | { | 4225 | { |
4226 | BOOL queue = flags & LL_SOUND_FLAG_QUEUE; | ||
4194 | mAudioSourcep->setGain(gain); | 4227 | mAudioSourcep->setGain(gain); |
4195 | mAudioSourcep->setLoop((flags & LL_SOUND_FLAG_LOOP) ? TRUE : FALSE); | 4228 | mAudioSourcep->setLoop(flags & LL_SOUND_FLAG_LOOP); |
4196 | mAudioSourcep->setSyncMaster((flags & LL_SOUND_FLAG_SYNC_MASTER) ? TRUE : FALSE); | 4229 | mAudioSourcep->setSyncMaster(flags & LL_SOUND_FLAG_SYNC_MASTER); |
4197 | mAudioSourcep->setSyncSlave((flags & LL_SOUND_FLAG_SYNC_SLAVE) ? TRUE : FALSE); | 4230 | mAudioSourcep->setSyncSlave(flags & LL_SOUND_FLAG_SYNC_SLAVE); |
4198 | mAudioSourcep->setQueueSounds((flags & LL_SOUND_FLAG_QUEUE) ? TRUE : FALSE); | 4231 | mAudioSourcep->setQueueSounds(queue); |
4232 | if(!queue) // stop any current sound first to avoid "farts of doom" (SL-1541) -MG | ||
4233 | { | ||
4234 | mAudioSourcep->play(LLUUID::null); | ||
4235 | } | ||
4199 | //llinfos << "Playing attached sound " << audio_uuid << llendl; | 4236 | //llinfos << "Playing attached sound " << audio_uuid << llendl; |
4200 | mAudioSourcep->play(audio_uuid); | 4237 | mAudioSourcep->play(audio_uuid); |
4201 | } | 4238 | } |