diff options
Diffstat (limited to '')
-rw-r--r-- | linden/indra/newview/llvograss.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/linden/indra/newview/llvograss.cpp b/linden/indra/newview/llvograss.cpp index f9b4bc0..a0e98ce 100644 --- a/linden/indra/newview/llvograss.cpp +++ b/linden/indra/newview/llvograss.cpp | |||
@@ -176,7 +176,8 @@ void LLVOGrass::initClass() | |||
176 | 176 | ||
177 | static LLStdStringHandle texture_name_string = LLXmlTree::addAttributeString("texture_name"); | 177 | static LLStdStringHandle texture_name_string = LLXmlTree::addAttributeString("texture_name"); |
178 | success &= grass_def->getFastAttributeString(texture_name_string, textureName); | 178 | success &= grass_def->getFastAttributeString(texture_name_string, textureName); |
179 | newGrass->mTextureID.set( gViewerArt.getString(textureName) ); | 179 | LLViewerImage* grass_image = gImageList.getImageFromFile(textureName); |
180 | newGrass->mTextureID = grass_image->getID(); | ||
180 | } | 181 | } |
181 | 182 | ||
182 | static LLStdStringHandle blade_sizex_string = LLXmlTree::addAttributeString("blade_size_x"); | 183 | static LLStdStringHandle blade_sizex_string = LLXmlTree::addAttributeString("blade_size_x"); |
@@ -330,7 +331,7 @@ void LLVOGrass::setPixelAreaAndAngle(LLAgent &agent) | |||
330 | mAppAngle = (F32) atan2( max_scale, range) * RAD_TO_DEG; | 331 | mAppAngle = (F32) atan2( max_scale, range) * RAD_TO_DEG; |
331 | 332 | ||
332 | // Compute pixels per meter at the given range | 333 | // Compute pixels per meter at the given range |
333 | F32 pixels_per_meter = gCamera->getViewHeightInPixels() / (tan(gCamera->getView()) * range); | 334 | F32 pixels_per_meter = LLViewerCamera::getInstance()->getViewHeightInPixels() / (tan(LLViewerCamera::getInstance()->getView()) * range); |
334 | 335 | ||
335 | // Assume grass texture is a 5 meter by 5 meter sprite at the grass object's center | 336 | // Assume grass texture is a 5 meter by 5 meter sprite at the grass object's center |
336 | mPixelArea = (pixels_per_meter) * (pixels_per_meter) * 25.f; | 337 | mPixelArea = (pixels_per_meter) * (pixels_per_meter) * 25.f; |
@@ -430,7 +431,7 @@ void LLVOGrass::plantBlades() | |||
430 | face->setTEOffset(0); | 431 | face->setTEOffset(0); |
431 | face->mCenterLocal = mPosition + mRegionp->getOriginAgent(); | 432 | face->mCenterLocal = mPosition + mRegionp->getOriginAgent(); |
432 | 433 | ||
433 | mDepth = (face->mCenterLocal - gCamera->getOrigin())*gCamera->getAtAxis(); | 434 | mDepth = (face->mCenterLocal - LLViewerCamera::getInstance()->getOrigin())*LLViewerCamera::getInstance()->getAtAxis(); |
434 | mDrawable->setPosition(face->mCenterLocal); | 435 | mDrawable->setPosition(face->mCenterLocal); |
435 | mDrawable->movePartition(); | 436 | mDrawable->movePartition(); |
436 | LLPipeline::sCompiles++; | 437 | LLPipeline::sCompiles++; |