diff options
-rw-r--r-- | indra/llappearance/llpolymesh.cpp | 8 | ||||
-rw-r--r-- | indra/llappearance/llpolymorph.cpp | 4 | ||||
-rw-r--r-- | indra/llmath/llvolume.cpp | 39 | ||||
-rw-r--r-- | indra/llmath/llvolume.h | 10 | ||||
-rw-r--r-- | indra/newview/llspatialpartition.cpp | 4 | ||||
-rw-r--r-- | indra/newview/llviewerwindow.cpp | 7 | ||||
-rw-r--r-- | indra/newview/llvoicevivox.cpp | 9 | ||||
-rw-r--r-- | indra/newview/llvovolume.cpp | 4 |
8 files changed, 52 insertions, 33 deletions
diff --git a/indra/llappearance/llpolymesh.cpp b/indra/llappearance/llpolymesh.cpp index 0a7a8d27bb..3892e4ce43 100644 --- a/indra/llappearance/llpolymesh.cpp +++ b/indra/llappearance/llpolymesh.cpp @@ -612,14 +612,16 @@ BOOL LLPolyMeshSharedData::loadMesh( const std::string& fileName ) // we reached the end of the morphs break; } - LLPolyMorphData* morph_data = new LLPolyMorphData(std::string(morphName)); + std::string morph_name(morphName); + LLPolyMorphData* morph_data = new LLPolyMorphData(morph_name); BOOL result = morph_data->loadBinary(fp, this); if (!result) { - delete morph_data; - continue; + LL_WARNS() << "Failure loading " << morph_name << " from " << fileName << LL_ENDL; + delete morph_data; + continue; } mMorphData.insert(morph_data); diff --git a/indra/llappearance/llpolymorph.cpp b/indra/llappearance/llpolymorph.cpp index 16b5f1e204..84dd6156a9 100644 --- a/indra/llappearance/llpolymorph.cpp +++ b/indra/llappearance/llpolymorph.cpp @@ -156,7 +156,9 @@ BOOL LLPolyMorphData::loadBinary(LLFILE *fp, LLPolyMeshSharedData *mesh) if (mVertexIndices[v] > 10000) { - LL_ERRS() << "Bad morph index: " << mVertexIndices[v] << LL_ENDL; + // Bad install? These are usually .llm files from 'character' fodler + LL_WARNS() << "Bad morph index " << v << ": " << mVertexIndices[v] << LL_ENDL; + return FALSE; } diff --git a/indra/llmath/llvolume.cpp b/indra/llmath/llvolume.cpp index 55778fce3a..5de1fe5a8d 100644 --- a/indra/llmath/llvolume.cpp +++ b/indra/llmath/llvolume.cpp @@ -4146,13 +4146,13 @@ S32 LLVolume::lineSegmentIntersect(const LLVector4a& start, const LLVector4a& en } else { - if (!face.mOctree) + if (!face.getOctree()) { face.createOctree(); } LLOctreeTriangleRayIntersect intersect(start, dir, &face, &closest_t, intersection, tex_coord, normal, tangent_out); - intersect.traverse(face.mOctree); + intersect.traverse(face.getOctree()); if (intersect.mHitFace) { hit_face = i; @@ -4707,6 +4707,7 @@ LLVolumeFace::LLVolumeFace() : #endif mWeightsScrubbed(FALSE), mOctree(NULL), + mOctreeTriangles(NULL), mOptimized(FALSE) { mExtents = (LLVector4a*) ll_aligned_malloc_16(sizeof(LLVector4a)*3); @@ -4736,8 +4737,9 @@ LLVolumeFace::LLVolumeFace(const LLVolumeFace& src) mJointIndices(NULL), #endif mWeightsScrubbed(FALSE), - mOctree(NULL) -{ + mOctree(NULL), + mOctreeTriangles(NULL) +{ mExtents = (LLVector4a*) ll_aligned_malloc_16(sizeof(LLVector4a)*3); mCenter = mExtents+2; *this = src; @@ -4877,10 +4879,7 @@ void LLVolumeFace::freeData() mJustWeights = NULL; #endif - delete mOctree; - mOctree = NULL; - mOctreeTriangles.clear(); - mOctreeTriangles.shrink_to_fit(); + destroyOctree(); } BOOL LLVolumeFace::create(LLVolume* volume, BOOL partial_build) @@ -4888,10 +4887,7 @@ BOOL LLVolumeFace::create(LLVolume* volume, BOOL partial_build) LL_PROFILE_ZONE_SCOPED_CATEGORY_VOLUME //tree for this face is no longer valid - delete mOctree; - mOctree = NULL; - mOctreeTriangles.clear(); - mOctreeTriangles.shrink_to_fit(); + destroyOctree(); LL_CHECK_MEMORY BOOL ret = FALSE ; @@ -5560,7 +5556,7 @@ void LLVolumeFace::createOctree(F32 scaler, const LLVector4a& center, const LLVe { LL_PROFILE_ZONE_SCOPED_CATEGORY_VOLUME - if (mOctree) + if (getOctree()) { return; } @@ -5569,11 +5565,9 @@ void LLVolumeFace::createOctree(F32 scaler, const LLVector4a& center, const LLVe mOctree = new LLOctreeRoot<LLVolumeTriangle, LLVolumeTriangle*>(center, size, NULL); new LLVolumeOctreeListener(mOctree); - // Clear old triangles, but keep the underlying storage pointer - mOctreeTriangles.clear(); const U32 num_triangles = mNumIndices / 3; // Initialize all the triangles we need - mOctreeTriangles.resize(num_triangles); + mOctreeTriangles = new LLVolumeTriangle[num_triangles]; for (U32 triangle_index = 0; triangle_index < num_triangles; ++triangle_index) { //for each triangle @@ -5635,6 +5629,19 @@ void LLVolumeFace::createOctree(F32 scaler, const LLVector4a& center, const LLVe } } +void LLVolumeFace::destroyOctree() +{ + delete mOctree; + mOctree = NULL; + delete[] mOctreeTriangles; + mOctreeTriangles = NULL; +} + +const LLOctreeNode<LLVolumeTriangle, LLVolumeTriangle*>* LLVolumeFace::getOctree() const +{ + return mOctree; +} + void LLVolumeFace::swapData(LLVolumeFace& rhs) { diff --git a/indra/llmath/llvolume.h b/indra/llmath/llvolume.h index da155c7b41..a984aa127e 100644 --- a/indra/llmath/llvolume.h +++ b/indra/llmath/llvolume.h @@ -907,6 +907,9 @@ public: bool cacheOptimize(); void createOctree(F32 scaler = 0.25f, const LLVector4a& center = LLVector4a(0,0,0), const LLVector4a& size = LLVector4a(0.5f,0.5f,0.5f)); + void destroyOctree(); + // Get a reference to the octree, which may be null + const LLOctreeNode<LLVolumeTriangle, LLVolumeTriangle*>* getOctree() const; enum { @@ -974,15 +977,14 @@ public: // Which joints are rigged to, and the bounding box of any rigged // vertices per joint. LLJointRiggingInfoTab mJointRiggingInfoTab; - - // This octree stores raw pointer references to triangles in mOctreeTriangles - LLOctreeNode<LLVolumeTriangle, LLVolumeTriangle*>* mOctree; - std::vector<LLVolumeTriangle> mOctreeTriangles; //whether or not face has been cache optimized BOOL mOptimized; private: + LLOctreeNode<LLVolumeTriangle, LLVolumeTriangle*>* mOctree; + LLVolumeTriangle* mOctreeTriangles; + BOOL createUnCutCubeCap(LLVolume* volume, BOOL partial_build = FALSE); BOOL createCap(LLVolume* volume, BOOL partial_build = FALSE); BOOL createSide(LLVolume* volume, BOOL partial_build = FALSE); diff --git a/indra/newview/llspatialpartition.cpp b/indra/newview/llspatialpartition.cpp index 9cfbe99df4..42cd1133a2 100644 --- a/indra/newview/llspatialpartition.cpp +++ b/indra/newview/llspatialpartition.cpp @@ -3223,14 +3223,14 @@ void renderRaycast(LLDrawable* drawablep) { F32 t = 1.f; - if (!face.mOctree) + if (!face.getOctree()) { ((LLVolumeFace*) &face)->createOctree(); } LLRenderOctreeRaycast render(start, dir, &t); - render.traverse(face.mOctree); + render.traverse(face.getOctree()); } gGL.popMatrix(); diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index bc69fd80db..2deb2928b9 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -2511,10 +2511,11 @@ void LLViewerWindow::reshape(S32 width, S32 height) //glViewport(0, 0, width, height ); - if (height > 0) + LLViewerCamera * camera = LLViewerCamera::getInstance(); // simpleton, might not exist + if (height > 0 && camera) { - LLViewerCamera::getInstance()->setViewHeightInPixels( mWorldViewRectRaw.getHeight() ); - LLViewerCamera::getInstance()->setAspect( getWorldViewAspectRatio() ); + camera->setViewHeightInPixels( mWorldViewRectRaw.getHeight() ); + camera->setAspect( getWorldViewAspectRatio() ); } calcDisplayScale(); diff --git a/indra/newview/llvoicevivox.cpp b/indra/newview/llvoicevivox.cpp index 54f79a3a2e..5f1624d4fd 100644 --- a/indra/newview/llvoicevivox.cpp +++ b/indra/newview/llvoicevivox.cpp @@ -1625,7 +1625,14 @@ bool LLVivoxVoiceClient::requestParcelVoiceInfo() } else { - LL_WARNS("Voice") << "No voice credentials" << LL_ENDL; + if (LLViewerParcelMgr::getInstance()->allowAgentVoice()) + { + LL_WARNS("Voice") << "No voice credentials" << LL_ENDL; + } + else + { + LL_DEBUGS("Voice") << "No voice credentials" << LL_ENDL; + } } // set the spatial channel. If no voice credentials or uri are diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index c4b51c474d..8bf9d12b33 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -4976,9 +4976,7 @@ void LLRiggedVolume::update(const LLMeshSkinInfo* skin, LLVOAvatar* avatar, cons if (rebuild_face_octrees) { - delete dst_face.mOctree; - dst_face.mOctree = NULL; - + dst_face.destroyOctree(); dst_face.createOctree(); } } |