aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llcloud.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'linden/indra/newview/llcloud.cpp')
-rw-r--r--linden/indra/newview/llcloud.cpp27
1 files changed, 13 insertions, 14 deletions
diff --git a/linden/indra/newview/llcloud.cpp b/linden/indra/newview/llcloud.cpp
index ca05562..b14f6d5 100644
--- a/linden/indra/newview/llcloud.cpp
+++ b/linden/indra/newview/llcloud.cpp
@@ -116,16 +116,14 @@ void LLCloudGroup::updatePuffs(const F32 dt)
116 mVOCloudsp->setPositionRegion(mCenterRegion); 116 mVOCloudsp->setPositionRegion(mCenterRegion);
117 mVOCloudsp->setScale(LLVector3(256.f/CLOUD_GROUPS_PER_EDGE + CLOUD_PUFF_WIDTH, 117 mVOCloudsp->setScale(LLVector3(256.f/CLOUD_GROUPS_PER_EDGE + CLOUD_PUFF_WIDTH,
118 256.f/CLOUD_GROUPS_PER_EDGE + CLOUD_PUFF_WIDTH, 118 256.f/CLOUD_GROUPS_PER_EDGE + CLOUD_PUFF_WIDTH,
119 CLOUD_HEIGHT_RANGE + CLOUD_PUFF_HEIGHT)); 119 CLOUD_HEIGHT_RANGE + CLOUD_PUFF_HEIGHT)*0.5f);
120 gPipeline.addObject(mVOCloudsp); 120 gPipeline.addObject(mVOCloudsp);
121 } 121 }
122 122
123 S32 i;
124
125 LLVector3 velocity; 123 LLVector3 velocity;
126 LLVector3d vel_d; 124 LLVector3d vel_d;
127 // Update the positions of all of the clouds 125 // Update the positions of all of the clouds
128 for (i = 0; i < mCloudPuffs.count(); i++) 126 for (U32 i = 0; i < mCloudPuffs.size(); i++)
129 { 127 {
130 LLCloudPuff &puff = mCloudPuffs[i]; 128 LLCloudPuff &puff = mCloudPuffs[i];
131 velocity = mCloudLayerp->getRegion()->mWind.getCloudVelocity(mCloudLayerp->getRegion()->getPosRegionFromGlobal(puff.mPositionGlobal)); 129 velocity = mCloudLayerp->getRegion()->mWind.getCloudVelocity(mCloudLayerp->getRegion()->getPosRegionFromGlobal(puff.mPositionGlobal));
@@ -140,8 +138,8 @@ void LLCloudGroup::updatePuffs(const F32 dt)
140 138
141void LLCloudGroup::updatePuffOwnership() 139void LLCloudGroup::updatePuffOwnership()
142{ 140{
143 S32 i = 0; 141 U32 i = 0;
144 while (i < mCloudPuffs.count()) 142 while (i < mCloudPuffs.size())
145 { 143 {
146 if (mCloudPuffs[i].getLifeState() == LL_PUFF_DYING) 144 if (mCloudPuffs[i].getLifeState() == LL_PUFF_DYING)
147 { 145 {
@@ -165,10 +163,11 @@ void LLCloudGroup::updatePuffOwnership()
165 continue; 163 continue;
166 } 164 }
167 //llinfos << "Puff handed off!" << llendl; 165 //llinfos << "Puff handed off!" << llendl;
168 LLCloudPuff *puffp = new_cgp->mCloudPuffs.reserve_block(1); 166 LLCloudPuff puff;
169 puffp->mPositionGlobal = mCloudPuffs[i].mPositionGlobal; 167 puff.mPositionGlobal = mCloudPuffs[i].mPositionGlobal;
170 puffp->mAlpha = mCloudPuffs[i].mAlpha; 168 puff.mAlpha = mCloudPuffs[i].mAlpha;
171 mCloudPuffs.remove(i); 169 mCloudPuffs.erase(mCloudPuffs.begin() + i);
170 new_cgp->mCloudPuffs.push_back(puff);
172 } 171 }
173 172
174 //llinfos << "Puff count: " << LLCloudPuff::sPuffCount << llendl; 173 //llinfos << "Puff count: " << LLCloudPuff::sPuffCount << llendl;
@@ -184,7 +183,7 @@ void LLCloudGroup::updatePuffCount()
184 S32 target_puff_count = llround(CLOUD_DENSITY * mDensity); 183 S32 target_puff_count = llround(CLOUD_DENSITY * mDensity);
185 target_puff_count = llmax(0, target_puff_count); 184 target_puff_count = llmax(0, target_puff_count);
186 target_puff_count = llmin(CLOUD_COUNT_MAX, target_puff_count); 185 target_puff_count = llmin(CLOUD_COUNT_MAX, target_puff_count);
187 S32 current_puff_count = mCloudPuffs.count(); 186 S32 current_puff_count = (S32) mCloudPuffs.size();
188 // Create a new cloud if we need one 187 // Create a new cloud if we need one
189 if (current_puff_count < target_puff_count) 188 if (current_puff_count < target_puff_count)
190 { 189 {
@@ -205,7 +204,7 @@ void LLCloudGroup::updatePuffCount()
205 204
206 // Count the number of live puffs 205 // Count the number of live puffs
207 S32 live_puff_count = 0; 206 S32 live_puff_count = 0;
208 for (i = 0; i < mCloudPuffs.count(); i++) 207 for (i = 0; i < (S32) mCloudPuffs.size(); i++)
209 { 208 {
210 if (mCloudPuffs[i].getLifeState() != LL_PUFF_DYING) 209 if (mCloudPuffs[i].getLifeState() != LL_PUFF_DYING)
211 { 210 {
@@ -231,12 +230,12 @@ void LLCloudGroup::updatePuffCount()
231 230
232 // Remove fully dead puffs 231 // Remove fully dead puffs
233 i = 0; 232 i = 0;
234 while (i < mCloudPuffs.count()) 233 while (i < (S32) mCloudPuffs.size())
235 { 234 {
236 if (mCloudPuffs[i].isDead()) 235 if (mCloudPuffs[i].isDead())
237 { 236 {
238 //llinfos << "Removing dead puff!" << llendl; 237 //llinfos << "Removing dead puff!" << llendl;
239 mCloudPuffs.remove(i); 238 mCloudPuffs.erase(mCloudPuffs.begin() + i);
240 LLCloudPuff::sPuffCount--; 239 LLCloudPuff::sPuffCount--;
241 } 240 }
242 else 241 else