aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--linden/indra/newview/llcloud.cpp2
-rw-r--r--linden/indra/newview/llfloaterregioninfo.cpp8
-rw-r--r--linden/indra/newview/llglsandbox.cpp2
-rw-r--r--linden/indra/newview/llmapresponders.cpp4
-rw-r--r--linden/indra/newview/llstartup.cpp14
-rw-r--r--linden/indra/newview/llsurface.cpp20
-rwxr-xr-xlinden/indra/newview/llviewermessage.cpp27
-rw-r--r--linden/indra/newview/llviewerparcelmgr.cpp22
-rw-r--r--linden/indra/newview/llviewerparcelmgr.h2
-rw-r--r--linden/indra/newview/llviewerparceloverlay.cpp4
-rw-r--r--linden/indra/newview/llviewerparceloverlay.h1
-rw-r--r--linden/indra/newview/llviewerregion.cpp3
-rw-r--r--linden/indra/newview/llvlmanager.cpp61
-rw-r--r--linden/indra/newview/llvowater.cpp2
-rw-r--r--linden/indra/newview/llwind.cpp4
-rw-r--r--linden/indra/newview/llworld.cpp27
-rw-r--r--linden/indra/newview/llworld.h6
-rw-r--r--linden/indra/newview/llworldmap.cpp29
-rw-r--r--linden/indra/newview/llworldmap.h2
-rw-r--r--linden/indra/newview/llworldmapview.cpp14
20 files changed, 178 insertions, 76 deletions
diff --git a/linden/indra/newview/llcloud.cpp b/linden/indra/newview/llcloud.cpp
index 3e9b86a..b325265 100644
--- a/linden/indra/newview/llcloud.cpp
+++ b/linden/indra/newview/llcloud.cpp
@@ -427,7 +427,7 @@ void LLCloudLayer::decompress(LLBitPack &bitpack, LLGroupHeader *group_headerp)
427 group_headerp->stride = group_headerp->patch_size; // offset required to step up one row 427 group_headerp->stride = group_headerp->patch_size; // offset required to step up one row
428 set_group_of_patch_header(group_headerp); 428 set_group_of_patch_header(group_headerp);
429 429
430 decode_patch_header(bitpack, &patch_header); 430 decode_patch_header(bitpack, &patch_header, FALSE);
431 decode_patch(bitpack, gBuffer); 431 decode_patch(bitpack, gBuffer);
432 decompress_patch(mDensityp, gBuffer, &patch_header); 432 decompress_patch(mDensityp, gBuffer, &patch_header);
433} 433}
diff --git a/linden/indra/newview/llfloaterregioninfo.cpp b/linden/indra/newview/llfloaterregioninfo.cpp
index d4ffe22..4880308 100644
--- a/linden/indra/newview/llfloaterregioninfo.cpp
+++ b/linden/indra/newview/llfloaterregioninfo.cpp
@@ -1244,10 +1244,10 @@ BOOL LLPanelRegionTextureInfo::sendUpdate()
1244 llinfos << "LLPanelRegionTextureInfo::sendUpdate()" << llendl; 1244 llinfos << "LLPanelRegionTextureInfo::sendUpdate()" << llendl;
1245 1245
1246 // Make sure user hasn't chosen wacky textures. 1246 // Make sure user hasn't chosen wacky textures.
1247 if (!validateTextureSizes()) 1247 //if (!validateTextureSizes())
1248 { 1248 //{
1249 return FALSE; 1249 // return FALSE;
1250 } 1250 //}
1251 1251
1252 LLTextureCtrl* texture_ctrl; 1252 LLTextureCtrl* texture_ctrl;
1253 std::string buffer; 1253 std::string buffer;
diff --git a/linden/indra/newview/llglsandbox.cpp b/linden/indra/newview/llglsandbox.cpp
index 98c4d06..96fd39b 100644
--- a/linden/indra/newview/llglsandbox.cpp
+++ b/linden/indra/newview/llglsandbox.cpp
@@ -710,7 +710,7 @@ void LLViewerParcelMgr::renderOneSegment(F32 x1, F32 y1, F32 x2, F32 y2, F32 hei
710{ 710{
711 // HACK: At edge of last region of world, we need to make sure the region 711 // HACK: At edge of last region of world, we need to make sure the region
712 // resolves correctly so we can get a height value. 712 // resolves correctly so we can get a height value.
713 const F32 BORDER = REGION_WIDTH_METERS - 0.1f; 713 const F32 BORDER = regionp->getWidth() - 0.1f;
714 714
715 F32 clamped_x1 = x1; 715 F32 clamped_x1 = x1;
716 F32 clamped_y1 = y1; 716 F32 clamped_y1 = y1;
diff --git a/linden/indra/newview/llmapresponders.cpp b/linden/indra/newview/llmapresponders.cpp
index 9d974f2..b6b5c8a 100644
--- a/linden/indra/newview/llmapresponders.cpp
+++ b/linden/indra/newview/llmapresponders.cpp
@@ -120,6 +120,8 @@ void LLMapLayerResponder::result(const LLSD& result)
120 120
121 S32 x_regions = map_block["X"]; 121 S32 x_regions = map_block["X"];
122 S32 y_regions = map_block["Y"]; 122 S32 y_regions = map_block["Y"];
123 S32 size_x_regions = map_block["SizeX"];
124 S32 size_y_regions = map_block["SizeY"];
123 std::string name = map_block["Name"]; 125 std::string name = map_block["Name"];
124 S32 access = map_block["Access"]; 126 S32 access = map_block["Access"];
125 S32 region_flags = map_block["RegionFlags"]; 127 S32 region_flags = map_block["RegionFlags"];
@@ -168,6 +170,8 @@ void LLMapLayerResponder::result(const LLSD& result)
168 LLWorldMap::getInstance()->mSimInfoMap[handle] = siminfo; 170 LLWorldMap::getInstance()->mSimInfoMap[handle] = siminfo;
169 171
170 siminfo->mHandle = handle; 172 siminfo->mHandle = handle;
173 siminfo->msizeX = size_x_regions;
174 siminfo->msizeY = size_y_regions;
171 siminfo->mName.assign( name ); 175 siminfo->mName.assign( name );
172 siminfo->mAccess = access; /*Flawfinder: ignore*/ 176 siminfo->mAccess = access; /*Flawfinder: ignore*/
173 siminfo->mRegionFlags = region_flags; 177 siminfo->mRegionFlags = region_flags;
diff --git a/linden/indra/newview/llstartup.cpp b/linden/indra/newview/llstartup.cpp
index 5a3a8ee..0b6d75f 100644
--- a/linden/indra/newview/llstartup.cpp
+++ b/linden/indra/newview/llstartup.cpp
@@ -368,6 +368,8 @@ bool idle_startup()
368 static U64 first_sim_handle = 0; 368 static U64 first_sim_handle = 0;
369 static LLHost first_sim; 369 static LLHost first_sim;
370 static std::string first_sim_seed_cap; 370 static std::string first_sim_seed_cap;
371 static U32 first_sim_size_x = 256;
372 static U32 first_sim_size_y = 256;
371 373
372 static LLVector3 initial_sun_direction(1.f, 0.f, 0.f); 374 static LLVector3 initial_sun_direction(1.f, 0.f, 0.f);
373 static LLVector3 agent_start_position_region(10.f, 10.f, 10.f); // default for when no space server 375 static LLVector3 agent_start_position_region(10.f, 10.f, 10.f); // default for when no space server
@@ -1620,6 +1622,16 @@ bool idle_startup()
1620 first_sim_handle = to_region_handle(region_x, region_y); 1622 first_sim_handle = to_region_handle(region_x, region_y);
1621 } 1623 }
1622 1624
1625 text = LLUserAuth::getInstance()->getResponse("region_size_x");
1626 if(!text.empty()) {
1627 first_sim_size_x = strtoul(text.c_str(), NULL, 10);
1628 LLViewerParcelMgr::getInstance()->init(first_sim_size_x);
1629 }
1630
1631 //region Y size is currently unused, major refactoring required. - Patrick Sapinski (2/10/2011)
1632 text = LLUserAuth::getInstance()->getResponse("region_size_y");
1633 if(!text.empty()) first_sim_size_y = strtoul(text.c_str(), NULL, 10);
1634
1623 const std::string look_at_str = LLUserAuth::getInstance()->getResponse("look_at"); 1635 const std::string look_at_str = LLUserAuth::getInstance()->getResponse("look_at");
1624 if (!look_at_str.empty()) 1636 if (!look_at_str.empty())
1625 { 1637 {
@@ -1915,7 +1927,7 @@ bool idle_startup()
1915 1927
1916 gAgent.initOriginGlobal(from_region_handle(first_sim_handle)); 1928 gAgent.initOriginGlobal(from_region_handle(first_sim_handle));
1917 1929
1918 LLWorld::getInstance()->addRegion(first_sim_handle, first_sim); 1930 LLWorld::getInstance()->addRegion(first_sim_handle, first_sim, first_sim_size_x, first_sim_size_y);
1919 1931
1920 LLViewerRegion *regionp = LLWorld::getInstance()->getRegionFromHandle(first_sim_handle); 1932 LLViewerRegion *regionp = LLWorld::getInstance()->getRegionFromHandle(first_sim_handle);
1921 LL_INFOS("AppInit") << "Adding initial simulator " << regionp->getOriginGlobal() << LL_ENDL; 1933 LL_INFOS("AppInit") << "Adding initial simulator " << regionp->getOriginGlobal() << LL_ENDL;
diff --git a/linden/indra/newview/llsurface.cpp b/linden/indra/newview/llsurface.cpp
index aaafe0d..66f8076 100644
--- a/linden/indra/newview/llsurface.cpp
+++ b/linden/indra/newview/llsurface.cpp
@@ -303,7 +303,7 @@ void LLSurface::initTextures()
303 mWaterObjp = (LLVOWater *)gObjectList.createObjectViewer(LLViewerObject::LL_VO_WATER, mRegionp); 303 mWaterObjp = (LLVOWater *)gObjectList.createObjectViewer(LLViewerObject::LL_VO_WATER, mRegionp);
304 gPipeline.createObject(mWaterObjp); 304 gPipeline.createObject(mWaterObjp);
305 LLVector3d water_pos_global = from_region_handle(mRegionp->getHandle()); 305 LLVector3d water_pos_global = from_region_handle(mRegionp->getHandle());
306 water_pos_global += LLVector3d(128.0, 128.0, DEFAULT_WATER_HEIGHT); 306 water_pos_global += LLVector3d(mRegionp->getWidth()/2, mRegionp->getWidth()/2, DEFAULT_WATER_HEIGHT);
307 mWaterObjp->setPositionGlobal(water_pos_global); 307 mWaterObjp->setPositionGlobal(water_pos_global);
308 } 308 }
309} 309}
@@ -356,8 +356,8 @@ void LLSurface::setOriginGlobal(const LLVector3d &origin_global)
356 // Hack! 356 // Hack!
357 if (mWaterObjp.notNull() && mWaterObjp->mDrawable.notNull()) 357 if (mWaterObjp.notNull() && mWaterObjp->mDrawable.notNull())
358 { 358 {
359 const F64 x = origin_global.mdV[VX] + 128.0; 359 const F64 x = origin_global.mdV[VX] + (F64)mRegionp->getWidth()/2;
360 const F64 y = origin_global.mdV[VY] + 128.0; 360 const F64 y = origin_global.mdV[VY] + (F64)mRegionp->getWidth()/2;
361 const F64 z = mWaterObjp->getPositionGlobal().mdV[VZ]; 361 const F64 z = mWaterObjp->getPositionGlobal().mdV[VZ];
362 362
363 LLVector3d water_origin_global(x, y, z); 363 LLVector3d water_origin_global(x, y, z);
@@ -707,14 +707,22 @@ void LLSurface::decompressDCTPatch(LLBitPack &bitpack, LLGroupHeader *gopp, BOOL
707 707
708 while (1) 708 while (1)
709 { 709 {
710 decode_patch_header(bitpack, &ph); 710 decode_patch_header(bitpack, &ph, b_large_patch);
711 if (ph.quant_wbits == END_OF_PATCHES) 711 if (ph.quant_wbits == END_OF_PATCHES)
712 { 712 {
713 break; 713 break;
714 } 714 }
715 715
716 i = ph.patchids >> 5; 716 if (b_large_patch)
717 j = ph.patchids & 0x1F; 717 {
718 i = ph.patchids >> 16; //x
719 j = ph.patchids & 0xFFFF; //y
720 }
721 else
722 {
723 i = ph.patchids >> 5; //x
724 j = ph.patchids & 0x1F; //y
725 }
718 726
719 if ((i >= mPatchesPerEdge) || (j >= mPatchesPerEdge)) 727 if ((i >= mPatchesPerEdge) || (j >= mPatchesPerEdge))
720 { 728 {
diff --git a/linden/indra/newview/llviewermessage.cpp b/linden/indra/newview/llviewermessage.cpp
index 9ebfd04..4de4768 100755
--- a/linden/indra/newview/llviewermessage.cpp
+++ b/linden/indra/newview/llviewermessage.cpp
@@ -3531,6 +3531,17 @@ void process_teleport_finish(LLMessageSystem* msg, void**)
3531 U32 teleport_flags; 3531 U32 teleport_flags;
3532 msg->getU32Fast(_PREHASH_Info, _PREHASH_TeleportFlags, teleport_flags); 3532 msg->getU32Fast(_PREHASH_Info, _PREHASH_TeleportFlags, teleport_flags);
3533 3533
3534 U32 region_size_x = 256;
3535 msg->getU32Fast(_PREHASH_Info, _PREHASH_RegionSizeX, region_size_x);
3536 U32 region_size_y = 256;
3537 msg->getU32Fast(_PREHASH_Info, _PREHASH_RegionSizeY, region_size_y);
3538
3539 //and a little hack for Second Life compatibility
3540 if (region_size_y == 0 || region_size_x == 0)
3541 {
3542 region_size_x = 256;
3543 region_size_y = 256;
3544 }
3534 3545
3535 std::string seedCap; 3546 std::string seedCap;
3536 msg->getStringFast(_PREHASH_Info, _PREHASH_SeedCapability, seedCap); 3547 msg->getStringFast(_PREHASH_Info, _PREHASH_SeedCapability, seedCap);
@@ -3550,7 +3561,7 @@ void process_teleport_finish(LLMessageSystem* msg, void**)
3550 3561
3551 // Viewer trusts the simulator. 3562 // Viewer trusts the simulator.
3552 gMessageSystem->enableCircuit(sim_host, TRUE); 3563 gMessageSystem->enableCircuit(sim_host, TRUE);
3553 LLViewerRegion* regionp = LLWorld::getInstance()->addRegion(region_handle, sim_host); 3564 LLViewerRegion* regionp = LLWorld::getInstance()->addRegion(region_handle, sim_host, region_size_x, region_size_y);
3554 3565
3555/* 3566/*
3556 // send camera update to new region 3567 // send camera update to new region
@@ -3866,9 +3877,21 @@ void process_crossed_region(LLMessageSystem* msg, void**)
3866 std::string seedCap; 3877 std::string seedCap;
3867 msg->getStringFast(_PREHASH_RegionData, _PREHASH_SeedCapability, seedCap); 3878 msg->getStringFast(_PREHASH_RegionData, _PREHASH_SeedCapability, seedCap);
3868 3879
3880 U32 region_size_x = 256;
3881 msg->getU32(_PREHASH_RegionData, _PREHASH_RegionSizeX, region_size_x);
3882 U32 region_size_y = 256;
3883 msg->getU32(_PREHASH_RegionData, _PREHASH_RegionSizeY, region_size_y);
3884
3885 //and a little hack for Second Life compatibility
3886 if (region_size_y == 0 || region_size_x == 0)
3887 {
3888 region_size_x = 256;
3889 region_size_y = 256;
3890 }
3891
3869 send_complete_agent_movement(sim_host); 3892 send_complete_agent_movement(sim_host);
3870 3893
3871 LLViewerRegion* regionp = LLWorld::getInstance()->addRegion(region_handle, sim_host); 3894 LLViewerRegion* regionp = LLWorld::getInstance()->addRegion(region_handle, sim_host, region_size_x, region_size_y);
3872 regionp->setSeedCapability(seedCap); 3895 regionp->setSeedCapability(seedCap);
3873 3896
3874 // Tell the LightShare handler that we have changed regions. 3897 // Tell the LightShare handler that we have changed regions.
diff --git a/linden/indra/newview/llviewerparcelmgr.cpp b/linden/indra/newview/llviewerparcelmgr.cpp
index 630da54..abe0e9f 100644
--- a/linden/indra/newview/llviewerparcelmgr.cpp
+++ b/linden/indra/newview/llviewerparcelmgr.cpp
@@ -137,6 +137,18 @@ LLViewerParcelMgr::LLViewerParcelMgr()
137 mHoverParcel = new LLParcel(); 137 mHoverParcel = new LLParcel();
138 mCollisionParcel = new LLParcel(); 138 mCollisionParcel = new LLParcel();
139 139
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
140 mParcelsPerEdge = S32( REGION_WIDTH_METERS / PARCEL_GRID_STEP_METERS ); 152 mParcelsPerEdge = S32( REGION_WIDTH_METERS / PARCEL_GRID_STEP_METERS );
141 mHighlightSegments = new U8[(mParcelsPerEdge+1)*(mParcelsPerEdge+1)]; 153 mHighlightSegments = new U8[(mParcelsPerEdge+1)*(mParcelsPerEdge+1)];
142 resetSegments(mHighlightSegments); 154 resetSegments(mHighlightSegments);
@@ -144,10 +156,9 @@ LLViewerParcelMgr::LLViewerParcelMgr()
144 mCollisionSegments = new U8[(mParcelsPerEdge+1)*(mParcelsPerEdge+1)]; 156 mCollisionSegments = new U8[(mParcelsPerEdge+1)*(mParcelsPerEdge+1)];
145 resetSegments(mCollisionSegments); 157 resetSegments(mCollisionSegments);
146 158
147 mBlockedImage = gImageList.getImageFromFile("noentrylines.j2c"); 159 S32 mParcelOverLayChunks = region_size * region_size / (128 * 128);
148 mPassImage = gImageList.getImageFromFile("noentrypasslines.j2c"); 160
149 161 S32 overlay_size = mParcelsPerEdge * mParcelsPerEdge / mParcelOverLayChunks;
150 S32 overlay_size = mParcelsPerEdge * mParcelsPerEdge / PARCEL_OVERLAY_CHUNKS;
151 sPackedOverlay = new U8[overlay_size]; 162 sPackedOverlay = new U8[overlay_size];
152 163
153 mAgentParcelOverlay = new U8[mParcelsPerEdge * mParcelsPerEdge]; 164 mAgentParcelOverlay = new U8[mParcelsPerEdge * mParcelsPerEdge];
@@ -1351,8 +1362,7 @@ void LLViewerParcelMgr::processParcelOverlay(LLMessageSystem *msg, void **user)
1351 return; 1362 return;
1352 } 1363 }
1353 1364
1354 S32 parcels_per_edge = LLViewerParcelMgr::getInstance()->mParcelsPerEdge; 1365 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) 1366 if (packed_overlay_size != expected_size)
1357 { 1367 {
1358 llwarns << "Got parcel overlay size " << packed_overlay_size 1368 llwarns << "Got parcel overlay size " << packed_overlay_size
diff --git a/linden/indra/newview/llviewerparcelmgr.h b/linden/indra/newview/llviewerparcelmgr.h
index 9bf6096..dcdea3c 100644
--- a/linden/indra/newview/llviewerparcelmgr.h
+++ b/linden/indra/newview/llviewerparcelmgr.h
@@ -82,6 +82,8 @@ public:
82 LLViewerParcelMgr(); 82 LLViewerParcelMgr();
83 ~LLViewerParcelMgr(); 83 ~LLViewerParcelMgr();
84 84
85 void init(F32 region_size);
86
85 static void cleanupGlobals(); 87 static void cleanupGlobals();
86 88
87 BOOL selectionEmpty() const; 89 BOOL selectionEmpty() const;
diff --git a/linden/indra/newview/llviewerparceloverlay.cpp b/linden/indra/newview/llviewerparceloverlay.cpp
index 0bcd8f3..a31f153 100644
--- a/linden/indra/newview/llviewerparceloverlay.cpp
+++ b/linden/indra/newview/llviewerparceloverlay.cpp
@@ -58,6 +58,7 @@ const U8 OVERLAY_IMG_COMPONENTS = 4;
58LLViewerParcelOverlay::LLViewerParcelOverlay(LLViewerRegion* region, F32 region_width_meters) 58LLViewerParcelOverlay::LLViewerParcelOverlay(LLViewerRegion* region, F32 region_width_meters)
59: mRegion( region ), 59: mRegion( region ),
60 mParcelGridsPerEdge( S32( region_width_meters / PARCEL_GRID_STEP_METERS ) ), 60 mParcelGridsPerEdge( S32( region_width_meters / PARCEL_GRID_STEP_METERS ) ),
61 mRegionSize(S32(region_width_meters)),
61 mDirty( FALSE ), 62 mDirty( FALSE ),
62 mTimeSinceLastUpdate(), 63 mTimeSinceLastUpdate(),
63 mOverlayTextureIdx(-1), 64 mOverlayTextureIdx(-1),
@@ -299,7 +300,8 @@ void LLViewerParcelOverlay::uncompressLandOverlay(S32 chunk, U8 *packed_overlay)
299{ 300{
300 // Unpack the message data into the ownership array 301 // Unpack the message data into the ownership array
301 S32 size = mParcelGridsPerEdge * mParcelGridsPerEdge; 302 S32 size = mParcelGridsPerEdge * mParcelGridsPerEdge;
302 S32 chunk_size = size / PARCEL_OVERLAY_CHUNKS; 303 S32 mParcelOverLayChunks = mRegionSize * mRegionSize / (128 * 128);
304 S32 chunk_size = size / mParcelOverLayChunks;
303 305
304 memcpy(mOwnership + chunk*chunk_size, packed_overlay, chunk_size); /*Flawfinder: ignore*/ 306 memcpy(mOwnership + chunk*chunk_size, packed_overlay, chunk_size); /*Flawfinder: ignore*/
305 307
diff --git a/linden/indra/newview/llviewerparceloverlay.h b/linden/indra/newview/llviewerparceloverlay.h
index 9bed1dd..d3b5980 100644
--- a/linden/indra/newview/llviewerparceloverlay.h
+++ b/linden/indra/newview/llviewerparceloverlay.h
@@ -98,6 +98,7 @@ private:
98 LLViewerRegion* mRegion; 98 LLViewerRegion* mRegion;
99 99
100 S32 mParcelGridsPerEdge; 100 S32 mParcelGridsPerEdge;
101 S32 mRegionSize;
101 102
102 LLPointer<LLImageGL> mTexture; 103 LLPointer<LLImageGL> mTexture;
103 LLPointer<LLImageRaw> mImageRaw; 104 LLPointer<LLImageRaw> mImageRaw;
diff --git a/linden/indra/newview/llviewerregion.cpp b/linden/indra/newview/llviewerregion.cpp
index a8047b8..4186362 100644
--- a/linden/indra/newview/llviewerregion.cpp
+++ b/linden/indra/newview/llviewerregion.cpp
@@ -65,6 +65,7 @@
65#include "llvoclouds.h" 65#include "llvoclouds.h"
66#include "llworld.h" 66#include "llworld.h"
67#include "llspatialpartition.h" 67#include "llspatialpartition.h"
68#include "llviewerparcelmgr.h"
68 69
69// Viewer object cache version, change if object update 70// Viewer object cache version, change if object update
70// format changes. JC 71// format changes. JC
@@ -199,6 +200,8 @@ LLViewerRegion::LLViewerRegion(const U64 &handle,
199 if (!gNoRender) 200 if (!gNoRender)
200 { 201 {
201 mParcelOverlay = new LLViewerParcelOverlay(this, region_width_meters); 202 mParcelOverlay = new LLViewerParcelOverlay(this, region_width_meters);
203 //Re-init the parcel mgr for this sim
204 LLViewerParcelMgr::getInstance()->init(region_width_meters);
202 } 205 }
203 else 206 else
204 { 207 {
diff --git a/linden/indra/newview/llvlmanager.cpp b/linden/indra/newview/llvlmanager.cpp
index 177093c..68b4d7b 100644
--- a/linden/indra/newview/llvlmanager.cpp
+++ b/linden/indra/newview/llvlmanager.cpp
@@ -57,21 +57,23 @@ LLVLManager::~LLVLManager()
57 57
58void LLVLManager::addLayerData(LLVLData *vl_datap, const S32 mesg_size) 58void LLVLManager::addLayerData(LLVLData *vl_datap, const S32 mesg_size)
59{ 59{
60 if (LAND_LAYER_CODE == vl_datap->mType) 60 if (LAND_LAYER_CODE == vl_datap->mType ||
61 { 61 AURORA_LAND_LAYER_CODE == vl_datap->mType)
62 mLandBits += mesg_size * 8; 62 {
63 } 63 mLandBits += mesg_size * 8;
64 else if (WIND_LAYER_CODE == vl_datap->mType) 64 }
65 { 65 else if (WIND_LAYER_CODE == vl_datap->mType ||
66 mWindBits += mesg_size * 8; 66 AURORA_WIND_LAYER_CODE == vl_datap->mType)
67 } 67 {
68 else if (CLOUD_LAYER_CODE == vl_datap->mType) 68 mWindBits += mesg_size * 8;
69 { 69 }
70 mCloudBits += mesg_size * 8; 70 else if (CLOUD_LAYER_CODE == vl_datap->mType)
71 } 71 {
72 else 72 mCloudBits += mesg_size * 8;
73 { 73 }
74 llerrs << "Unknown layer type!" << (S32)vl_datap->mType << llendl; 74 else
75 {
76 llerrs << "Unknown layer type!" << (S32)vl_datap->mType << llendl;
75 } 77 }
76 78
77 mPacketData.put(vl_datap); 79 mPacketData.put(vl_datap);
@@ -90,18 +92,23 @@ void LLVLManager::unpackData(const S32 num_packets)
90 LLGroupHeader goph; 92 LLGroupHeader goph;
91 93
92 decode_patch_group_header(bit_pack, &goph); 94 decode_patch_group_header(bit_pack, &goph);
93 if (LAND_LAYER_CODE == datap->mType) 95 if (LAND_LAYER_CODE == datap->mType)
94 { 96 {
95 datap->mRegionp->getLand().decompressDCTPatch(bit_pack, &goph, FALSE); 97 datap->mRegionp->getLand().decompressDCTPatch(bit_pack, &goph, FALSE);
96 } 98 }
97 else if (WIND_LAYER_CODE == datap->mType) 99 else if (AURORA_LAND_LAYER_CODE == datap->mType)
98 { 100 {
99 datap->mRegionp->mWind.decompress(bit_pack, &goph); 101 datap->mRegionp->getLand().decompressDCTPatch(bit_pack, &goph, TRUE);
100 102 }
101 } 103 else if (WIND_LAYER_CODE == datap->mType ||
102 else if (CLOUD_LAYER_CODE == datap->mType) 104 AURORA_WIND_LAYER_CODE == datap->mType)
103 { 105 {
104 datap->mRegionp->mCloudLayer.decompress(bit_pack, &goph); 106 datap->mRegionp->mWind.decompress(bit_pack, &goph);
107 }
108 else if (CLOUD_LAYER_CODE == datap->mType ||
109 AURORA_CLOUD_LAYER_CODE == datap->mType)
110 {
111 datap->mRegionp->mCloudLayer.decompress(bit_pack, &goph);
105 } 112 }
106 } 113 }
107 114
diff --git a/linden/indra/newview/llvowater.cpp b/linden/indra/newview/llvowater.cpp
index c66295a..8af9e4a 100644
--- a/linden/indra/newview/llvowater.cpp
+++ b/linden/indra/newview/llvowater.cpp
@@ -74,7 +74,7 @@ LLVOWater::LLVOWater(const LLUUID &id, const LLPCode pcode, LLViewerRegion *regi
74{ 74{
75 // Terrain must draw during selection passes so it can block objects behind it. 75 // Terrain must draw during selection passes so it can block objects behind it.
76 mbCanSelect = FALSE; 76 mbCanSelect = FALSE;
77 setScale(LLVector3(256.f, 256.f, 0.f)); // Hack for setting scale for bounding boxes/visibility. 77 setScale(LLVector3(mRegionp->getWidth(), mRegionp->getWidth(), 0.f)); // Hack for setting scale for bounding boxes/visibility.
78 78
79 mUseTexture = TRUE; 79 mUseTexture = TRUE;
80 mIsEdgePatch = FALSE; 80 mIsEdgePatch = FALSE;
diff --git a/linden/indra/newview/llwind.cpp b/linden/indra/newview/llwind.cpp
index ae98bea..3dcbdf6 100644
--- a/linden/indra/newview/llwind.cpp
+++ b/linden/indra/newview/llwind.cpp
@@ -120,12 +120,12 @@ void LLWind::decompress(LLBitPack &bitpack, LLGroupHeader *group_headerp)
120 set_group_of_patch_header(group_headerp); 120 set_group_of_patch_header(group_headerp);
121 121
122 // X component 122 // X component
123 decode_patch_header(bitpack, &patch_header); 123 decode_patch_header(bitpack, &patch_header, FALSE);
124 decode_patch(bitpack, buffer); 124 decode_patch(bitpack, buffer);
125 decompress_patch(mVelX, buffer, &patch_header); 125 decompress_patch(mVelX, buffer, &patch_header);
126 126
127 // Y component 127 // Y component
128 decode_patch_header(bitpack, &patch_header); 128 decode_patch_header(bitpack, &patch_header, FALSE);
129 decode_patch(bitpack, buffer); 129 decode_patch(bitpack, buffer);
130 decompress_patch(mVelY, buffer, &patch_header); 130 decompress_patch(mVelY, buffer, &patch_header);
131 131
diff --git a/linden/indra/newview/llworld.cpp b/linden/indra/newview/llworld.cpp
index 7866bf8..525195d 100644
--- a/linden/indra/newview/llworld.cpp
+++ b/linden/indra/newview/llworld.cpp
@@ -80,12 +80,12 @@ const S32 WORLD_PATCH_SIZE = 16;
80 80
81extern LLColor4U MAX_WATER_COLOR; 81extern LLColor4U MAX_WATER_COLOR;
82 82
83const U32 LLWorld::mWidth = 256; 83U32 LLWorld::mWidth = 256;
84 84
85// meters/point, therefore mWidth * mScale = meters per edge 85// meters/point, therefore mWidth * mScale = meters per edge
86const F32 LLWorld::mScale = 1.f; 86const F32 LLWorld::mScale = 1.f;
87 87
88const F32 LLWorld::mWidthInMeters = mWidth * mScale; 88F32 LLWorld::mWidthInMeters = mWidth * mScale;
89 89
90// 90//
91// Functions 91// Functions
@@ -140,7 +140,7 @@ F32 LLWorld::getRegionMaxHeight() const
140 return gHippoLimits->getMaxHeight(); 140 return gHippoLimits->getMaxHeight();
141} 141}
142 142
143LLViewerRegion* LLWorld::addRegion(const U64 &region_handle, const LLHost &host) 143LLViewerRegion* LLWorld::addRegion(const U64 &region_handle, const LLHost &host, const U32 &region_size_x, const U32 &region_size_y)
144{ 144{
145 LLMemType mt(LLMemType::MTYPE_REGIONS); 145 LLMemType mt(LLMemType::MTYPE_REGIONS);
146 146
@@ -172,9 +172,11 @@ LLViewerRegion* LLWorld::addRegion(const U64 &region_handle, const LLHost &host)
172 172
173 U32 iindex = 0; 173 U32 iindex = 0;
174 U32 jindex = 0; 174 U32 jindex = 0;
175 mWidth = region_size_x;
176 mWidthInMeters = mWidth * mScale;
175 from_region_handle(region_handle, &iindex, &jindex); 177 from_region_handle(region_handle, &iindex, &jindex);
176 S32 x = (S32)(iindex/mWidth); 178 S32 x = (S32)(iindex/256);
177 S32 y = (S32)(jindex/mWidth); 179 S32 y = (S32)(jindex/256);
178 llinfos << "Adding new region (" << x << ":" << y << ")" << llendl; 180 llinfos << "Adding new region (" << x << ":" << y << ")" << llendl;
179 llinfos << "Host: " << host << llendl; 181 llinfos << "Host: " << host << llendl;
180 182
@@ -902,7 +904,7 @@ void LLWorld::updateWaterObjects()
902 } 904 }
903 905
904 // Region width in meters. 906 // Region width in meters.
905 S32 const rwidth = (S32)REGION_WIDTH_U32; 907 S32 const rwidth = (S32)getRegionWidthInMeters();
906 908
907 // The distance we might see into the void 909 // The distance we might see into the void
908 // when standing on the edge of a region, in meters. 910 // when standing on the edge of a region, in meters.
@@ -1256,9 +1258,20 @@ void process_enable_simulator(LLMessageSystem *msg, void **user_data)
1256 // which simulator should we modify? 1258 // which simulator should we modify?
1257 LLHost sim(ip_u32, port); 1259 LLHost sim(ip_u32, port);
1258 1260
1261 U32 region_size_x = 256;
1262 msg->getU32Fast(_PREHASH_SimulatorInfo, _PREHASH_RegionSizeX, region_size_x);
1263 U32 region_size_y = 256;
1264 msg->getU32Fast(_PREHASH_SimulatorInfo, _PREHASH_RegionSizeY, region_size_y);
1265
1266 if (region_size_y == 0 || region_size_x == 0)
1267 {
1268 region_size_x = 256;
1269 region_size_y = 256;
1270 }
1271
1259 // Viewer trusts the simulator. 1272 // Viewer trusts the simulator.
1260 msg->enableCircuit(sim, TRUE); 1273 msg->enableCircuit(sim, TRUE);
1261 LLWorld::getInstance()->addRegion(handle, sim); 1274 LLWorld::getInstance()->addRegion(handle, sim, region_size_x, region_size_y);
1262 1275
1263 // give the simulator a message it can use to get ip and port 1276 // give the simulator a message it can use to get ip and port
1264 llinfos << "simulator_enable() Enabling " << sim << " with code " << msg->getOurCircuitCode() << llendl; 1277 llinfos << "simulator_enable() Enabling " << sim << " with code " << msg->getOurCircuitCode() << llendl;
diff --git a/linden/indra/newview/llworld.h b/linden/indra/newview/llworld.h
index 964729d..5dbef6d 100644
--- a/linden/indra/newview/llworld.h
+++ b/linden/indra/newview/llworld.h
@@ -71,7 +71,7 @@ public:
71 LLWorld(); 71 LLWorld();
72 void destroyClass(); 72 void destroyClass();
73 73
74 LLViewerRegion* addRegion(const U64 &region_handle, const LLHost &host); 74 LLViewerRegion* addRegion(const U64 &region_handle, const LLHost &host, const U32 &region_size_x, const U32 &region_size_y);
75 // safe to call if already present, does the "right thing" if 75 // safe to call if already present, does the "right thing" if
76 // hosts are same, or if hosts are different, etc... 76 // hosts are same, or if hosts are different, etc...
77 void removeRegion(const LLHost &host); 77 void removeRegion(const LLHost &host);
@@ -171,12 +171,12 @@ private:
171 region_list_t mCulledRegionList; 171 region_list_t mCulledRegionList;
172 172
173 // Number of points on edge 173 // Number of points on edge
174 static const U32 mWidth; 174 static U32 mWidth;
175 175
176 // meters/point, therefore mWidth * mScale = meters per edge 176 // meters/point, therefore mWidth * mScale = meters per edge
177 static const F32 mScale; 177 static const F32 mScale;
178 178
179 static const F32 mWidthInMeters; 179 static F32 mWidthInMeters;
180 180
181 F32 mLandFarClip; // Far clip distance for land. 181 F32 mLandFarClip; // Far clip distance for land.
182 LLPatchVertexArray mLandPatch; 182 LLPatchVertexArray mLandPatch;
diff --git a/linden/indra/newview/llworldmap.cpp b/linden/indra/newview/llworldmap.cpp
index 3ada36f..ead72fa 100644
--- a/linden/indra/newview/llworldmap.cpp
+++ b/linden/indra/newview/llworldmap.cpp
@@ -237,16 +237,27 @@ LLSimInfo* LLWorldMap::simInfoFromPosGlobal(const LLVector3d& pos_global)
237 return simInfoFromHandle(handle); 237 return simInfoFromHandle(handle);
238} 238}
239 239
240LLSimInfo* LLWorldMap::simInfoFromHandle(const U64 handle) 240LLSimInfo* LLWorldMap::simInfoFromHandle(const U64 findhandle)
241{ 241{
242 sim_info_map_t::iterator it = mSimInfoMap.find(handle); 242 std::map<U64, LLSimInfo*>::const_iterator it;
243 if (it != mSimInfoMap.end()) 243 for (it = LLWorldMap::getInstance()->mSimInfoMap.begin(); it != LLWorldMap::getInstance()->mSimInfoMap.end(); ++it)
244 { 244 {
245 LLSimInfo* sim_info = (*it).second; 245 const U64 handle = (*it).first;
246 if (sim_info) 246 LLSimInfo* info = (*it).second;
247 { 247 if(handle == findhandle)
248 return sim_info; 248 {
249 } 249 return info;
250 }
251 U32 x = 0, y = 0;
252 from_region_handle(findhandle, &x, &y);
253 U32 checkRegionX, checkRegionY;
254 from_region_handle(handle, &checkRegionX, &checkRegionY);
255
256 if(x > checkRegionX && x < (checkRegionX + info->msizeX) &&
257 y > checkRegionY && y < (checkRegionY + info->msizeY))
258 {
259 return info;
260 }
250 } 261 }
251 return NULL; 262 return NULL;
252} 263}
diff --git a/linden/indra/newview/llworldmap.h b/linden/indra/newview/llworldmap.h
index b7089f3..6725f91 100644
--- a/linden/indra/newview/llworldmap.h
+++ b/linden/indra/newview/llworldmap.h
@@ -81,6 +81,8 @@ public:
81 81
82public: 82public:
83 U64 mHandle; 83 U64 mHandle;
84 S32 msizeX;
85 S32 msizeY;
84 std::string mName; 86 std::string mName;
85 87
86 F64 mAgentsUpdateTime; 88 F64 mAgentsUpdateTime;
diff --git a/linden/indra/newview/llworldmapview.cpp b/linden/indra/newview/llworldmapview.cpp
index 443ee74..51de598 100644
--- a/linden/indra/newview/llworldmapview.cpp
+++ b/linden/indra/newview/llworldmapview.cpp
@@ -471,8 +471,8 @@ void LLWorldMapView::draw()
471 // When the view isn't panned, 0,0 = center of rectangle 471 // When the view isn't panned, 0,0 = center of rectangle
472 F32 bottom = sPanY + half_height + relative_y; 472 F32 bottom = sPanY + half_height + relative_y;
473 F32 left = sPanX + half_width + relative_x; 473 F32 left = sPanX + half_width + relative_x;
474 F32 top = bottom + sMapScale ; 474 F32 top = bottom+ (sMapScale * info->msizeY / REGION_WIDTH_METERS);
475 F32 right = left + sMapScale ; 475 F32 right = left + (sMapScale * info->msizeY / REGION_WIDTH_METERS);
476 476
477 // Switch to world map texture (if available for this region) if either: 477 // Switch to world map texture (if available for this region) if either:
478 // 1. Tiles are zoomed out small enough, or 478 // 1. Tiles are zoomed out small enough, or
@@ -567,17 +567,21 @@ void LLWorldMapView::draw()
567 center_global.mdV[VX] += 128.0; 567 center_global.mdV[VX] += 128.0;
568 center_global.mdV[VY] += 128.0; 568 center_global.mdV[VY] += 128.0;
569 569
570 S32 draw_size = llround(sMapScale); 570 S32 x_draw_size = llround(sMapScale);
571 S32 y_draw_size = llround(sMapScale);
572 x_draw_size *= info->msizeX / REGION_WIDTH_METERS;
573 y_draw_size *= info->msizeY / REGION_WIDTH_METERS;
574
571 if (simimage != NULL) 575 if (simimage != NULL)
572 { 576 {
573 simimage->setBoostLevel(LLViewerImageBoostLevel::BOOST_MAP); 577 simimage->setBoostLevel(LLViewerImageBoostLevel::BOOST_MAP);
574 simimage->setKnownDrawSize(llround(draw_size * LLUI::sGLScaleFactor.mV[VX]), llround(draw_size * LLUI::sGLScaleFactor.mV[VY])); 578 simimage->setKnownDrawSize(llround(x_draw_size * LLUI::sGLScaleFactor.mV[VX]), llround(y_draw_size * LLUI::sGLScaleFactor.mV[VY]));
575 } 579 }
576 580
577 if (overlayimage != NULL) 581 if (overlayimage != NULL)
578 { 582 {
579 overlayimage->setBoostLevel(LLViewerImageBoostLevel::BOOST_MAP); 583 overlayimage->setBoostLevel(LLViewerImageBoostLevel::BOOST_MAP);
580 overlayimage->setKnownDrawSize(llround(draw_size * LLUI::sGLScaleFactor.mV[VX]), llround(draw_size * LLUI::sGLScaleFactor.mV[VY])); 584 overlayimage->setKnownDrawSize(llround(x_draw_size * LLUI::sGLScaleFactor.mV[VX]), llround(y_draw_size * LLUI::sGLScaleFactor.mV[VY]));
581 } 585 }
582 586
583// LLTextureView::addDebugImage(simimage); 587// LLTextureView::addDebugImage(simimage);