Variable Size Regions! Support for prehash RegionSizeX and large patches. (WIP)
Mostly from Ukando, tweaked a bit to be cleaner, and a little less dramatic. decode_patch_header now takes a bool optionally, as third argument. _PREHASH_RegionSizeX is the only used of the two _PREHASH_RegionSize*. llsurface.cpp: Copy the connectNeighbor for variable size regions almost directly from Ukando llsurfacepatch.cpp: Patch code from ukando and voodoo. Changed hardcoded 256 constants and such to width functions in: llglsandbox.cpp, llsurface.cpp, llviewerregion.cpp, llviewerparcelmanager, llviewerparcelmgr.cpp, llvowater.cpp, llworld.cpp Use region specific width in: llagent.cpp, llglsandbox.cpp, llmanip.cpp, llmanipscale.cpp, llpanelobject.cpp, llviewerbject.cpp, llwind.cpp Use 256 in llnetmap.cpp in places... llfloaterregioninfo.cpp: Aurora grid has wacky textures. Add LLViewerParcelMgr::widthUpdate() for updating mParcelsPerEdge given a region's width. Used in llstartup now. Add LLWorld::setWidth() for getting a region's size from LLMessageSystem pointers and setting mWidth and mWidthInMeters, accordingly. Called in llviewermessage.cpp as well.
This commit is contained in:
@@ -144,7 +144,7 @@ LLViewerParcelMgr::LLViewerParcelMgr()
|
||||
mHoverParcel = new LLParcel();
|
||||
mCollisionParcel = new LLParcel();
|
||||
|
||||
mParcelsPerEdge = S32( REGION_WIDTH_METERS / PARCEL_GRID_STEP_METERS );
|
||||
mParcelsPerEdge = S32(8192.f / PARCEL_GRID_STEP_METERS); // 8192 is the maximum region size on Aurora and solves the audio problem.
|
||||
mHighlightSegments = new U8[(mParcelsPerEdge+1)*(mParcelsPerEdge+1)];
|
||||
resetSegments(mHighlightSegments);
|
||||
|
||||
@@ -167,9 +167,15 @@ LLViewerParcelMgr::LLViewerParcelMgr()
|
||||
mAgentParcelOverlay[i] = 0;
|
||||
}
|
||||
|
||||
mParcelsPerEdge = S32(REGION_WIDTH_METERS / PARCEL_GRID_STEP_METERS);
|
||||
|
||||
mTeleportInProgress = TRUE; // the initial parcel update is treated like teleport
|
||||
}
|
||||
|
||||
void LLViewerParcelMgr::widthUpdate(F32 region_width)
|
||||
{
|
||||
mParcelsPerEdge = S32(region_width / PARCEL_GRID_STEP_METERS);
|
||||
}
|
||||
|
||||
LLViewerParcelMgr::~LLViewerParcelMgr()
|
||||
{
|
||||
@@ -449,9 +455,9 @@ LLParcelSelectionHandle LLViewerParcelMgr::selectParcelInRectangle()
|
||||
void LLViewerParcelMgr::selectCollisionParcel()
|
||||
{
|
||||
// BUG: Claim to be in the agent's region
|
||||
mWestSouth = gAgent.getRegion()->getOriginGlobal();
|
||||
mWestSouth = getSelectionRegion()->getOriginGlobal();
|
||||
mEastNorth = mWestSouth;
|
||||
mEastNorth += LLVector3d(PARCEL_GRID_STEP_METERS, PARCEL_GRID_STEP_METERS, 0.0);
|
||||
mEastNorth += LLVector3d(getSelectionRegion()->getWidth()/REGION_WIDTH_METERS * PARCEL_GRID_STEP_METERS, getSelectionRegion()->getWidth()/REGION_WIDTH_METERS * PARCEL_GRID_STEP_METERS, 0.0);
|
||||
|
||||
// BUG: must be in the sim you are in
|
||||
LLMessageSystem *msg = gMessageSystem;
|
||||
@@ -1409,8 +1415,7 @@ void LLViewerParcelMgr::processParcelOverlay(LLMessageSystem *msg, void **user)
|
||||
return;
|
||||
}
|
||||
|
||||
S32 parcels_per_edge = LLViewerParcelMgr::getInstance()->mParcelsPerEdge;
|
||||
S32 expected_size = parcels_per_edge * parcels_per_edge / PARCEL_OVERLAY_CHUNKS;
|
||||
const S32 expected_size = 1024;
|
||||
if (packed_overlay_size != expected_size)
|
||||
{
|
||||
llwarns << "Got parcel overlay size " << packed_overlay_size
|
||||
@@ -1473,6 +1478,11 @@ void LLViewerParcelMgr::processParcelProperties(LLMessageSystem *msg, void **use
|
||||
S32 other_clean_time = 0;
|
||||
|
||||
LLViewerParcelMgr& parcel_mgr = LLViewerParcelMgr::instance();
|
||||
LLViewerRegion* msg_region = LLWorld::getInstance()->getRegion(msg->getSender());
|
||||
if(msg_region)
|
||||
parcel_mgr.mParcelsPerEdge = S32(msg_region->getWidth() / PARCEL_GRID_STEP_METERS);
|
||||
else
|
||||
parcel_mgr.mParcelsPerEdge = S32(gAgent.getRegion()->getWidth() / PARCEL_GRID_STEP_METERS);
|
||||
|
||||
msg->getS32Fast(_PREHASH_ParcelData, _PREHASH_RequestResult, request_result );
|
||||
msg->getS32Fast(_PREHASH_ParcelData, _PREHASH_SequenceID, sequence_id );
|
||||
|
||||
Reference in New Issue
Block a user