Remove megaregion support

This commit is contained in:
Siana Gearz
2012-01-14 06:46:16 +01:00
parent 419f7b41af
commit 20ab55752d
24 changed files with 50 additions and 155 deletions

View File

@@ -153,11 +153,6 @@ const char LAND_LAYER_CODE = 'L';
const char WATER_LAYER_CODE = 'W';
const char WIND_LAYER_CODE = '7';
const char CLOUD_LAYER_CODE = '8';
// Extended land layer for Aurora Sim
const char AURORA_LAND_LAYER_CODE = 'M';
const char AURORA_WATER_LAYER_CODE = 'X';
const char AURORA_WIND_LAYER_CODE = '9';
const char AURORA_CLOUD_LAYER_CODE = ':';
// keys
// Bit masks for various keyboard modifier keys.

View File

@@ -67,7 +67,6 @@ const F32 PARCEL_PASS_HOURS_DEFAULT = 1.f;
// Number of "chunks" in which parcel overlay data is sent
// Chunk 0 = southern rows, entire width
// NOTE: NOT USABLE FOR VAR SIZED REGIONS!
const S32 PARCEL_OVERLAY_CHUNKS = 4;
// Bottom three bits are a color index for the land overlay

View File

@@ -590,8 +590,6 @@ char const* const _PREHASH_LastName = LLMessageStringTable::getInstance()->getSt
char const* const _PREHASH_From = LLMessageStringTable::getInstance()->getString("From");
char const* const _PREHASH_RoleChange = LLMessageStringTable::getInstance()->getString("RoleChange");
char const* const _PREHASH_Port = LLMessageStringTable::getInstance()->getString("Port");
char const* const _PREHASH_RegionSizeX = LLMessageStringTable::getInstance()->getString("RegionSizeX");
char const* const _PREHASH_RegionSizeY = LLMessageStringTable::getInstance()->getString("RegionSizeY");
char const* const _PREHASH_MemberTitle = LLMessageStringTable::getInstance()->getString("MemberTitle");
char const* const _PREHASH_LogParcelChanges = LLMessageStringTable::getInstance()->getString("LogParcelChanges");
char const* const _PREHASH_AgentCachedTextureResponse = LLMessageStringTable::getInstance()->getString("AgentCachedTextureResponse");

View File

@@ -590,8 +590,6 @@ extern char const* const _PREHASH_LastName;
extern char const* const _PREHASH_From;
extern char const* const _PREHASH_RoleChange;
extern char const* const _PREHASH_Port;
extern char const* const _PREHASH_RegionSizeX;
extern char const* const _PREHASH_RegionSizeY;
extern char const* const _PREHASH_MemberTitle;
extern char const* const _PREHASH_LogParcelChanges;
extern char const* const _PREHASH_AgentCachedTextureResponse;

View File

@@ -235,7 +235,7 @@ void decode_patch_group_header(LLBitPack &bitpack, LLGroupHeader *gopp)
gPatchSize = gopp->patch_size;
}
void decode_patch_header(LLBitPack &bitpack, LLPatchHeader *ph, BOOL b_large_patch)
void decode_patch_header(LLBitPack &bitpack, LLPatchHeader *ph)
{
U8 retvalu8;
@@ -274,18 +274,15 @@ void decode_patch_header(LLBitPack &bitpack, LLPatchHeader *ph, BOOL b_large_pat
#endif
ph->range = retvalu16;
retvalu32 = 0;
retvalu16 = 0;
#ifdef LL_BIG_ENDIAN
ret = (U8 *)&retvalu16;
bitpack.bitUnpack(&(ret[1]), 8);
bitpack.bitUnpack(&(ret[0]), 2);
#else
if (b_large_patch)
bitpack.bitUnpack((U8 *)&retvalu32, 32);
else
bitpack.bitUnpack((U8 *)&retvalu32, 10);
bitpack.bitUnpack((U8 *)&retvalu16, 10);
#endif
ph->patchids = retvalu32;
ph->patchids = retvalu16;
gWordBits = (ph->quant_wbits & 0xf) + 2;
}

View File

@@ -46,7 +46,7 @@ void end_patch_coding(LLBitPack &bitpack);
void init_patch_decoding(LLBitPack &bitpack);
void decode_patch_group_header(LLBitPack &bitpack, LLGroupHeader *gopp);
void decode_patch_header(LLBitPack &bitpack, LLPatchHeader *ph, BOOL b_large_patch);
void decode_patch_header(LLBitPack &bitpack, LLPatchHeader *ph);
void decode_patch(LLBitPack &bitpack, S32 *patches);
#endif

View File

@@ -79,7 +79,7 @@ public:
F32 dc_offset; // 4 bytes
U16 range; // 2 = 7 ((S16) FP range (breaks if we need > 32K meters in 1 patch)
U8 quant_wbits; // 1 = 8 (upper 4 bits is quant - 2, lower 4 bits is word bits - 2)
U32 patchids; // 2 = 10 (actually only uses 10 bits, 5 for each)
U16 patchids; // 2 = 10 (actually only uses 10 bits, 5 for each)
};
// Compression routines

