diff options
Diffstat (limited to 'linden/indra/llmath/llvolume.cpp')
-rw-r--r-- | linden/indra/llmath/llvolume.cpp | 49 |
1 files changed, 43 insertions, 6 deletions
diff --git a/linden/indra/llmath/llvolume.cpp b/linden/indra/llmath/llvolume.cpp index 7b6c6a9..5603a9c 100644 --- a/linden/indra/llmath/llvolume.cpp +++ b/linden/indra/llmath/llvolume.cpp | |||
@@ -3,7 +3,7 @@ | |||
3 | * | 3 | * |
4 | * $LicenseInfo:firstyear=2002&license=viewergpl$ | 4 | * $LicenseInfo:firstyear=2002&license=viewergpl$ |
5 | * | 5 | * |
6 | * Copyright (c) 2002-2008, Linden Research, Inc. | 6 | * Copyright (c) 2002-2009, Linden Research, Inc. |
7 | * | 7 | * |
8 | * Second Life Viewer Source Code | 8 | * Second Life Viewer Source Code |
9 | * The source code in this file ("Source Code") is provided by Linden Lab | 9 | * The source code in this file ("Source Code") is provided by Linden Lab |
@@ -1650,9 +1650,13 @@ void LLPathParams::copyParams(const LLPathParams ¶ms) | |||
1650 | setSkew(params.getSkew()); | 1650 | setSkew(params.getSkew()); |
1651 | } | 1651 | } |
1652 | 1652 | ||
1653 | S32 profile_delete_lock = 1 ; | ||
1653 | LLProfile::~LLProfile() | 1654 | LLProfile::~LLProfile() |
1654 | { | 1655 | { |
1655 | 1656 | if(profile_delete_lock) | |
1657 | { | ||
1658 | llerrs << "LLProfile should not be deleted here!" << llendl ; | ||
1659 | } | ||
1656 | } | 1660 | } |
1657 | 1661 | ||
1658 | 1662 | ||
@@ -1709,7 +1713,11 @@ LLVolume::~LLVolume() | |||
1709 | { | 1713 | { |
1710 | sNumMeshPoints -= mMesh.size(); | 1714 | sNumMeshPoints -= mMesh.size(); |
1711 | delete mPathp; | 1715 | delete mPathp; |
1716 | |||
1717 | profile_delete_lock = 0 ; | ||
1712 | delete mProfilep; | 1718 | delete mProfilep; |
1719 | profile_delete_lock = 1 ; | ||
1720 | |||
1713 | mPathp = NULL; | 1721 | mPathp = NULL; |
1714 | mProfilep = NULL; | 1722 | mProfilep = NULL; |
1715 | mVolumeFaces.clear(); | 1723 | mVolumeFaces.clear(); |
@@ -1754,18 +1762,47 @@ BOOL LLVolume::generate() | |||
1754 | mLODScaleBias.setVec(0.6f, 0.6f, 0.6f); | 1762 | mLODScaleBias.setVec(0.6f, 0.6f, 0.6f); |
1755 | } | 1763 | } |
1756 | 1764 | ||
1765 | //******************************************************************** | ||
1766 | //debug info, to be removed | ||
1767 | if((U32)(mPathp->mPath.size() * mProfilep->mProfile.size()) > (1u << 20)) | ||
1768 | { | ||
1769 | llinfos << "sizeS: " << mPathp->mPath.size() << " sizeT: " << mProfilep->mProfile.size() << llendl ; | ||
1770 | llinfos << "path_detail : " << path_detail << " split: " << split << " profile_detail: " << profile_detail << llendl ; | ||
1771 | llinfos << mParams << llendl ; | ||
1772 | llinfos << "more info to check if mProfilep is deleted or not." << llendl ; | ||
1773 | llinfos << mProfilep->mNormals.size() << " : " << mProfilep->mFaces.size() << " : " << mProfilep->mEdgeNormals.size() << " : " << mProfilep->mEdgeCenters.size() << llendl ; | ||
1774 | |||
1775 | llerrs << "LLVolume corrupted!" << llendl ; | ||
1776 | } | ||
1777 | //******************************************************************** | ||
1778 | |||
1757 | BOOL regenPath = mPathp->generate(mParams.getPathParams(), path_detail, split); | 1779 | BOOL regenPath = mPathp->generate(mParams.getPathParams(), path_detail, split); |
1758 | BOOL regenProf = mProfilep->generate(mParams.getProfileParams(), mPathp->isOpen(),profile_detail, split); | 1780 | BOOL regenProf = mProfilep->generate(mParams.getProfileParams(), mPathp->isOpen(),profile_detail, split); |
1759 | 1781 | ||
1760 | if (regenPath || regenProf ) | 1782 | if (regenPath || regenProf ) |
1761 | { | 1783 | { |
1762 | sNumMeshPoints -= mMesh.size(); | ||
1763 | mMesh.resize(mProfilep->mProfile.size() * mPathp->mPath.size()); | ||
1764 | sNumMeshPoints += mMesh.size(); | ||
1765 | |||
1766 | S32 sizeS = mPathp->mPath.size(); | 1784 | S32 sizeS = mPathp->mPath.size(); |
1767 | S32 sizeT = mProfilep->mProfile.size(); | 1785 | S32 sizeT = mProfilep->mProfile.size(); |
1768 | 1786 | ||
1787 | //******************************************************************** | ||
1788 | //debug info, to be removed | ||
1789 | if((U32)(sizeS * sizeT) > (1u << 20)) | ||
1790 | { | ||
1791 | llinfos << "regenPath: " << (S32)regenPath << " regenProf: " << (S32)regenProf << llendl ; | ||
1792 | llinfos << "sizeS: " << sizeS << " sizeT: " << sizeT << llendl ; | ||
1793 | llinfos << "path_detail : " << path_detail << " split: " << split << " profile_detail: " << profile_detail << llendl ; | ||
1794 | llinfos << mParams << llendl ; | ||
1795 | llinfos << "more info to check if mProfilep is deleted or not." << llendl ; | ||
1796 | llinfos << mProfilep->mNormals.size() << " : " << mProfilep->mFaces.size() << " : " << mProfilep->mEdgeNormals.size() << " : " << mProfilep->mEdgeCenters.size() << llendl ; | ||
1797 | |||
1798 | llerrs << "LLVolume corrupted!" << llendl ; | ||
1799 | } | ||
1800 | //******************************************************************** | ||
1801 | |||
1802 | sNumMeshPoints -= mMesh.size(); | ||
1803 | mMesh.resize(sizeT * sizeS); | ||
1804 | sNumMeshPoints += mMesh.size(); | ||
1805 | |||
1769 | //generate vertex positions | 1806 | //generate vertex positions |
1770 | 1807 | ||
1771 | // Run along the path. | 1808 | // Run along the path. |