diff options
| author | Xiaohong Bao <bao@lindenlab.com> | 2010-07-14 15:03:58 -0600 |
|---|---|---|
| committer | Xiaohong Bao <bao@lindenlab.com> | 2010-07-14 15:03:58 -0600 |
| commit | 2d683ebf749ed153dcf3260e0f629252507ccd40 (patch) | |
| tree | 8e7f5fe1be856c0efe6136163ebf4b1acd515439 /indra/newview/llvograss.cpp | |
| parent | 5ef9f7e0db631664a07c7c7631b0913de6799d24 (diff) | |
| parent | 493d99c6845a8c93f545424c7b8379fce87ee2fd (diff) | |
Automated merge with ssh://hg.lindenlab.com/q/viewer-release
Diffstat (limited to 'indra/newview/llvograss.cpp')
| -rw-r--r-- | indra/newview/llvograss.cpp | 56 |
1 files changed, 54 insertions, 2 deletions
diff --git a/indra/newview/llvograss.cpp b/indra/newview/llvograss.cpp index a82afbeb76..8a58a9c65b 100644 --- a/indra/newview/llvograss.cpp +++ b/indra/newview/llvograss.cpp @@ -53,6 +53,7 @@ #include "llworld.h" #include "lldir.h" #include "llxmltree.h" +#include "llvotree.h" const S32 GRASS_MAX_BLADES = 32; const F32 GRASS_BLADE_BASE = 0.25f; // Width of grass at base @@ -294,6 +295,23 @@ BOOL LLVOGrass::idleUpdate(LLAgent &agent, LLWorld &world, const F64 &time) return TRUE; } + if(LLVOTree::isTreeRenderingStopped()) //stop rendering grass + { + if(mNumBlades) + { + mNumBlades = 0 ; + gPipeline.markRebuild(mDrawable, LLDrawable::REBUILD_ALL, TRUE); + } + return TRUE ; + } + else if(!mNumBlades)//restart grass rendering + { + mNumBlades = GRASS_MAX_BLADES ; + gPipeline.markRebuild(mDrawable, LLDrawable::REBUILD_ALL, TRUE); + + return TRUE ; + } + if (mPatch && (mLastPatchUpdateTime != mPatch->getLastUpdateTime())) { gPipeline.markRebuild(mDrawable, LLDrawable::REBUILD_VOLUME, TRUE); @@ -340,7 +358,20 @@ BOOL LLVOGrass::updateLOD() { return FALSE; } - + if(LLVOTree::isTreeRenderingStopped()) + { + if(mNumBlades) + { + mNumBlades = 0 ; + gPipeline.markRebuild(mDrawable, LLDrawable::REBUILD_ALL, TRUE); + } + return TRUE ; + } + if(!mNumBlades) + { + mNumBlades = GRASS_MAX_BLADES; + } + LLFace* face = mDrawable->getFace(0); F32 tan_angle = 0.f; @@ -387,8 +418,24 @@ static LLFastTimer::DeclareTimer FTM_UPDATE_GRASS("Update Grass"); BOOL LLVOGrass::updateGeometry(LLDrawable *drawable) { LLFastTimer ftm(FTM_UPDATE_GRASS); + dirtySpatialGroup(); - plantBlades(); + + if(!mNumBlades)//stop rendering grass + { + if (mDrawable->getNumFaces() > 0) + { + LLFace* facep = mDrawable->getFace(0); + if(facep) + { + facep->setSize(0, 0); + } + } + } + else + { + plantBlades(); + } return TRUE; } @@ -429,6 +476,11 @@ void LLVOGrass::getGeometry(S32 idx, LLStrider<LLColor4U>& colorsp, LLStrider<U16>& indicesp) { + if(!mNumBlades)//stop rendering grass + { + return ; + } + mPatch = mRegionp->getLand().resolvePatchRegion(getPositionRegion()); if (mPatch) mLastPatchUpdateTime = mPatch->getLastUpdateTime(); |
