Crude port of megaregion mem corruption fix, by Rev

This commit is contained in:
Siana Gearz
2011-08-18 22:15:04 +02:00
parent 9d05a11ef0
commit 6b60fe40c6
4 changed files with 9 additions and 11 deletions

View File

@@ -176,6 +176,7 @@ void LLSurface::create(const S32 grids_per_edge,
mNumberOfPatches = mPatchesPerEdge * mPatchesPerEdge;
mMetersPerGrid = width / ((F32)(mGridsPerEdge - 1));
mMetersPerEdge = mMetersPerGrid * (mGridsPerEdge - 1);
sTextureSize = width;
mOriginGlobal.setVec(origin_global);

View File

@@ -139,9 +139,6 @@ LLViewerParcelMgr::LLViewerParcelMgr()
mCollisionParcel = new LLParcel();
mBlockedImage = LLViewerTextureManager::getFetchedTextureFromFile("noentrylines.j2c");
mPassImage = LLViewerTextureManager::getFetchedTextureFromFile("noentrypasslines.j2c");
init(256);
}
//moved this stuff out of the constructor and into a function that we can call again after we get the region size.
@@ -149,7 +146,7 @@ LLViewerParcelMgr::LLViewerParcelMgr()
//on a single grid properly - Patrick Sapinski (2/10/2011)
void LLViewerParcelMgr::init(F32 region_size)
{
mParcelsPerEdge = S32( REGION_WIDTH_METERS / PARCEL_GRID_STEP_METERS );
mParcelsPerEdge = S32( region_size / PARCEL_GRID_STEP_METERS );
mHighlightSegments = new U8[(mParcelsPerEdge+1)*(mParcelsPerEdge+1)];
resetSegments(mHighlightSegments);

View File

@@ -242,9 +242,9 @@ LLViewerRegion::LLViewerRegion(const U64 &handle,
mCacheLoaded(FALSE),
mCacheDirty(FALSE),
mReleaseNotesRequested(FALSE),
mCapabilitiesReceived(false)
mCapabilitiesReceived(false),
mWidth(region_width_meters)
{
mWidth = region_width_meters;
mImpl->mOriginGlobal = from_region_handle(handle);
updateRenderMatrix();
@@ -256,7 +256,7 @@ LLViewerRegion::LLViewerRegion(const U64 &handle,
mImpl->mCompositionp =
new LLVLComposition(mImpl->mLandp,
grids_per_region_edge,
region_width_meters / grids_per_region_edge);
mWidth / grids_per_region_edge);
mImpl->mCompositionp->setSurface(mImpl->mLandp);
// Create the surfaces
@@ -269,9 +269,9 @@ LLViewerRegion::LLViewerRegion(const U64 &handle,
if (!gNoRender)
{
mParcelOverlay = new LLViewerParcelOverlay(this, region_width_meters);
//Re-init the parcel mgr for this sim
LLViewerParcelMgr::getInstance()->init(region_width_meters);
mParcelOverlay = new LLViewerParcelOverlay(this, mWidth);
//Re-init the parcel mgr for this sim
LLViewerParcelMgr::getInstance()->init(mWidth);
}
else
{

View File

@@ -163,7 +163,7 @@ BOOL LLVLComposition::generateHeights(const F32 x, const F32 y,
const F32 xyScaleInv = (1.f / xyScale);
const F32 zScaleInv = (1.f / zScale);
const F32 inv_width = 1.f/mWidth;
const F32 inv_width = 1.f/256.f;
// OK, for now, just have the composition value equal the height at the point.
for (S32 j = y_begin; j < y_end; j++)