diff options
Diffstat (limited to 'indra/newview/llviewerpartsim.cpp')
-rw-r--r-- | indra/newview/llviewerpartsim.cpp | 40 |
1 files changed, 36 insertions, 4 deletions
diff --git a/indra/newview/llviewerpartsim.cpp b/indra/newview/llviewerpartsim.cpp index 476326147c..940826f331 100644 --- a/indra/newview/llviewerpartsim.cpp +++ b/indra/newview/llviewerpartsim.cpp @@ -397,6 +397,18 @@ void LLViewerPartGroup::shift(const LLVector3 &offset) } } +void LLViewerPartGroup::removeParticlesByID(const U32 source_id) +{ + LLMemType mt(LLMemType::MTYPE_PARTICLES); + S32 end = (S32) mParticles.size(); + for (int i = 0; i < end; i++) + { + if(mParticles[i]->mPartSourcep->getID() == source_id) + { + mParticles[i]->mFlags = LLViewerPart::LL_PART_DEAD_MASK; + } + } +} ////////////////////////////////// // @@ -664,6 +676,10 @@ void LLViewerPartSim::addPartSource(LLPointer<LLViewerPartSource> sourcep) mViewerPartSources.push_back(sourcep); } +void LLViewerPartSim::removeLastCreatedSource() +{ + mViewerPartSources.pop_back(); +} void LLViewerPartSim::cleanupRegion(LLViewerRegion *regionp) { @@ -680,16 +696,32 @@ void LLViewerPartSim::cleanupRegion(LLViewerRegion *regionp) } } -void LLViewerPartSim::cleanMutedParticles(const LLUUID& task_id) +void LLViewerPartSim::clearParticlesByID(const U32 system_id) { LLMemType mt(LLMemType::MTYPE_PARTICLES); - for (source_list_t::iterator i = mViewerPartSources.begin(); i != mViewerPartSources.end(); ) + for (group_list_t::iterator g = mViewerPartGroups.begin(); g != mViewerPartGroups.end(); ++g) { - source_list_t::iterator iter = i++; + (*g)->removeParticlesByID(system_id); + } + for (source_list_t::iterator i = mViewerPartSources.begin(); i != mViewerPartSources.end(); ++i) + { + if ((*i)->getID() == system_id) + { + (*i)->setDead(); + break; + } + } + +} +void LLViewerPartSim::clearParticlesByOwnerID(const LLUUID& task_id) +{ + LLMemType mt(LLMemType::MTYPE_PARTICLES); + for (source_list_t::iterator iter = mViewerPartSources.begin(); iter != mViewerPartSources.end(); ++iter) + { if ((*iter)->getOwnerUUID() == task_id) { - i = mViewerPartSources.erase(iter); + clearParticlesByID((*iter)->getID()); } } } |