diff --git a/indra/newview/llsurface.cpp b/indra/newview/llsurface.cpp index 5e2ed8694..506d3a8fb 100644 --- a/indra/newview/llsurface.cpp +++ b/indra/newview/llsurface.cpp @@ -176,7 +176,6 @@ 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); diff --git a/indra/newview/llviewerparcelmgr.cpp b/indra/newview/llviewerparcelmgr.cpp index 2f2f1d344..332ba8ed5 100644 --- a/indra/newview/llviewerparcelmgr.cpp +++ b/indra/newview/llviewerparcelmgr.cpp @@ -145,6 +145,9 @@ 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. @@ -152,7 +155,7 @@ LLViewerParcelMgr::LLViewerParcelMgr() //on a single grid properly - Patrick Sapinski (2/10/2011) void LLViewerParcelMgr::init(F32 region_size) { - mParcelsPerEdge = S32( region_size / PARCEL_GRID_STEP_METERS ); + mParcelsPerEdge = S32( REGION_WIDTH_METERS / PARCEL_GRID_STEP_METERS ); mHighlightSegments = new U8[(mParcelsPerEdge+1)*(mParcelsPerEdge+1)]; resetSegments(mHighlightSegments); diff --git a/indra/newview/llviewerregion.cpp b/indra/newview/llviewerregion.cpp index 3d45e9355..16c2bd245 100644 --- a/indra/newview/llviewerregion.cpp +++ b/indra/newview/llviewerregion.cpp @@ -242,9 +242,9 @@ LLViewerRegion::LLViewerRegion(const U64 &handle, mCacheLoaded(FALSE), mCacheDirty(FALSE), mReleaseNotesRequested(FALSE), - mCapabilitiesReceived(false), - mWidth(region_width_meters) + mCapabilitiesReceived(false) { + 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, - mWidth / grids_per_region_edge); + region_width_meters / 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, mWidth); - //Re-init the parcel mgr for this sim - LLViewerParcelMgr::getInstance()->init(mWidth); + mParcelOverlay = new LLViewerParcelOverlay(this, region_width_meters); + //Re-init the parcel mgr for this sim + LLViewerParcelMgr::getInstance()->init(region_width_meters); } else { diff --git a/indra/newview/llvlcomposition.cpp b/indra/newview/llvlcomposition.cpp index 3fa6a38e6..6e5a370d3 100644 --- a/indra/newview/llvlcomposition.cpp +++ b/indra/newview/llvlcomposition.cpp @@ -164,7 +164,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/256.f; + const F32 inv_width = 1.f/mWidth; // OK, for now, just have the composition value equal the height at the point. for (S32 j = y_begin; j < y_end; j++)