View File

@@ -440,7 +440,7 @@ void LLCloudLayer::decompress(LLBitPack &bitpack, LLGroupHeader *group_headerp)
group_headerp->stride = group_headerp->patch_size; // offset required to step up one row
set_group_of_patch_header(group_headerp);
decode_patch_header(bitpack, &patch_header, FALSE);
decode_patch_header(bitpack, &patch_header);
decode_patch(bitpack, gBuffer);
decompress_patch(mDensityp, gBuffer, &patch_header);
}

View File

@@ -1092,11 +1092,10 @@ BOOL LLPanelRegionTextureInfo::sendUpdate()
llinfos << "LLPanelRegionTextureInfo::sendUpdate()" << llendl;
// Make sure user hasn't chosen wacky textures.
// -Revolution Allow 'wacky' things
//if (!validateTextureSizes())
//{
// return FALSE;
//}
if (!validateTextureSizes())
{
return FALSE;
}
LLTextureCtrl* texture_ctrl;
std::string buffer;

View File

@@ -610,7 +610,7 @@ void LLViewerParcelMgr::renderOneSegment(F32 x1, F32 y1, F32 x2, F32 y2, F32 hei
return;
// HACK: At edge of last region of world, we need to make sure the region
// resolves correctly so we can get a height value.
const F32 BORDER = regionp->getWidth() - 0.1f;
const F32 BORDER = REGION_WIDTH_METERS - 0.1f;
F32 clamped_x1 = x1;
F32 clamped_y1 = y1;

View File

@@ -377,9 +377,6 @@ bool idle_startup()
static std::string password;
static std::vector<const char*> requested_options;
static U32 first_sim_size_x = 256;
static U32 first_sim_size_y = 256;
static LLVector3 initial_sun_direction(1.f, 0.f, 0.f);
static LLVector3 agent_start_position_region(10.f, 10.f, 10.f); // default for when no space server
static LLVector3 agent_start_look_at(1.0f, 0.f, 0.f);
@@ -1681,17 +1678,7 @@ bool idle_startup()
U32 region_y = strtoul(region_y_str.c_str(), NULL, 10);
gFirstSimHandle = to_region_handle(region_x, region_y);
}
text = LLUserAuth::getInstance()->getResponse("region_size_x");
if(!text.empty()) {
first_sim_size_x = strtoul(text.c_str(), NULL, 10);
LLViewerParcelMgr::getInstance()->init(first_sim_size_x);
}
//region Y size is currently unused, major refactoring required. - Patrick Sapinski (2/10/2011)
text = LLUserAuth::getInstance()->getResponse("region_size_y");
if(!text.empty()) first_sim_size_y = strtoul(text.c_str(), NULL, 10);
const std::string look_at_str = LLUserAuth::getInstance()->getResponse("look_at");
if (!look_at_str.empty())
{
@@ -1976,7 +1963,7 @@ bool idle_startup()
gAgent.initOriginGlobal(from_region_handle(gFirstSimHandle));
LLWorld::getInstance()->addRegion(gFirstSimHandle, gFirstSim, first_sim_size_x, first_sim_size_y);
LLWorld::getInstance()->addRegion(gFirstSimHandle, gFirstSim);
LLViewerRegion *regionp = LLWorld::getInstance()->getRegionFromHandle(gFirstSimHandle);
LL_INFOS("AppInit") << "Adding initial simulator " << regionp->getOriginGlobal() << LL_ENDL;

View File

@@ -299,7 +299,7 @@ void LLSurface::initTextures()
mWaterObjp = (LLVOWater *)gObjectList.createObjectViewer(LLViewerObject::LL_VO_WATER, mRegionp);
gPipeline.createObject(mWaterObjp);
LLVector3d water_pos_global = from_region_handle(mRegionp->getHandle());
water_pos_global += LLVector3d(mRegionp->getWidth()/2, mRegionp->getWidth()/2, DEFAULT_WATER_HEIGHT);
water_pos_global += LLVector3d(128.0, 128.0, DEFAULT_WATER_HEIGHT);
mWaterObjp->setPositionGlobal(water_pos_global);
}
}
@@ -329,8 +329,8 @@ void LLSurface::setOriginGlobal(const LLVector3d &origin_global)
// Hack!
if (mWaterObjp.notNull() && mWaterObjp->mDrawable.notNull())
{
const F64 x = origin_global.mdV[VX] + (F64)mRegionp->getWidth()/2;
const F64 y = origin_global.mdV[VY] + (F64)mRegionp->getWidth()/2;
const F64 x = origin_global.mdV[VX] + 128.0;
const F64 y = origin_global.mdV[VY] + 128.0;
const F64 z = mWaterObjp->getPositionGlobal().mdV[VZ];
LLVector3d water_origin_global(x, y, z);
@@ -691,22 +691,14 @@ void LLSurface::decompressDCTPatch(LLBitPack &bitpack, LLGroupHeader *gopp, BOOL
while (1)
{
decode_patch_header(bitpack, &ph, b_large_patch);
decode_patch_header(bitpack, &ph);
if (ph.quant_wbits == END_OF_PATCHES)
{
break;
}
if (b_large_patch)
{
i = ph.patchids >> 16; //x
j = ph.patchids & 0xFFFF; //y
}
else
{
i = ph.patchids >> 5; //x
j = ph.patchids & 0x1F; //y
}
i = ph.patchids >> 5;
j = ph.patchids & 0x1F;
if ((i >= mPatchesPerEdge) || (j >= mPatchesPerEdge))
{

View File

@@ -3760,18 +3760,6 @@ void process_teleport_finish(LLMessageSystem* msg, void**)
U32 teleport_flags;
msg->getU32Fast(_PREHASH_Info, _PREHASH_TeleportFlags, teleport_flags);
U32 region_size_x = 256;
msg->getU32Fast(_PREHASH_Info, _PREHASH_RegionSizeX, region_size_x);
U32 region_size_y = 256;
msg->getU32Fast(_PREHASH_Info, _PREHASH_RegionSizeY, region_size_y);
//and a little hack for Second Life compatibility
if (region_size_y == 0 || region_size_x == 0)
{
region_size_x = 256;
region_size_y = 256;
}
std::string seedCap;
msg->getStringFast(_PREHASH_Info, _PREHASH_SeedCapability, seedCap);
@@ -3791,7 +3779,7 @@ void process_teleport_finish(LLMessageSystem* msg, void**)
// Viewer trusts the simulator.
gMessageSystem->enableCircuit(sim_host, TRUE);
LLViewerRegion* regionp = LLWorld::getInstance()->addRegion(region_handle, sim_host, region_size_x, region_size_y);
LLViewerRegion* regionp = LLWorld::getInstance()->addRegion(region_handle, sim_host);
/*
// send camera update to new region
@@ -4096,22 +4084,9 @@ void process_crossed_region(LLMessageSystem* msg, void**)
std::string seedCap;
msg->getStringFast(_PREHASH_RegionData, _PREHASH_SeedCapability, seedCap);
U32 region_size_x = 256;
msg->getU32(_PREHASH_RegionData, _PREHASH_RegionSizeX, region_size_x);
U32 region_size_y = 256;
msg->getU32(_PREHASH_RegionData, _PREHASH_RegionSizeY, region_size_y);
//and a little hack for Second Life compatibility
if (region_size_y == 0 || region_size_x == 0)
{
region_size_x = 256;
region_size_y = 256;
}
send_complete_agent_movement(sim_host);
LLViewerRegion* regionp = LLWorld::getInstance()->addRegion(region_handle, sim_host, region_size_x, region_size_y);
LLViewerRegion* regionp = LLWorld::getInstance()->addRegion(region_handle, sim_host);
regionp->setSeedCapability(seedCap);
}

View File

@@ -143,18 +143,7 @@ LLViewerParcelMgr::LLViewerParcelMgr()
mAgentParcel = new LLParcel();
mHoverParcel = new LLParcel();
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.
//LLViewerParcelMgr needs to be changed so we either get an instance per region, or it handles various region sizes
//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 );
mHighlightSegments = new U8[(mParcelsPerEdge+1)*(mParcelsPerEdge+1)];
resetSegments(mHighlightSegments);
@@ -162,8 +151,13 @@ void LLViewerParcelMgr::init(F32 region_size)
mCollisionSegments = new U8[(mParcelsPerEdge+1)*(mParcelsPerEdge+1)];
resetSegments(mCollisionSegments);
S32 mParcelOverLayChunks = region_size * region_size / (128 * 128);
S32 overlay_size = mParcelsPerEdge * mParcelsPerEdge / mParcelOverLayChunks;
// JC: Resolved a merge conflict here, eliminated
// mBlockedImage->setAddressMode(LLTexUnit::TAM_WRAP);
// because it is done in llviewertexturelist.cpp
mBlockedImage = LLViewerTextureManager::getFetchedTextureFromFile("noentrylines.j2c");
mPassImage = LLViewerTextureManager::getFetchedTextureFromFile("noentrypasslines.j2c");
S32 overlay_size = mParcelsPerEdge * mParcelsPerEdge / PARCEL_OVERLAY_CHUNKS;
sPackedOverlay = new U8[overlay_size];
mAgentParcelOverlay = new U8[mParcelsPerEdge * mParcelsPerEdge];
@@ -1415,7 +1409,8 @@ void LLViewerParcelMgr::processParcelOverlay(LLMessageSystem *msg, void **user)
return;
}
S32 expected_size = 1024;
S32 parcels_per_edge = LLViewerParcelMgr::getInstance()->mParcelsPerEdge;
S32 expected_size = parcels_per_edge * parcels_per_edge / PARCEL_OVERLAY_CHUNKS;
if (packed_overlay_size != expected_size)
{
llwarns << "Got parcel overlay size " << packed_overlay_size

View File

@@ -90,8 +90,6 @@ public:
LLViewerParcelMgr();
~LLViewerParcelMgr();
void init(F32 region_size);
static void cleanupGlobals();
BOOL selectionEmpty() const;

View File

@@ -59,7 +59,6 @@ const U8 OVERLAY_IMG_COMPONENTS = 4;
LLViewerParcelOverlay::LLViewerParcelOverlay(LLViewerRegion* region, F32 region_width_meters)
: mRegion( region ),
mParcelGridsPerEdge( S32( region_width_meters / PARCEL_GRID_STEP_METERS ) ),
mRegionSize(S32(region_width_meters)),
mDirty( FALSE ),
mTimeSinceLastUpdate(),
mOverlayTextureIdx(-1),
@@ -414,8 +413,7 @@ void LLViewerParcelOverlay::uncompressLandOverlay(S32 chunk, U8 *packed_overlay)
{
// Unpack the message data into the ownership array
S32 size = mParcelGridsPerEdge * mParcelGridsPerEdge;
S32 mParcelOverLayChunks = mRegionSize * mRegionSize / (128 * 128);
S32 chunk_size = size / mParcelOverLayChunks;
S32 chunk_size = size / PARCEL_OVERLAY_CHUNKS;
memcpy(mOwnership + chunk*chunk_size, packed_overlay, chunk_size); /*Flawfinder: ignore*/

View File

@@ -109,7 +109,6 @@ private:
LLViewerRegion* mRegion;
S32 mParcelGridsPerEdge;
S32 mRegionSize;
LLPointer<LLViewerTexture> mTexture;
LLPointer<LLImageRaw> mImageRaw;

View File

@@ -270,8 +270,6 @@ 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);
}
else
{

View File

@@ -56,26 +56,18 @@ LLVLManager::~LLVLManager()
void LLVLManager::addLayerData(LLVLData *vl_datap, const S32 mesg_size)
{
if (LAND_LAYER_CODE == vl_datap->mType ||
AURORA_LAND_LAYER_CODE == vl_datap->mType)
if (LAND_LAYER_CODE == vl_datap->mType)
{
mLandBits += mesg_size * 8;
}
else if (WIND_LAYER_CODE == vl_datap->mType ||
AURORA_WIND_LAYER_CODE == vl_datap->mType)
else if (WIND_LAYER_CODE == vl_datap->mType)
{
mWindBits += mesg_size * 8;
}
else if (CLOUD_LAYER_CODE == vl_datap->mType ||
AURORA_CLOUD_LAYER_CODE == vl_datap->mType)
else if (CLOUD_LAYER_CODE == vl_datap->mType)
{
mCloudBits += mesg_size * 8;
}
else if (WATER_LAYER_CODE == vl_datap->mType ||
AURORA_CLOUD_LAYER_CODE == vl_datap->mType)
{
mWaterBits += mesg_size * 8;
}
else
{
llerrs << "Unknown layer type!" << (S32)vl_datap->mType << llendl;
@@ -101,25 +93,15 @@ void LLVLManager::unpackData(const S32 num_packets)
{
datap->mRegionp->getLand().decompressDCTPatch(bit_pack, &goph, FALSE);
}
else if (AURORA_LAND_LAYER_CODE == datap->mType)
{
datap->mRegionp->getLand().decompressDCTPatch(bit_pack, &goph, TRUE);
}
else if (WIND_LAYER_CODE == datap->mType ||
AURORA_WIND_LAYER_CODE == datap->mType)
else if (WIND_LAYER_CODE == datap->mType)
{
datap->mRegionp->mWind.decompress(bit_pack, &goph);
}
else if (CLOUD_LAYER_CODE == datap->mType ||
AURORA_CLOUD_LAYER_CODE == datap->mType)
else if (CLOUD_LAYER_CODE == datap->mType)
{
datap->mRegionp->mCloudLayer.decompress(bit_pack, &goph);
}
else if (WATER_LAYER_CODE == datap->mType ||
AURORA_WATER_LAYER_CODE == datap->mType)
{
}
}
for (i = 0; i < mPacketData.count(); i++)

View File

@@ -65,7 +65,6 @@ protected:
U32 mLandBits;
U32 mWindBits;
U32 mCloudBits;
U32 mWaterBits;
};
class LLVLData

View File

@@ -74,7 +74,7 @@ LLVOWater::LLVOWater(const LLUUID &id,
{
// Terrain must draw during selection passes so it can block objects behind it.
mbCanSelect = FALSE;
setScale(LLVector3(mRegionp->getWidth(), mRegionp->getWidth(), 0.f)); // Hack for setting scale for bounding boxes/visibility.
setScale(LLVector3(256.f, 256.f, 0.f)); // Hack for setting scale for bounding boxes/visibility.
mUseTexture = TRUE;
mIsEdgePatch = FALSE;

View File

@@ -121,12 +121,12 @@ void LLWind::decompress(LLBitPack &bitpack, LLGroupHeader *group_headerp)
set_group_of_patch_header(group_headerp);
// X component
decode_patch_header(bitpack, &patch_header, FALSE);
decode_patch_header(bitpack, &patch_header);
decode_patch(bitpack, buffer);
decompress_patch(mVelX, buffer, &patch_header);
// Y component
decode_patch_header(bitpack, &patch_header, FALSE);
decode_patch_header(bitpack, &patch_header);
decode_patch(bitpack, buffer);
decompress_patch(mVelY, buffer, &patch_header);

View File

@@ -80,12 +80,12 @@ const S32 WORLD_PATCH_SIZE = 16;
extern LLColor4U MAX_WATER_COLOR;
U32 LLWorld::mWidth = 256;
const U32 LLWorld::mWidth = 256;
// meters/point, therefore mWidth * mScale = meters per edge
const F32 LLWorld::mScale = 1.f;
F32 LLWorld::mWidthInMeters = mWidth * mScale;
const F32 LLWorld::mWidthInMeters = mWidth * mScale;
//
// Functions
@@ -146,7 +146,7 @@ void LLWorld::destroyClass()
}
LLViewerRegion* LLWorld::addRegion(const U64 &region_handle, const LLHost &host, const U32 &region_size_x, const U32 &region_size_y)
LLViewerRegion* LLWorld::addRegion(const U64 &region_handle, const LLHost &host)
{
LLMemType mt(LLMemType::MTYPE_REGIONS);
llinfos << "Add region with handle: " << region_handle << " on host " << host << llendl;
@@ -179,11 +179,9 @@ LLViewerRegion* LLWorld::addRegion(const U64 &region_handle, const LLHost &host,
U32 iindex = 0;
U32 jindex = 0;
mWidth = region_size_x; //MegaRegion
mWidthInMeters = mWidth * mScale; //MegaRegion
from_region_handle(region_handle, &iindex, &jindex);
S32 x = (S32)(iindex/256); //MegaRegion
S32 y = (S32)(jindex/256); //MegaRegion
S32 x = (S32)(iindex/mWidth);
S32 y = (S32)(jindex/mWidth);
llinfos << "Adding new region (" << x << ":" << y << ")" << llendl;
llinfos << "Host: " << host << llendl;
@@ -837,7 +835,7 @@ F32 LLWorld::getLandFarClip() const
void LLWorld::setLandFarClip(const F32 far_clip)
{
static S32 const rwidth = (S32)getRegionWidthInMeters();
static S32 const rwidth = (S32)REGION_WIDTH_U32;
S32 const n1 = (llceil(mLandFarClip) - 1) / rwidth;
S32 const n2 = (llceil(far_clip) - 1) / rwidth;
bool need_water_objects_update = n1 != n2;
@@ -1267,21 +1265,9 @@ void process_enable_simulator(LLMessageSystem *msg, void **user_data)
// which simulator should we modify?
LLHost sim(ip_u32, port);
U32 region_size_x = 256;
msg->getU32Fast(_PREHASH_SimulatorInfo, _PREHASH_RegionSizeX, region_size_x);
U32 region_size_y = 256;
msg->getU32Fast(_PREHASH_SimulatorInfo, _PREHASH_RegionSizeY, region_size_y);
if (region_size_y == 0 || region_size_x == 0)
{
region_size_x = 256;
region_size_y = 256;
}
// Viewer trusts the simulator.
msg->enableCircuit(sim, TRUE);
LLWorld::getInstance()->addRegion(handle, sim, region_size_x, region_size_y);
LLWorld::getInstance()->addRegion(handle, sim);
// give the simulator a message it can use to get ip and port
llinfos << "simulator_enable() Enabling " << sim << " with code " << msg->getOurCircuitCode() << llendl;

View File

@@ -71,7 +71,7 @@ public:
LLWorld();
void destroyClass();
LLViewerRegion* addRegion(const U64 &region_handle, const LLHost &host, const U32 &region_size_x, const U32 &region_size_y);
LLViewerRegion* addRegion(const U64 &region_handle, const LLHost &host);
// safe to call if already present, does the "right thing" if
// hosts are same, or if hosts are different, etc...
void removeRegion(const LLHost &host);
@@ -170,12 +170,12 @@ private:
region_list_t mCulledRegionList;
// Number of points on edge
static U32 mWidth;
static const U32 mWidth;
// meters/point, therefore mWidth * mScale = meters per edge
static const F32 mScale;
static F32 mWidthInMeters;
static const F32 mWidthInMeters;
F32 mLandFarClip; // Far clip distance for land.
LLPatchVertexArray mLandPatch;