aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llviewerpartsim.cpp
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--linden/indra/newview/llviewerpartsim.cpp43
1 files changed, 39 insertions, 4 deletions
diff --git a/linden/indra/newview/llviewerpartsim.cpp b/linden/indra/newview/llviewerpartsim.cpp
index bc15317..acae8d3 100644
--- a/linden/indra/newview/llviewerpartsim.cpp
+++ b/linden/indra/newview/llviewerpartsim.cpp
@@ -2,6 +2,8 @@
2 * @file llviewerpartsim.cpp 2 * @file llviewerpartsim.cpp
3 * @brief LLViewerPart class implementation 3 * @brief LLViewerPart class implementation
4 * 4 *
5 * $LicenseInfo:firstyear=2003&license=viewergpl$
6 *
5 * Copyright (c) 2003-2007, Linden Research, Inc. 7 * Copyright (c) 2003-2007, Linden Research, Inc.
6 * 8 *
7 * Second Life Viewer Source Code 9 * Second Life Viewer Source Code
@@ -24,6 +26,7 @@
24 * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO 26 * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
25 * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, 27 * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
26 * COMPLETENESS OR PERFORMANCE. 28 * COMPLETENESS OR PERFORMANCE.
29 * $/LicenseInfo$
27 */ 30 */
28 31
29#include "llviewerprecompiledheaders.h" 32#include "llviewerprecompiledheaders.h"
@@ -417,6 +420,18 @@ void LLViewerPartGroup::shift(const LLVector3 &offset)
417 } 420 }
418} 421}
419 422
423void LLViewerPartGroup::removeParticlesByID(const U32 source_id)
424{
425 LLMemType mt(LLMemType::MTYPE_PARTICLES);
426 S32 end = (S32) mParticles.size();
427 for (int i = 0; i < end; i++)
428 {
429 if(mParticles[i]->mPartSourcep->getID() == source_id)
430 {
431 mParticles[i]->mFlags = LLViewerPart::LL_PART_DEAD_MASK;
432 }
433 }
434}
420 435
421////////////////////////////////// 436//////////////////////////////////
422// 437//
@@ -684,6 +699,10 @@ void LLViewerPartSim::addPartSource(LLPointer<LLViewerPartSource> sourcep)
684 mViewerPartSources.push_back(sourcep); 699 mViewerPartSources.push_back(sourcep);
685} 700}
686 701
702void LLViewerPartSim::removeLastCreatedSource()
703{
704 mViewerPartSources.pop_back();
705}
687 706
688void LLViewerPartSim::cleanupRegion(LLViewerRegion *regionp) 707void LLViewerPartSim::cleanupRegion(LLViewerRegion *regionp)
689{ 708{
@@ -700,16 +719,32 @@ void LLViewerPartSim::cleanupRegion(LLViewerRegion *regionp)
700 } 719 }
701} 720}
702 721
703void LLViewerPartSim::cleanMutedParticles(const LLUUID& task_id) 722void LLViewerPartSim::clearParticlesByID(const U32 system_id)
704{ 723{
705 LLMemType mt(LLMemType::MTYPE_PARTICLES); 724 LLMemType mt(LLMemType::MTYPE_PARTICLES);
706 for (source_list_t::iterator i = mViewerPartSources.begin(); i != mViewerPartSources.end(); ) 725 for (group_list_t::iterator g = mViewerPartGroups.begin(); g != mViewerPartGroups.end(); ++g)
707 { 726 {
708 source_list_t::iterator iter = i++; 727 (*g)->removeParticlesByID(system_id);
728 }
729 for (source_list_t::iterator i = mViewerPartSources.begin(); i != mViewerPartSources.end(); ++i)
730 {
731 if ((*i)->getID() == system_id)
732 {
733 (*i)->setDead();
734 break;
735 }
736 }
737
738}
709 739
740void LLViewerPartSim::clearParticlesByOwnerID(const LLUUID& task_id)
741{
742 LLMemType mt(LLMemType::MTYPE_PARTICLES);
743 for (source_list_t::iterator iter = mViewerPartSources.begin(); iter != mViewerPartSources.end(); ++iter)
744 {
710 if ((*iter)->getOwnerUUID() == task_id) 745 if ((*iter)->getOwnerUUID() == task_id)
711 { 746 {
712 i = mViewerPartSources.erase(iter); 747 clearParticlesByID((*iter)->getID());
713 } 748 }
714 } 749 }
715} 750}