diff options
Diffstat (limited to 'linden/indra/newview/lldrawable.cpp')
-rw-r--r-- | linden/indra/newview/lldrawable.cpp | 24 |
1 files changed, 10 insertions, 14 deletions
diff --git a/linden/indra/newview/lldrawable.cpp b/linden/indra/newview/lldrawable.cpp index 4d9083e..a39416c 100644 --- a/linden/indra/newview/lldrawable.cpp +++ b/linden/indra/newview/lldrawable.cpp | |||
@@ -4,6 +4,7 @@ | |||
4 | * | 4 | * |
5 | * Copyright (c) 2002-2007, Linden Research, Inc. | 5 | * Copyright (c) 2002-2007, Linden Research, Inc. |
6 | * | 6 | * |
7 | * Second Life Viewer Source Code | ||
7 | * The source code in this file ("Source Code") is provided by Linden Lab | 8 | * The source code in this file ("Source Code") is provided by Linden Lab |
8 | * to you under the terms of the GNU General Public License, version 2.0 | 9 | * to you under the terms of the GNU General Public License, version 2.0 |
9 | * ("GPL"), unless you have obtained a separate licensing agreement | 10 | * ("GPL"), unless you have obtained a separate licensing agreement |
@@ -101,7 +102,6 @@ void LLDrawable::init() | |||
101 | mVObjp = NULL; | 102 | mVObjp = NULL; |
102 | // mFaces | 103 | // mFaces |
103 | mSpatialGroupp = NULL; | 104 | mSpatialGroupp = NULL; |
104 | mSpatialGroupOffset = -1; | ||
105 | mVisible = 0; | 105 | mVisible = 0; |
106 | mRadius = 0.f; | 106 | mRadius = 0.f; |
107 | mSunShadowFactor = 1.f; | 107 | mSunShadowFactor = 1.f; |
@@ -273,7 +273,8 @@ LLFace* LLDrawable::addFace(LLFacePool *poolp, LLViewerImage *texturep) | |||
273 | LLMemType mt(LLMemType::MTYPE_DRAWABLE); | 273 | LLMemType mt(LLMemType::MTYPE_DRAWABLE); |
274 | 274 | ||
275 | LLFace *face = new LLFace(this, mVObjp); | 275 | LLFace *face = new LLFace(this, mVObjp); |
276 | 276 | if (!face) llerrs << "Allocating new Face: " << mFaces.size() << llendl; | |
277 | |||
277 | if (face) | 278 | if (face) |
278 | { | 279 | { |
279 | mFaces.push_back(face); | 280 | mFaces.push_back(face); |
@@ -1044,18 +1045,13 @@ void LLDrawable::updateUVMinMax() | |||
1044 | { | 1045 | { |
1045 | } | 1046 | } |
1046 | 1047 | ||
1047 | void LLDrawable::setSpatialGroup(LLSpatialGroup *groupp, const S32 offset) | 1048 | void LLDrawable::setSpatialGroup(LLSpatialGroup *groupp) |
1048 | { | 1049 | { |
1049 | mSpatialGroupp = groupp; | 1050 | if (mSpatialGroupp && (groupp != mSpatialGroupp)) |
1050 | |||
1051 | if (mSpatialGroupp) | ||
1052 | { | 1051 | { |
1053 | mSpatialGroupOffset = offset; | 1052 | mSpatialGroupp->setState(LLSpatialGroup::GEOM_DIRTY); |
1054 | } | 1053 | } |
1055 | else | 1054 | mSpatialGroupp = groupp; |
1056 | { | ||
1057 | mSpatialGroupOffset = -1; | ||
1058 | } | ||
1059 | } | 1055 | } |
1060 | 1056 | ||
1061 | LLSpatialPartition* LLDrawable::getSpatialPartition() | 1057 | LLSpatialPartition* LLDrawable::getSpatialPartition() |
@@ -1429,13 +1425,13 @@ void LLSpatialBridge::cleanupReferences() | |||
1429 | LLDrawable::cleanupReferences(); | 1425 | LLDrawable::cleanupReferences(); |
1430 | if (mDrawable) | 1426 | if (mDrawable) |
1431 | { | 1427 | { |
1432 | mDrawable->setSpatialGroup(NULL, -1); | 1428 | mDrawable->setSpatialGroup(NULL); |
1433 | for (U32 i = 0; i < mDrawable->getChildCount(); i++) | 1429 | for (U32 i = 0; i < mDrawable->getChildCount(); i++) |
1434 | { | 1430 | { |
1435 | LLDrawable* drawable = mDrawable->getChild(i); | 1431 | LLDrawable* drawable = mDrawable->getChild(i); |
1436 | if (drawable && drawable->getVOVolume()) | 1432 | if (drawable) |
1437 | { | 1433 | { |
1438 | drawable->setSpatialGroup(NULL, -1); | 1434 | drawable->setSpatialGroup(NULL); |
1439 | } | 1435 | } |
1440 | } | 1436 | } |
1441 | 1437 | ||