summaryrefslogtreecommitdiff
path: root/indra/newview/llviewerpartsource.cpp
diff options
context:
space:
mode:
authorSteven Bennetts <steve@lindenlab.com>2008-04-01 17:45:04 +0000
committerSteven Bennetts <steve@lindenlab.com>2008-04-01 17:45:04 +0000
commit941cb9f4124c9ccfd5c845bc94639fa46df12c3d (patch)
treee0f525e7bd6cc76d89b2df69c6f1554d191561e8 /indra/newview/llviewerpartsource.cpp
parentecec626dec93524f7ef5831a5ba344d6449b99bc (diff)
merge release@83343 skinning-1-merge@83714 -> release
QAR-424
Diffstat (limited to 'indra/newview/llviewerpartsource.cpp')
-rw-r--r--indra/newview/llviewerpartsource.cpp40
1 files changed, 16 insertions, 24 deletions
diff --git a/indra/newview/llviewerpartsource.cpp b/indra/newview/llviewerpartsource.cpp
index db356064d4..3c3b1bf3ff 100644
--- a/indra/newview/llviewerpartsource.cpp
+++ b/indra/newview/llviewerpartsource.cpp
@@ -97,9 +97,7 @@ LLViewerPartSourceScript::LLViewerPartSourceScript(LLViewerObject *source_objp)
llassert(source_objp);
mSourceObjectp = source_objp;
mPosAgent = mSourceObjectp->getPositionAgent();
- LLUUID id;
- id.set( gViewerArt.getString("pixiesmall.tga") );
- mImagep = gImageList.getImage(id);
+ mImagep = gImageList.getImageFromFile("pixiesmall.j2c");
mImagep->bind();
mImagep->setClamp(TRUE, TRUE);
}
@@ -122,7 +120,7 @@ void LLViewerPartSourceScript::update(const F32 dt)
F32 old_update_time = mLastUpdateTime;
mLastUpdateTime += dt;
- F32 ref_rate_travelspeed = llmin(gWorldPointer->mPartSim.getRefRate(), 1.f);
+ F32 ref_rate_travelspeed = llmin(LLViewerPartSim::getInstance()->getRefRate(), 1.f);
F32 dt_update = mLastUpdateTime - mLastPartTime;
@@ -212,7 +210,7 @@ void LLViewerPartSourceScript::update(const F32 dt)
mRotation.setQuat(0, 0, 0);
}
- if (gWorldPointer->mPartSim.aboveParticleLimit())
+ if (LLViewerPartSim::getInstance()->aboveParticleLimit())
{
// Don't bother doing any more updates if we're above the particle limit,
// just give up.
@@ -234,7 +232,7 @@ void LLViewerPartSourceScript::update(const F32 dt)
(mPartSysData.mPartData.mStartScale[1]
+ mPartSysData.mPartData.mEndScale[1])/2));
- F32 pixel_meter_ratio = gCamera->getPixelMeterRatio();
+ F32 pixel_meter_ratio = LLViewerCamera::getInstance()->getPixelMeterRatio();
// Maximum distance at which spawned particles will be viewable
F32 max_dist = max_short_side * pixel_meter_ratio;
@@ -249,7 +247,7 @@ void LLViewerPartSourceScript::update(const F32 dt)
}
// Distance from camera
- F32 dist = (mPosAgent - gCamera->getOrigin()).magVec();
+ F32 dist = (mPosAgent - LLViewerCamera::getInstance()->getOrigin()).magVec();
// Particle size vs distance vs maxage throttling
@@ -273,7 +271,7 @@ void LLViewerPartSourceScript::update(const F32 dt)
S32 i;
for (i = 0; i < mPartSysData.mBurstPartCount; i++)
{
- if (ll_frand() < llmax(1.0f - gWorldPointer->mPartSim.getBurstRate(), limited_rate))
+ if (ll_frand() < llmax(1.0f - LLViewerPartSim::getInstance()->getBurstRate(), limited_rate))
{
// Limit particle generation
continue;
@@ -384,7 +382,7 @@ void LLViewerPartSourceScript::update(const F32 dt)
mPartSysData.mBurstRadius = 0;
}
- gWorldPointer->mPartSim.addPart(part);
+ LLViewerPartSim::getInstance()->addPart(part);
}
mLastPartTime = mLastUpdateTime;
@@ -527,9 +525,7 @@ void LLViewerPartSourceSpiral::update(const F32 dt)
LLMemType mt(LLMemType::MTYPE_PARTICLES);
if (!mImagep)
{
- LLUUID id;
- id.set( gViewerArt.getString("pixiesmall.tga") );
- mImagep = gImageList.getImage(id);
+ mImagep = gImageList.getImageFromFile("pixiesmall.j2c");
}
const F32 RATE = 0.025f;
@@ -543,7 +539,7 @@ void LLViewerPartSourceSpiral::update(const F32 dt)
if (dt_update > RATE)
{
mLastPartTime = mLastUpdateTime;
- if (!gWorldPointer->mPartSim.shouldAddPart())
+ if (!LLViewerPartSim::getInstance()->shouldAddPart())
{
// Particle simulation says we have too many particles, skip all this
return;
@@ -566,7 +562,7 @@ void LLViewerPartSourceSpiral::update(const F32 dt)
part->mScale.mV[1] = 0.25f;
part->mParameter = ll_frand(F_TWO_PI);
- gWorldPointer->mPartSim.addPart(part);
+ LLViewerPartSim::getInstance()->addPart(part);
}
}
@@ -690,7 +686,7 @@ void LLViewerPartSourceBeam::update(const F32 dt)
if (dt_update > RATE)
{
mLastPartTime = mLastUpdateTime;
- if (!gWorldPointer->mPartSim.shouldAddPart())
+ if (!LLViewerPartSim::getInstance()->shouldAddPart())
{
// Particle simulation says we have too many particles, skip all this
return;
@@ -698,9 +694,7 @@ void LLViewerPartSourceBeam::update(const F32 dt)
if (!mImagep)
{
- LLUUID id;
- id.set( gViewerArt.getString("pixiesmall.tga") );
- mImagep = gImageList.getImage(id);
+ mImagep = gImageList.getImageFromFile("pixiesmall.j2c");
}
LLPointer<LLViewerPart> part = new LLViewerPart();
@@ -723,7 +717,7 @@ void LLViewerPartSourceBeam::update(const F32 dt)
part->mPosAgent = mPosAgent;
part->mVelocity = mTargetPosAgent - mPosAgent;
- gWorldPointer->mPartSim.addPart(part);
+ LLViewerPartSim::getInstance()->addPart(part);
}
}
@@ -786,9 +780,7 @@ void LLViewerPartSourceChat::update(const F32 dt)
LLMemType mt(LLMemType::MTYPE_PARTICLES);
if (!mImagep)
{
- LLUUID id;
- id.set( gViewerArt.getString("pixiesmall.tga") );
- mImagep = gImageList.getImage(id);
+ mImagep = gImageList.getImageFromFile("pixiesmall.j2c");
}
@@ -812,7 +804,7 @@ void LLViewerPartSourceChat::update(const F32 dt)
if (dt_update > RATE)
{
mLastPartTime = mLastUpdateTime;
- if (!gWorldPointer->mPartSim.shouldAddPart())
+ if (!LLViewerPartSim::getInstance()->shouldAddPart())
{
// Particle simulation says we have too many particles, skip all this
return;
@@ -835,7 +827,7 @@ void LLViewerPartSourceChat::update(const F32 dt)
part->mScale.mV[1] = 0.25f;
part->mParameter = ll_frand(F_TWO_PI);
- gWorldPointer->mPartSim.addPart(part);
+ LLViewerPartSim::getInstance()->addPart(part);
}
}