aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llviewerparcelmgr.cpp
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--linden/indra/newview/llviewerparcelmgr.cpp21
1 files changed, 15 insertions, 6 deletions
diff --git a/linden/indra/newview/llviewerparcelmgr.cpp b/linden/indra/newview/llviewerparcelmgr.cpp
index 9db65c6..11ab647 100644
--- a/linden/indra/newview/llviewerparcelmgr.cpp
+++ b/linden/indra/newview/llviewerparcelmgr.cpp
@@ -137,17 +137,27 @@ LLViewerParcelMgr::LLViewerParcelMgr()
137 mHoverParcel = new LLParcel(); 137 mHoverParcel = new LLParcel();
138 mCollisionParcel = new LLParcel(); 138 mCollisionParcel = new LLParcel();
139 139
140 mParcelsPerEdge = S32( REGION_WIDTH_METERS / PARCEL_GRID_STEP_METERS ); 140 mBlockedImage = gImageList.getImageFromFile("noentrylines.j2c");
141 mPassImage = gImageList.getImageFromFile("noentrypasslines.j2c");
142
143 init(256);
144}
145
146//moved this stuff out of the constructor and into a function that we can call again after we get the region size.
147//LLViewerParcelMgr needs to be changed so we either get an instance per region, or it handles various region sizes
148//on a single grid properly - Patrick Sapinski (2/10/2011)
149void LLViewerParcelMgr::init(F32 region_size)
150{
151 mParcelsPerEdge = S32( region_size / PARCEL_GRID_STEP_METERS );
141 mHighlightSegments = new U8[(mParcelsPerEdge+1)*(mParcelsPerEdge+1)]; 152 mHighlightSegments = new U8[(mParcelsPerEdge+1)*(mParcelsPerEdge+1)];
142 resetSegments(mHighlightSegments); 153 resetSegments(mHighlightSegments);
143 154
144 mCollisionSegments = new U8[(mParcelsPerEdge+1)*(mParcelsPerEdge+1)]; 155 mCollisionSegments = new U8[(mParcelsPerEdge+1)*(mParcelsPerEdge+1)];
145 resetSegments(mCollisionSegments); 156 resetSegments(mCollisionSegments);
146 157
147 mBlockedImage = gImageList.getImageFromFile("noentrylines.j2c"); 158 S32 mParcelOverLayChunks = region_size * region_size / (128 * 128);
148 mPassImage = gImageList.getImageFromFile("noentrypasslines.j2c");
149 159
150 S32 overlay_size = mParcelsPerEdge * mParcelsPerEdge / PARCEL_OVERLAY_CHUNKS; 160 S32 overlay_size = mParcelsPerEdge * mParcelsPerEdge / mParcelOverLayChunks;
151 sPackedOverlay = new U8[overlay_size]; 161 sPackedOverlay = new U8[overlay_size];
152 162
153 mAgentParcelOverlay = new U8[mParcelsPerEdge * mParcelsPerEdge]; 163 mAgentParcelOverlay = new U8[mParcelsPerEdge * mParcelsPerEdge];
@@ -1351,8 +1361,7 @@ void LLViewerParcelMgr::processParcelOverlay(LLMessageSystem *msg, void **user)
1351 return; 1361 return;
1352 } 1362 }
1353 1363
1354 S32 parcels_per_edge = LLViewerParcelMgr::getInstance()->mParcelsPerEdge; 1364 S32 expected_size = 1024; //parcels_per_edge * parcels_per_edge / PARCEL_OVERLAY_CHUNKS;
1355 S32 expected_size = parcels_per_edge * parcels_per_edge / PARCEL_OVERLAY_CHUNKS;
1356 if (packed_overlay_size != expected_size) 1365 if (packed_overlay_size != expected_size)
1357 { 1366 {
1358 llwarns << "Got parcel overlay size " << packed_overlay_size 1367 llwarns << "Got parcel overlay size " << packed_overlay_size