From a50f0008b2afb78b4a1f63fe4defbefb49800b34 Mon Sep 17 00:00:00 2001 From: Lirusaito Date: Thu, 3 Jan 2013 05:57:55 -0500 Subject: [PATCH 001/302] 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. --- indra/llmessage/message_prehash.cpp | 1 + indra/llmessage/message_prehash.h | 1 + indra/llmessage/patch_code.cpp | 27 +++-- indra/llmessage/patch_code.h | 2 +- indra/llmessage/patch_dct.h | 2 +- indra/newview/llagent.cpp | 2 +- indra/newview/llfloaterregioninfo.cpp | 5 +- indra/newview/llglsandbox.cpp | 4 +- indra/newview/llmanip.cpp | 4 +- indra/newview/llmanipscale.cpp | 2 +- indra/newview/llnetmap.cpp | 18 +-- indra/newview/llpanelobject.cpp | 2 +- indra/newview/llstartup.cpp | 5 +- indra/newview/llsurface.cpp | 143 ++++++++++++++++-------- indra/newview/llsurfacepatch.cpp | 46 ++++++-- indra/newview/llviewermessage.cpp | 7 +- indra/newview/llviewerobject.cpp | 2 +- indra/newview/llviewerparcelmgr.cpp | 20 +++- indra/newview/llviewerparcelmgr.h | 1 + indra/newview/llviewerparceloverlay.cpp | 4 +- indra/newview/llviewerparceloverlay.h | 1 + indra/newview/llviewerregion.cpp | 34 +++--- indra/newview/llvowater.cpp | 2 +- indra/newview/llwind.cpp | 6 +- indra/newview/llworld.cpp | 96 ++++++++++++---- indra/newview/llworld.h | 8 +- indra/newview/llworldmap.cpp | 21 +++- 27 files changed, 323 insertions(+), 143 deletions(-) diff --git a/indra/llmessage/message_prehash.cpp b/indra/llmessage/message_prehash.cpp index 6d1d3498c..63119a358 100644 --- a/indra/llmessage/message_prehash.cpp +++ b/indra/llmessage/message_prehash.cpp @@ -584,6 +584,7 @@ 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_MemberTitle = LLMessageStringTable::getInstance()->getString("MemberTitle"); char const* const _PREHASH_LogParcelChanges = LLMessageStringTable::getInstance()->getString("LogParcelChanges"); char const* const _PREHASH_AgentCachedTextureResponse = LLMessageStringTable::getInstance()->getString("AgentCachedTextureResponse"); diff --git a/indra/llmessage/message_prehash.h b/indra/llmessage/message_prehash.h index d388d8629..0130f399b 100644 --- a/indra/llmessage/message_prehash.h +++ b/indra/llmessage/message_prehash.h @@ -584,6 +584,7 @@ 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_MemberTitle; extern char const* const _PREHASH_LogParcelChanges; extern char const* const _PREHASH_AgentCachedTextureResponse; diff --git a/indra/llmessage/patch_code.cpp b/indra/llmessage/patch_code.cpp index e5d7f1944..7d8559931 100644 --- a/indra/llmessage/patch_code.cpp +++ b/indra/llmessage/patch_code.cpp @@ -229,7 +229,7 @@ void decode_patch_group_header(LLBitPack &bitpack, LLGroupHeader *gopp) gPatchSize = gopp->patch_size; } -void decode_patch_header(LLBitPack &bitpack, LLPatchHeader *ph) +void decode_patch_header(LLBitPack &bitpack, LLPatchHeader *ph, bool b_large_patch) { U8 retvalu8; @@ -268,15 +268,28 @@ void decode_patch_header(LLBitPack &bitpack, LLPatchHeader *ph) #endif ph->range = retvalu16; - retvalu16 = 0; + retvalu32 = 0; #ifdef LL_BIG_ENDIAN - ret = (U8 *)&retvalu16; - bitpack.bitUnpack(&(ret[1]), 8); - bitpack.bitUnpack(&(ret[0]), 2); + ret = (U8*)&retvalu32; + if (b_large_patch) + { + bitpack.bitUnpack(&(ret[3]), 8); + bitpack.bitUnpack(&(ret[2]), 8); + bitpack.bitUnpack(&(ret[1]), 8); + bitpack.bitUnpack(&(ret[0]), 8); + } + else + { + bitpack.bitUnpack(&(ret[1]), 8); + bitpack.bitUnpack(&(ret[0]), 2); + } #else - bitpack.bitUnpack((U8 *)&retvalu16, 10); + if (b_large_patch) + bitpack.bitUnpack((U8*)&retvalu32, 32); + else + bitpack.bitUnpack((U8*)&retvalu32, 10); #endif - ph->patchids = retvalu16; + ph->patchids = retvalu32; gWordBits = (ph->quant_wbits & 0xf) + 2; } diff --git a/indra/llmessage/patch_code.h b/indra/llmessage/patch_code.h index 4c87c9808..bdaabe70b 100644 --- a/indra/llmessage/patch_code.h +++ b/indra/llmessage/patch_code.h @@ -40,7 +40,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); +void decode_patch_header(LLBitPack &bitpack, LLPatchHeader *ph, bool b_large_patch = false); void decode_patch(LLBitPack &bitpack, S32 *patches); #endif diff --git a/indra/llmessage/patch_dct.h b/indra/llmessage/patch_dct.h index 101231ec8..9f5d60425 100644 --- a/indra/llmessage/patch_dct.h +++ b/indra/llmessage/patch_dct.h @@ -73,7 +73,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) - U16 patchids; // 2 = 10 (actually only uses 10 bits, 5 for each) + U32 patchids; // 2 = 10 (actually only uses 10 bits, 5 for each) }; // Compression routines diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp index 61b771ea2..c74e59cd6 100644 --- a/indra/newview/llagent.cpp +++ b/indra/newview/llagent.cpp @@ -2272,7 +2272,7 @@ void LLAgent::setStartPosition( U32 location_id ) // this simulator. Clamp it to the region the agent is // in, a little bit in on each side. const F32 INSET = 0.5f; //meters - const F32 REGION_WIDTH = LLWorld::getInstance()->getRegionWidthInMeters(); + const F32 REGION_WIDTH = getRegion()->getWidth(); LLVector3 agent_pos = getPositionAgent(); diff --git a/indra/newview/llfloaterregioninfo.cpp b/indra/newview/llfloaterregioninfo.cpp index bc6dbbde0..a6978fc68 100644 --- a/indra/newview/llfloaterregioninfo.cpp +++ b/indra/newview/llfloaterregioninfo.cpp @@ -82,6 +82,7 @@ #include "llviewerwindow.h" #include "llvlcomposition.h" #include "llagentui.h" +#include "hippogridmanager.h" // [RLVa:KB] #include "rlvhandler.h" // [/RLVa:KB] @@ -1105,8 +1106,8 @@ BOOL LLPanelRegionTextureInfo::sendUpdate() { llinfos << "LLPanelRegionTextureInfo::sendUpdate()" << llendl; - // Make sure user hasn't chosen wacky textures. - if (!validateTextureSizes()) + // Make sure user hasn't chosen wacky textures on sl grids. + if (gHippoGridManager->getConnectedGrid()->isSecondLife() && !validateTextureSizes()) { return FALSE; } diff --git a/indra/newview/llglsandbox.cpp b/indra/newview/llglsandbox.cpp index be658d131..e41080de7 100644 --- a/indra/newview/llglsandbox.cpp +++ b/indra/newview/llglsandbox.cpp @@ -297,7 +297,7 @@ void LLWind::renderVectors() S32 i,j; F32 x,y; - F32 region_width_meters = LLWorld::getInstance()->getRegionWidthInMeters(); + F32 region_width_meters = gAgent.getRegion()->getWidth(); gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); gGL.pushMatrix(); @@ -505,7 +505,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 = REGION_WIDTH_METERS - 0.1f; + const F32 BORDER = regionp->getWidth() - 0.1f; F32 clamped_x1 = x1; F32 clamped_y1 = y1; diff --git a/indra/newview/llmanip.cpp b/indra/newview/llmanip.cpp index 3ffb93f69..40da060fb 100644 --- a/indra/newview/llmanip.cpp +++ b/indra/newview/llmanip.cpp @@ -53,9 +53,9 @@ #include "llviewercamera.h" #include "llviewerjoint.h" #include "llviewerobject.h" +#include "llviewerregion.h" #include "llviewerwindow.h" #include "llvoavatar.h" -#include "llworld.h" // for LLWorld::getInstance() #include "llresmgr.h" #include "pipeline.h" #include "llglheaders.h" @@ -405,7 +405,7 @@ void LLManip::renderGuidelines(BOOL draw_x, BOOL draw_y, BOOL draw_z) grid_rot.getAngleAxis(&angle_radians, &x, &y, &z); gGL.rotatef(angle_radians * RAD_TO_DEG, x, y, z); - F32 region_size = LLWorld::getInstance()->getRegionWidthInMeters(); + F32 region_size = object->getRegion()->getWidth(); const F32 LINE_ALPHA = 0.33f; diff --git a/indra/newview/llmanipscale.cpp b/indra/newview/llmanipscale.cpp index e1e6552f9..d6668c838 100644 --- a/indra/newview/llmanipscale.cpp +++ b/indra/newview/llmanipscale.cpp @@ -1356,7 +1356,7 @@ void LLManipScale::renderGuidelinesPart( const LLBBox& bbox ) guideline_end -= guideline_start; guideline_end.normVec(); - guideline_end *= LLWorld::getInstance()->getRegionWidthInMeters(); + guideline_end *= gAgent.getRegion()->getWidth(); guideline_end += guideline_start; { diff --git a/indra/newview/llnetmap.cpp b/indra/newview/llnetmap.cpp index 724b15c94..be47072d5 100644 --- a/indra/newview/llnetmap.cpp +++ b/indra/newview/llnetmap.cpp @@ -105,7 +105,7 @@ LLNetMap::LLNetMap(const std::string& name) : mUpdateNow( FALSE ) { mScale = gSavedSettings.getF32("MiniMapScale"); - mPixelsPerMeter = mScale / LLWorld::getInstance()->getRegionWidthInMeters(); + mPixelsPerMeter = mScale / REGION_WIDTH_METERS; mDotRadius = llmax(DOT_SCALE * mPixelsPerMeter, MIN_DOT_RADIUS); mObjectImageCenterGlobal = gAgentCamera.getCameraPositionGlobal(); @@ -161,13 +161,13 @@ void LLNetMap::setScale( F32 scale ) F32 height = (F32)(getRect().getHeight()); F32 diameter = sqrt(width * width + height * height); F32 region_widths = diameter / mScale; - F32 meters = region_widths * LLWorld::getInstance()->getRegionWidthInMeters(); + F32 meters = region_widths * REGION_WIDTH_METERS; F32 num_pixels = (F32)mObjectImagep->getWidth(); mObjectMapTPM = num_pixels / meters; mObjectMapPixels = diameter; } - mPixelsPerMeter = mScale / LLWorld::getInstance()->getRegionWidthInMeters(); + mPixelsPerMeter = mScale / REGION_WIDTH_METERS; mDotRadius = llmax(DOT_SCALE * mPixelsPerMeter, MIN_DOT_RADIUS); mUpdateNow = TRUE; @@ -262,8 +262,8 @@ void LLNetMap::draw() // background region rectangle F32 bottom = relative_y; F32 left = relative_x; - F32 top = bottom + mScale ; - F32 right = left + mScale ; + F32 top = bottom + region_width/256 * mScale ; + F32 right = left + region_width/256 * mScale ; gGL.color4fv(regionp == gAgent.getRegion() ? this_region_color.mV : live_region_color.mV); if (!regionp->isAlive()) @@ -332,8 +332,8 @@ void LLNetMap::draw() LLVector3 map_center_agent = gAgent.getPosAgentFromGlobal(mObjectImageCenterGlobal); map_center_agent -= gAgentCamera.getCameraPositionAgent(); - map_center_agent.mV[0] *= mScale/LLWorld::getInstance()->getRegionWidthInMeters(); - map_center_agent.mV[1] *= mScale/LLWorld::getInstance()->getRegionWidthInMeters(); + map_center_agent.mV[0] *= mScale/256; + map_center_agent.mV[1] *= mScale/256; gGL.getTexUnit(0)->bind(mObjectImagep); F32 image_half_width = 0.5f*mObjectMapPixels; @@ -470,7 +470,7 @@ void LLNetMap::draw() dot_width); // Draw frustum - F32 meters_to_pixels = mScale/ LLWorld::getInstance()->getRegionWidthInMeters(); + F32 meters_to_pixels = mScale/ REGION_WIDTH_METERS; F32 horiz_fov = LLViewerCamera::getInstance()->getView() * LLViewerCamera::getInstance()->getAspect(); F32 far_clip_meters = LLViewerCamera::getInstance()->getFar(); @@ -597,7 +597,7 @@ LLVector3d LLNetMap::viewPosToGlobal( S32 x, S32 y, BOOL rotated ) pos_local.rotVec( rot ); } - pos_local *= ( LLWorld::getInstance()->getRegionWidthInMeters() / mScale ); + pos_local *= ( REGION_WIDTH_METERS / mScale ); LLVector3d pos_global; pos_global.setVec( pos_local ); diff --git a/indra/newview/llpanelobject.cpp b/indra/newview/llpanelobject.cpp index b1f702bcd..88871d4cc 100644 --- a/indra/newview/llpanelobject.cpp +++ b/indra/newview/llpanelobject.cpp @@ -2522,7 +2522,7 @@ void LLPanelObject::onPastePos(void* user_data) LLPanelObject* self = (LLPanelObject*) user_data; LLCalc* calcp = LLCalc::getInstance(); - float region_width = LLWorld::getInstance()->getRegionWidthInMeters(); + float region_width = gAgent.getRegion()->getWidth(); mClipboardPos.mV[VX] = llclamp( mClipboardPos.mV[VX], -3.5f, region_width); mClipboardPos.mV[VY] = llclamp( mClipboardPos.mV[VY], -3.5f, region_width); mClipboardPos.mV[VZ] = llclamp( mClipboardPos.mV[VZ], -3.5f, 4096.f); diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index 6d1e2d92c..3a86800f5 100644 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -4197,7 +4197,10 @@ bool process_login_success_response(std::string& password) U32 region_y = strtoul(region_y_str.c_str(), NULL, 10); gFirstSimHandle = to_region_handle(region_x, region_y); } - + + text = response["region_size_x"].asString(); + if (!text.empty()) LLViewerParcelMgr::getInstance()->widthUpdate(atoi(text.c_str())); + const std::string look_at_str = response["look_at"]; if (!look_at_str.empty()) { diff --git a/indra/newview/llsurface.cpp b/indra/newview/llsurface.cpp index bd1b99911..9b9376d11 100644 --- a/indra/newview/llsurface.cpp +++ b/indra/newview/llsurface.cpp @@ -172,6 +172,7 @@ 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); @@ -295,7 +296,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(128.0, 128.0, DEFAULT_WATER_HEIGHT); + water_pos_global += LLVector3d(mRegionp->getWidth()/2, mRegionp->getWidth()/2, DEFAULT_WATER_HEIGHT); mWaterObjp->setPositionGlobal(water_pos_global); } } @@ -325,8 +326,8 @@ void LLSurface::setOriginGlobal(const LLVector3d &origin_global) // Hack! if (mWaterObjp.notNull() && mWaterObjp->mDrawable.notNull()) { - const F64 x = origin_global.mdV[VX] + 128.0; - const F64 y = origin_global.mdV[VY] + 128.0; + const F64 x = origin_global.mdV[VX] + (F64)mRegionp->getWidth()/2; + const F64 y = origin_global.mdV[VY] + (F64)mRegionp->getWidth()/2; const F64 z = mWaterObjp->getPositionGlobal().mdV[VZ]; LLVector3d water_origin_global(x, y, z); @@ -364,15 +365,49 @@ void LLSurface::connectNeighbor(LLSurface *neighborp, U32 direction) { S32 i; LLSurfacePatch *patchp, *neighbor_patchp; + S32 neighborPatchesPerEdge = neighborp->mPatchesPerEdge; mNeighbors[direction] = neighborp; neighborp->mNeighbors[gDirOpposite[direction]] = this; + S32 ppe[2]; + S32 own_offset[2] = {0, 0}; + S32 neighbor_offset[2] = {0, 0}; + U32 own_xpos, own_ypos, neighbor_xpos, neighbor_ypos; + + ppe[0] = (mPatchesPerEdge < neighborPatchesPerEdge) ? mPatchesPerEdge : neighborPatchesPerEdge; // used for x + ppe[1] = ppe[0]; // used for y + + from_region_handle(mRegionp->getHandle(), &own_xpos, &own_ypos); + from_region_handle(neighborp->getRegion()->getHandle(), &neighbor_xpos, &neighbor_ypos); + + if(own_ypos >= neighbor_ypos) + { + neighbor_offset[1] = (own_ypos - neighbor_ypos) / mGridsPerPatchEdge; + ppe[1] = llmin(mPatchesPerEdge, neighborPatchesPerEdge-neighbor_offset[1]); + } + else + { + own_offset[1] = (neighbor_ypos - own_ypos) / mGridsPerPatchEdge; + ppe[1] = llmin(mPatchesPerEdge-own_offset[1], neighborPatchesPerEdge); + } + + if(own_xpos >= neighbor_xpos) + { + neighbor_offset[0] = (own_xpos - neighbor_xpos) / mGridsPerPatchEdge; + ppe[0] = llmin(mPatchesPerEdge, neighborPatchesPerEdge-neighbor_offset[0]); + } + else + { + own_offset[0] = (neighbor_xpos - own_xpos) / mGridsPerPatchEdge; + ppe[0] = llmin(mPatchesPerEdge-own_offset[0], neighborPatchesPerEdge); + } + // Connect patches if (NORTHEAST == direction) { patchp = getPatch(mPatchesPerEdge - 1, mPatchesPerEdge - 1); - neighbor_patchp = neighborp->getPatch(0, 0); + neighbor_patchp = neighborp->getPatch(neighbor_offset[0], neighbor_offset[1]); //0 patchp->connectNeighbor(neighbor_patchp, direction); neighbor_patchp->connectNeighbor(patchp, gDirOpposite[direction]); @@ -382,8 +417,10 @@ void LLSurface::connectNeighbor(LLSurface *neighborp, U32 direction) } else if (NORTHWEST == direction) { + S32 off = mPatchesPerEdge + neighbor_offset[1] - own_offset[1]; + patchp = getPatch(0, mPatchesPerEdge - 1); - neighbor_patchp = neighborp->getPatch(mPatchesPerEdge - 1, 0); + neighbor_patchp = neighborp->getPatch(neighbor_offset[0] - 1, off); //neighborPatchesPerEdge - 1 patchp->connectNeighbor(neighbor_patchp, direction); neighbor_patchp->connectNeighbor(patchp, gDirOpposite[direction]); @@ -391,18 +428,20 @@ void LLSurface::connectNeighbor(LLSurface *neighborp, U32 direction) else if (SOUTHWEST == direction) { patchp = getPatch(0, 0); - neighbor_patchp = neighborp->getPatch(mPatchesPerEdge - 1, mPatchesPerEdge - 1); + neighbor_patchp = neighborp->getPatch(neighbor_offset[0] - 1, neighbor_offset[1] - 1); //neighborPatchesPerEdge - 1 patchp->connectNeighbor(neighbor_patchp, direction); neighbor_patchp->connectNeighbor(patchp, gDirOpposite[direction]); - neighbor_patchp->updateNorthEdge(); // Only update one of north or east. + neighbor_patchp->updateEastEdge(); // Only update one of north or east. neighbor_patchp->dirtyZ(); } else if (SOUTHEAST == direction) { + S32 off = mPatchesPerEdge + neighbor_offset[0] - own_offset[0]; + patchp = getPatch(mPatchesPerEdge - 1, 0); - neighbor_patchp = neighborp->getPatch(0, mPatchesPerEdge - 1); + neighbor_patchp = neighborp->getPatch(off, neighbor_offset[1] - 1); //0 patchp->connectNeighbor(neighbor_patchp, direction); neighbor_patchp->connectNeighbor(patchp, gDirOpposite[direction]); @@ -410,10 +449,10 @@ void LLSurface::connectNeighbor(LLSurface *neighborp, U32 direction) else if (EAST == direction) { // Do east/west connections, first - for (i = 0; i < (S32)mPatchesPerEdge; i++) + for (i = 0; i < ppe[1]; i++) { - patchp = getPatch(mPatchesPerEdge - 1, i); - neighbor_patchp = neighborp->getPatch(0, i); + patchp = getPatch(mPatchesPerEdge - 1, i + own_offset[1]); + neighbor_patchp = neighborp->getPatch(0, i + neighbor_offset[1]); patchp->connectNeighbor(neighbor_patchp, direction); neighbor_patchp->connectNeighbor(patchp, gDirOpposite[direction]); @@ -423,19 +462,19 @@ void LLSurface::connectNeighbor(LLSurface *neighborp, U32 direction) } // Now do northeast/southwest connections - for (i = 0; i < (S32)mPatchesPerEdge - 1; i++) + for (i = 0; i < ppe[1] - 1; i++) { - patchp = getPatch(mPatchesPerEdge - 1, i); - neighbor_patchp = neighborp->getPatch(0, i+1); + patchp = getPatch(mPatchesPerEdge - 1, i + own_offset[1]); + neighbor_patchp = neighborp->getPatch(0, i+1 + neighbor_offset[1]); patchp->connectNeighbor(neighbor_patchp, NORTHEAST); neighbor_patchp->connectNeighbor(patchp, SOUTHWEST); } // Now do southeast/northwest connections - for (i = 1; i < (S32)mPatchesPerEdge; i++) + for (i = 1; i < ppe[1]; i++) { - patchp = getPatch(mPatchesPerEdge - 1, i); - neighbor_patchp = neighborp->getPatch(0, i-1); + patchp = getPatch(mPatchesPerEdge - 1, i + own_offset[1]); + neighbor_patchp = neighborp->getPatch(0, i-1 + neighbor_offset[1]); patchp->connectNeighbor(neighbor_patchp, SOUTHEAST); neighbor_patchp->connectNeighbor(patchp, NORTHWEST); @@ -444,10 +483,10 @@ void LLSurface::connectNeighbor(LLSurface *neighborp, U32 direction) else if (NORTH == direction) { // Do north/south connections, first - for (i = 0; i < (S32)mPatchesPerEdge; i++) + for (i = 0; i < ppe[0]; i++) { - patchp = getPatch(i, mPatchesPerEdge - 1); - neighbor_patchp = neighborp->getPatch(i, 0); + patchp = getPatch(i + own_offset[0], mPatchesPerEdge - 1); + neighbor_patchp = neighborp->getPatch(i + neighbor_offset[0], 0); patchp->connectNeighbor(neighbor_patchp, direction); neighbor_patchp->connectNeighbor(patchp, gDirOpposite[direction]); @@ -457,19 +496,19 @@ void LLSurface::connectNeighbor(LLSurface *neighborp, U32 direction) } // Do northeast/southwest connections - for (i = 0; i < (S32)mPatchesPerEdge - 1; i++) + for (i = 0; i < ppe[0] - 1; i++) { - patchp = getPatch(i, mPatchesPerEdge - 1); - neighbor_patchp = neighborp->getPatch(i+1, 0); + patchp = getPatch(i + own_offset[0], mPatchesPerEdge - 1); + neighbor_patchp = neighborp->getPatch(i+1 + neighbor_offset[0], 0); patchp->connectNeighbor(neighbor_patchp, NORTHEAST); neighbor_patchp->connectNeighbor(patchp, SOUTHWEST); } // Do southeast/northwest connections - for (i = 1; i < (S32)mPatchesPerEdge; i++) + for (i = 1; i < ppe[0]; i++) { - patchp = getPatch(i, mPatchesPerEdge - 1); - neighbor_patchp = neighborp->getPatch(i-1, 0); + patchp = getPatch(i + own_offset[0], mPatchesPerEdge - 1); + neighbor_patchp = neighborp->getPatch(i-1 + neighbor_offset[0], 0); patchp->connectNeighbor(neighbor_patchp, NORTHWEST); neighbor_patchp->connectNeighbor(patchp, SOUTHEAST); @@ -478,10 +517,10 @@ void LLSurface::connectNeighbor(LLSurface *neighborp, U32 direction) else if (WEST == direction) { // Do east/west connections, first - for (i = 0; i < mPatchesPerEdge; i++) + for (i = 0; i < ppe[1]; i++) { - patchp = getPatch(0, i); - neighbor_patchp = neighborp->getPatch(mPatchesPerEdge - 1, i); + patchp = getPatch(0, i + own_offset[1]); + neighbor_patchp = neighborp->getPatch(neighborPatchesPerEdge - 1, i + neighbor_offset[1]); patchp->connectNeighbor(neighbor_patchp, direction); neighbor_patchp->connectNeighbor(patchp, gDirOpposite[direction]); @@ -491,20 +530,20 @@ void LLSurface::connectNeighbor(LLSurface *neighborp, U32 direction) } // Now do northeast/southwest connections - for (i = 1; i < mPatchesPerEdge; i++) + for (i = 1; i < ppe[1]; i++) { - patchp = getPatch(0, i); - neighbor_patchp = neighborp->getPatch(mPatchesPerEdge - 1, i - 1); + patchp = getPatch(0, i + own_offset[1]); + neighbor_patchp = neighborp->getPatch(neighborPatchesPerEdge - 1, i - 1 + neighbor_offset[1]); patchp->connectNeighbor(neighbor_patchp, SOUTHWEST); neighbor_patchp->connectNeighbor(patchp, NORTHEAST); } // Now do northwest/southeast connections - for (i = 0; i < mPatchesPerEdge - 1; i++) + for (i = 0; i < ppe[1] - 1; i++) { - patchp = getPatch(0, i); - neighbor_patchp = neighborp->getPatch(mPatchesPerEdge - 1, i + 1); + patchp = getPatch(0, i + own_offset[1]); + neighbor_patchp = neighborp->getPatch(neighborPatchesPerEdge - 1, i + 1 + neighbor_offset[1]); patchp->connectNeighbor(neighbor_patchp, NORTHWEST); neighbor_patchp->connectNeighbor(patchp, SOUTHEAST); @@ -513,10 +552,10 @@ void LLSurface::connectNeighbor(LLSurface *neighborp, U32 direction) else if (SOUTH == direction) { // Do north/south connections, first - for (i = 0; i < mPatchesPerEdge; i++) + for (i = 0; i < ppe[0]; i++) { - patchp = getPatch(i, 0); - neighbor_patchp = neighborp->getPatch(i, mPatchesPerEdge - 1); + patchp = getPatch(i + own_offset[0], 0); + neighbor_patchp = neighborp->getPatch(i + neighbor_offset[0], neighborPatchesPerEdge - 1); patchp->connectNeighbor(neighbor_patchp, direction); neighbor_patchp->connectNeighbor(patchp, gDirOpposite[direction]); @@ -526,19 +565,19 @@ void LLSurface::connectNeighbor(LLSurface *neighborp, U32 direction) } // Now do northeast/southwest connections - for (i = 1; i < mPatchesPerEdge; i++) + for (i = 1; i < ppe[0]; i++) { - patchp = getPatch(i, 0); - neighbor_patchp = neighborp->getPatch(i - 1, mPatchesPerEdge - 1); + patchp = getPatch(i + own_offset[0], 0); + neighbor_patchp = neighborp->getPatch(i - 1 + neighbor_offset[0], neighborPatchesPerEdge - 1); patchp->connectNeighbor(neighbor_patchp, SOUTHWEST); neighbor_patchp->connectNeighbor(patchp, NORTHEAST); } // Now do northeast/southwest connections - for (i = 0; i < mPatchesPerEdge - 1; i++) + for (i = 0; i < ppe[0] - 1; i++) { - patchp = getPatch(i, 0); - neighbor_patchp = neighborp->getPatch(i + 1, mPatchesPerEdge - 1); + patchp = getPatch(i + own_offset[0], 0); + neighbor_patchp = neighborp->getPatch(i + 1 + neighbor_offset[0], neighborPatchesPerEdge - 1); patchp->connectNeighbor(neighbor_patchp, SOUTHEAST); neighbor_patchp->connectNeighbor(patchp, NORTHWEST); @@ -700,14 +739,22 @@ void LLSurface::decompressDCTPatch(LLBitPack &bitpack, LLGroupHeader *gopp, BOOL while (1) { - decode_patch_header(bitpack, &ph); + decode_patch_header(bitpack, &ph, b_large_patch); if (ph.quant_wbits == END_OF_PATCHES) { break; } - i = ph.patchids >> 5; - j = ph.patchids & 0x1F; + if (b_large_patch) + { + i = ph.patchids >> 16; + j = ph.patchids & 0xFFFF; + } + else + { + i = ph.patchids >> 5; + j = ph.patchids & 0x1F; + } if ((i >= mPatchesPerEdge) || (j >= mPatchesPerEdge)) { @@ -1229,7 +1276,7 @@ BOOL LLSurface::generateWaterTexture(const F32 x, const F32 y, LLPointer raw = new LLImageRaw(tex_width, tex_height, tex_comps); U8 *rawp = raw->getData(); - F32 scale = 256.f * getMetersPerGrid() / (F32)tex_width; + F32 scale = getRegion()->getWidth() * getMetersPerGrid() / (F32)tex_width; F32 scale_inv = 1.f / scale; S32 x_begin, y_begin, x_end, y_end; diff --git a/indra/newview/llsurfacepatch.cpp b/indra/newview/llsurfacepatch.cpp index 3ebea883c..b3a774610 100644 --- a/indra/newview/llsurfacepatch.cpp +++ b/indra/newview/llsurfacepatch.cpp @@ -249,18 +249,22 @@ void LLSurfacePatch::calcNormal(const U32 x, const U32 y, const U32 stride) const F32 mpg = mSurfacep->getMetersPerGrid() * stride; - S32 poffsets[2][2][2]; + S32 poffsets[2][2][3]; poffsets[0][0][0] = x - stride; poffsets[0][0][1] = y - stride; + poffsets[0][0][2] = surface_stride; poffsets[0][1][0] = x - stride; poffsets[0][1][1] = y + stride; + poffsets[0][1][2] = surface_stride; poffsets[1][0][0] = x + stride; poffsets[1][0][1] = y - stride; + poffsets[1][0][2] = surface_stride; poffsets[1][1][0] = x + stride; poffsets[1][1][1] = y + stride; + poffsets[1][1][2] = surface_stride; const LLSurfacePatch *ppatches[2][2]; @@ -286,6 +290,7 @@ void LLSurfacePatch::calcNormal(const U32 x, const U32 y, const U32 stride) { poffsets[i][j][0] += patch_width; ppatches[i][j] = ppatches[i][j]->getNeighborPatch(WEST); + poffsets[i][j][2] = ppatches[i][j]->getSurface()->getGridsPerEdge(); } } if (poffsets[i][j][1] < 0) @@ -298,6 +303,7 @@ void LLSurfacePatch::calcNormal(const U32 x, const U32 y, const U32 stride) { poffsets[i][j][1] += patch_width; ppatches[i][j] = ppatches[i][j]->getNeighborPatch(SOUTH); + poffsets[i][j][2] = ppatches[i][j]->getSurface()->getGridsPerEdge(); } } if (poffsets[i][j][0] >= (S32)patch_width) @@ -310,6 +316,7 @@ void LLSurfacePatch::calcNormal(const U32 x, const U32 y, const U32 stride) { poffsets[i][j][0] -= patch_width; ppatches[i][j] = ppatches[i][j]->getNeighborPatch(EAST); + poffsets[i][j][2] = ppatches[i][j]->getSurface()->getGridsPerEdge(); } } if (poffsets[i][j][1] >= (S32)patch_width) @@ -322,6 +329,7 @@ void LLSurfacePatch::calcNormal(const U32 x, const U32 y, const U32 stride) { poffsets[i][j][1] -= patch_width; ppatches[i][j] = ppatches[i][j]->getNeighborPatch(NORTH); + poffsets[i][j][2] = ppatches[i][j]->getSurface()->getGridsPerEdge(); } } } @@ -330,19 +338,19 @@ void LLSurfacePatch::calcNormal(const U32 x, const U32 y, const U32 stride) LLVector3 p00(-mpg,-mpg, *(ppatches[0][0]->mDataZ + poffsets[0][0][0] - + poffsets[0][0][1]*surface_stride)); + + poffsets[0][0][1]*poffsets[0][0][2])); LLVector3 p01(-mpg,+mpg, *(ppatches[0][1]->mDataZ + poffsets[0][1][0] - + poffsets[0][1][1]*surface_stride)); + + poffsets[0][1][1]*poffsets[0][1][2])); LLVector3 p10(+mpg,-mpg, *(ppatches[1][0]->mDataZ + poffsets[1][0][0] - + poffsets[1][0][1]*surface_stride)); + + poffsets[1][0][1]*poffsets[1][0][2])); LLVector3 p11(+mpg,+mpg, *(ppatches[1][1]->mDataZ + poffsets[1][1][0] - + poffsets[1][1][1]*surface_stride)); + + poffsets[1][1][1]*poffsets[1][1][2])); LLVector3 c1 = p11 - p00; LLVector3 c2 = p01 - p10; @@ -493,6 +501,9 @@ void LLSurfacePatch::updateNormals() // update the west edge if (mNormalsInvalid[NORTHWEST] || mNormalsInvalid[WEST] || mNormalsInvalid[SOUTHWEST]) { + if(!getNeighborPatch(NORTH) && getNeighborPatch(NORTHWEST) && getNeighborPatch(NORTHWEST)->getHasReceivedData()) + *(mDataZ + grids_per_patch_edge*grids_per_edge) = *(getNeighborPatch(NORTHWEST)->mDataZ + grids_per_patch_edge); + for (j = 0; j < grids_per_patch_edge; j++) { calcNormal(0, j, 2); @@ -504,6 +515,9 @@ void LLSurfacePatch::updateNormals() // update the south edge if (mNormalsInvalid[SOUTHWEST] || mNormalsInvalid[SOUTH] || mNormalsInvalid[SOUTHEAST]) { + if(!getNeighborPatch(EAST) && getNeighborPatch(SOUTHEAST) && getNeighborPatch(SOUTHEAST)->getHasReceivedData()) + *(mDataZ + grids_per_patch_edge) = *(getNeighborPatch(SOUTHEAST)->mDataZ + grids_per_patch_edge * getNeighborPatch(SOUTHEAST)->getSurface()->getGridsPerEdge()); + for (i = 0; i < grids_per_patch_edge; i++) { calcNormal(i, 0, 2); @@ -532,7 +546,7 @@ void LLSurfacePatch::updateNormals() { // East, but not north. Pull from your east neighbor's northwest point. *(mDataZ + grids_per_patch_edge + grids_per_patch_edge*grids_per_edge) = - *(getNeighborPatch(EAST)->mDataZ + (grids_per_patch_edge - 1)*grids_per_edge); + *(getNeighborPatch(EAST)->mDataZ + (getNeighborPatch(EAST)->getSurface()->getGridsPerPatchEdge() - 1)*getNeighborPatch(EAST)->getSurface()->getGridsPerEdge()); } else { @@ -557,7 +571,7 @@ void LLSurfacePatch::updateNormals() { // North, but not east. Pull from your north neighbor's southeast corner. *(mDataZ + grids_per_patch_edge + grids_per_patch_edge*grids_per_edge) = - *(getNeighborPatch(NORTH)->mDataZ + (grids_per_patch_edge - 1)); + *(getNeighborPatch(NORTH)->mDataZ + (getNeighborPatch(NORTH)->getSurface()->getGridsPerPatchEdge() - 1)); } else { @@ -574,8 +588,17 @@ void LLSurfacePatch::updateNormals() && (!getNeighborPatch(EAST) || (getNeighborPatch(EAST)->mSurfacep != mSurfacep))) { + U32 own_xpos, own_ypos, neighbor_xpos, neighbor_ypos; + S32 own_offset = 0, neighbor_offset = 0; + from_region_handle(mSurfacep->getRegion()->getHandle(), &own_xpos, &own_ypos); + from_region_handle(getNeighborPatch(NORTHEAST)->mSurfacep->getRegion()->getHandle(), &neighbor_xpos, &neighbor_ypos); + if(own_ypos >= neighbor_ypos) + neighbor_offset = own_ypos - neighbor_ypos; + else + own_offset = neighbor_ypos - own_ypos; + *(mDataZ + grids_per_patch_edge + grids_per_patch_edge*grids_per_edge) = - *(getNeighborPatch(NORTHEAST)->mDataZ); + *(getNeighborPatch(NORTHEAST)->mDataZ + (grids_per_edge + neighbor_offset - own_offset - 1) * getNeighborPatch(NORTHEAST)->getSurface()->getGridsPerEdge()); } } else @@ -618,8 +641,9 @@ void LLSurfacePatch::updateEastEdge() { U32 grids_per_patch_edge = mSurfacep->getGridsPerPatchEdge(); U32 grids_per_edge = mSurfacep->getGridsPerEdge(); + U32 grids_per_edge_east = grids_per_edge; - U32 j, k; + U32 j, k, h; F32 *west_surface, *east_surface; if (!getNeighborPatch(EAST)) @@ -631,6 +655,7 @@ void LLSurfacePatch::updateEastEdge() { west_surface = mDataZ + grids_per_patch_edge; east_surface = getNeighborPatch(EAST)->mDataZ; + grids_per_edge_east = getNeighborPatch(EAST)->getSurface()->getGridsPerEdge(); } else { @@ -642,7 +667,8 @@ void LLSurfacePatch::updateEastEdge() for (j=0; j < grids_per_patch_edge; j++) { k = j * grids_per_edge; - *(west_surface + k) = *(east_surface + k); // update buffer Z + h = j * grids_per_edge_east; + *(west_surface + k) = *(east_surface + h); // update buffer Z } } diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index c452c85ab..64e0d40f9 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -4113,8 +4113,9 @@ void process_teleport_finish(LLMessageSystem* msg, void**) msg->getU64Fast(_PREHASH_Info, _PREHASH_RegionHandle, region_handle); U32 teleport_flags; msg->getU32Fast(_PREHASH_Info, _PREHASH_TeleportFlags, teleport_flags); - - + + LLWorld::getInstance()->setRegionWidth(msg); + std::string seedCap; msg->getStringFast(_PREHASH_Info, _PREHASH_SeedCapability, seedCap); @@ -4435,6 +4436,8 @@ void process_crossed_region(LLMessageSystem* msg, void**) std::string seedCap; msg->getStringFast(_PREHASH_RegionData, _PREHASH_SeedCapability, seedCap); + LLWorld::getInstance()->setRegionWidth(msg); + send_complete_agent_movement(sim_host); LLViewerRegion* regionp = LLWorld::getInstance()->addRegion(region_handle, sim_host); diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp index f22a1a1af..0f36cf3bd 100644 --- a/indra/newview/llviewerobject.cpp +++ b/indra/newview/llviewerobject.cpp @@ -956,7 +956,7 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys, U16 valswizzle[4]; #endif U16 *val; - const F32 size = LLWorld::getInstance()->getRegionWidthInMeters(); + const F32 size = mRegionp->getWidth(); const F32 MAX_HEIGHT = LLWorld::getInstance()->getRegionMaxHeight(); const F32 MIN_HEIGHT = LLWorld::getInstance()->getRegionMinHeight(); S32 length; diff --git a/indra/newview/llviewerparcelmgr.cpp b/indra/newview/llviewerparcelmgr.cpp index 9c18486cc..94f15b48a 100644 --- a/indra/newview/llviewerparcelmgr.cpp +++ b/indra/newview/llviewerparcelmgr.cpp @@ -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 ); diff --git a/indra/newview/llviewerparcelmgr.h b/indra/newview/llviewerparcelmgr.h index 5ae44e2d0..749fbd50b 100644 --- a/indra/newview/llviewerparcelmgr.h +++ b/indra/newview/llviewerparcelmgr.h @@ -89,6 +89,7 @@ public: LLViewerParcelMgr(); ~LLViewerParcelMgr(); + void widthUpdate(F32 region_width); static void cleanupGlobals(); BOOL selectionEmpty() const; diff --git a/indra/newview/llviewerparceloverlay.cpp b/indra/newview/llviewerparceloverlay.cpp index 42bf3100c..05934efc3 100644 --- a/indra/newview/llviewerparceloverlay.cpp +++ b/indra/newview/llviewerparceloverlay.cpp @@ -59,6 +59,7 @@ 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), @@ -413,7 +414,8 @@ void LLViewerParcelOverlay::uncompressLandOverlay(S32 chunk, U8 *packed_overlay) { // Unpack the message data into the ownership array S32 size = mParcelGridsPerEdge * mParcelGridsPerEdge; - S32 chunk_size = size / PARCEL_OVERLAY_CHUNKS; + S32 mParcelOverLayChunks = mRegionSize * mRegionSize / (128 * 128); + S32 chunk_size = size / mParcelOverLayChunks; memcpy(mOwnership + chunk*chunk_size, packed_overlay, chunk_size); /*Flawfinder: ignore*/ diff --git a/indra/newview/llviewerparceloverlay.h b/indra/newview/llviewerparceloverlay.h index 794a485e6..d0ad9d344 100644 --- a/indra/newview/llviewerparceloverlay.h +++ b/indra/newview/llviewerparceloverlay.h @@ -109,6 +109,7 @@ private: LLViewerRegion* mRegion; S32 mParcelGridsPerEdge; + S32 mRegionSize; LLPointer mTexture; LLPointer mImageRaw; diff --git a/indra/newview/llviewerregion.cpp b/indra/newview/llviewerregion.cpp index 681cfd4fd..6af91a8fa 100644 --- a/indra/newview/llviewerregion.cpp +++ b/indra/newview/llviewerregion.cpp @@ -66,6 +66,7 @@ #include "lltrans.h" #include "llurldispatcher.h" #include "llviewerobjectlist.h" +#include "llviewerparcelmgr.h" #include "llviewerparceloverlay.h" #include "llviewerstatsrecorder.h" #include "llvlmanager.h" @@ -303,9 +304,9 @@ LLViewerRegion::LLViewerRegion(const U64 &handle, mCacheLoaded(FALSE), mCacheDirty(FALSE), mReleaseNotesRequested(FALSE), - mCapabilitiesReceived(false) + mCapabilitiesReceived(false), + mWidth(region_width_meters) { - mWidth = region_width_meters; mImpl->mOriginGlobal = from_region_handle(handle); updateRenderMatrix(); @@ -315,7 +316,7 @@ LLViewerRegion::LLViewerRegion(const U64 &handle, mImpl->mCompositionp = new LLVLComposition(mImpl->mLandp, grids_per_region_edge, - region_width_meters / grids_per_region_edge); + mWidth / grids_per_region_edge); mImpl->mCompositionp->setSurface(mImpl->mLandp); // Create the surfaces @@ -325,7 +326,8 @@ LLViewerRegion::LLViewerRegion(const U64 &handle, mImpl->mOriginGlobal, mWidth); - mParcelOverlay = new LLViewerParcelOverlay(this, region_width_meters); + mParcelOverlay = new LLViewerParcelOverlay(this, mWidth); + LLViewerParcelMgr::getInstance()->widthUpdate(mWidth); setOriginGlobal(from_region_handle(handle)); calculateCenterGlobal(); @@ -835,11 +837,11 @@ LLVLComposition * LLViewerRegion::getComposition() const F32 LLViewerRegion::getCompositionXY(const S32 x, const S32 y) const { - if (x >= 256) + if (x >= mWidth) { - if (y >= 256) + if (y >= mWidth) { - LLVector3d center = getCenterGlobal() + LLVector3d(256.f, 256.f, 0.f); + LLVector3d center = getCenterGlobal() + LLVector3d(mWidth, mWidth, 0.f); LLViewerRegion *regionp = LLWorld::getInstance()->getRegionFromPosGlobal(center); if (regionp) { @@ -848,8 +850,8 @@ F32 LLViewerRegion::getCompositionXY(const S32 x, const S32 y) const // If we're attempting to blend, then we want to make the fractional part of // this region match the fractional of the adjacent. For now, just minimize // the delta. - F32 our_comp = getComposition()->getValueScaled(255, 255); - F32 adj_comp = regionp->getComposition()->getValueScaled(x - 256.f, y - 256.f); + F32 our_comp = getComposition()->getValueScaled(mWidth-1.f, mWidth-1.f); + F32 adj_comp = regionp->getComposition()->getValueScaled(x - regionp->getWidth(), y - regionp->getWidth()); while (llabs(our_comp - adj_comp) >= 1.f) { if (our_comp > adj_comp) @@ -866,7 +868,7 @@ F32 LLViewerRegion::getCompositionXY(const S32 x, const S32 y) const } else { - LLVector3d center = getCenterGlobal() + LLVector3d(256.f, 0, 0.f); + LLVector3d center = getCenterGlobal() + LLVector3d(mWidth, 0.f, 0.f); LLViewerRegion *regionp = LLWorld::getInstance()->getRegionFromPosGlobal(center); if (regionp) { @@ -875,8 +877,8 @@ F32 LLViewerRegion::getCompositionXY(const S32 x, const S32 y) const // If we're attempting to blend, then we want to make the fractional part of // this region match the fractional of the adjacent. For now, just minimize // the delta. - F32 our_comp = getComposition()->getValueScaled(255.f, (F32)y); - F32 adj_comp = regionp->getComposition()->getValueScaled(x - 256.f, (F32)y); + F32 our_comp = getComposition()->getValueScaled(mWidth-1.f, (F32)y); + F32 adj_comp = regionp->getComposition()->getValueScaled(x - regionp->getWidth(), (F32)y); while (llabs(our_comp - adj_comp) >= 1.f) { if (our_comp > adj_comp) @@ -892,9 +894,9 @@ F32 LLViewerRegion::getCompositionXY(const S32 x, const S32 y) const } } } - else if (y >= 256) + else if (y >= mWidth) { - LLVector3d center = getCenterGlobal() + LLVector3d(0.f, 256.f, 0.f); + LLVector3d center = getCenterGlobal() + LLVector3d(0.f, mWidth, 0.f); LLViewerRegion *regionp = LLWorld::getInstance()->getRegionFromPosGlobal(center); if (regionp) { @@ -903,8 +905,8 @@ F32 LLViewerRegion::getCompositionXY(const S32 x, const S32 y) const // If we're attempting to blend, then we want to make the fractional part of // this region match the fractional of the adjacent. For now, just minimize // the delta. - F32 our_comp = getComposition()->getValueScaled((F32)x, 255.f); - F32 adj_comp = regionp->getComposition()->getValueScaled((F32)x, y - 256.f); + F32 our_comp = getComposition()->getValueScaled((F32)x, mWidth-1.f); + F32 adj_comp = regionp->getComposition()->getValueScaled((F32)x, y - regionp->getWidth()); while (llabs(our_comp - adj_comp) >= 1.f) { if (our_comp > adj_comp) diff --git a/indra/newview/llvowater.cpp b/indra/newview/llvowater.cpp index 049a89d1a..05bee323b 100644 --- a/indra/newview/llvowater.cpp +++ b/indra/newview/llvowater.cpp @@ -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(256.f, 256.f, 0.f)); // Hack for setting scale for bounding boxes/visibility. + setScale(LLVector3(mRegionp->getWidth(), mRegionp->getWidth(), 0.f)); // Hack for setting scale for bounding boxes/visibility. mUseTexture = TRUE; mIsEdgePatch = FALSE; diff --git a/indra/newview/llwind.cpp b/indra/newview/llwind.cpp index 2b0f0d969..8ae0f404b 100644 --- a/indra/newview/llwind.cpp +++ b/indra/newview/llwind.cpp @@ -50,7 +50,7 @@ #include "noise.h" #include "v4color.h" #include "llagent.h" -#include "llworld.h" +#include "llviewerregion.h" const F32 CLOUD_DIVERGENCE_COEF = 0.5f; @@ -254,7 +254,7 @@ LLVector3 LLWind::getVelocity(const LLVector3 &pos_region) LLVector3 pos_clamped_region(pos_region); - F32 region_width_meters = LLWorld::getInstance()->getRegionWidthInMeters(); + F32 region_width_meters = gAgent.getRegion()->getWidth(); if (pos_clamped_region.mV[VX] < 0.f) { @@ -321,7 +321,7 @@ LLVector3 LLWind::getCloudVelocity(const LLVector3 &pos_region) LLVector3 pos_clamped_region(pos_region); - F32 region_width_meters = LLWorld::getInstance()->getRegionWidthInMeters(); + F32 region_width_meters = gAgent.getRegion()->getWidth(); if (pos_clamped_region.mV[VX] < 0.f) { diff --git a/indra/newview/llworld.cpp b/indra/newview/llworld.cpp index ff0d1558a..86b9fde48 100644 --- a/indra/newview/llworld.cpp +++ b/indra/newview/llworld.cpp @@ -81,12 +81,12 @@ const S32 WORLD_PATCH_SIZE = 16; extern LLColor4U MAX_WATER_COLOR; -const U32 LLWorld::mWidth = 256; +U32 LLWorld::mWidth = 256; // meters/point, therefore mWidth * mScale = meters per edge const F32 LLWorld::mScale = 1.f; -const F32 LLWorld::mWidthInMeters = mWidth * mScale; +F32 LLWorld::mWidthInMeters = mWidth * mScale; // // Functions @@ -146,6 +146,18 @@ void LLWorld::destroyClass() } } +void LLWorld::setRegionWidth(LLMessageSystem* msg) +{ + U32 width; + msg->getU32Fast(_PREHASH_SimulatorInfo, _PREHASH_RegionSizeX, width); + setRegionWidth(width); +} + +void LLWorld::setRegionWidth(const U32 width) +{ + mWidth = width ? width : 256; // Width of 0 is really 256 + mWidthInMeters = mWidth * mScale; +} LLViewerRegion* LLWorld::addRegion(const U64 ®ion_handle, const LLHost &host) { @@ -181,8 +193,8 @@ LLViewerRegion* LLWorld::addRegion(const U64 ®ion_handle, const LLHost &host) U32 iindex = 0; U32 jindex = 0; from_region_handle(region_handle, &iindex, &jindex); - S32 x = (S32)(iindex/mWidth); - S32 y = (S32)(jindex/mWidth); + S32 x = (S32)(iindex/256); + S32 y = (S32)(jindex/256); llinfos << "Adding new region (" << x << ":" << y << ")" << llendl; llinfos << "Host: " << host << llendl; @@ -232,13 +244,40 @@ LLViewerRegion* LLWorld::addRegion(const U64 ®ion_handle, const LLHost &host) { adj_x = region_x + width * gDirAxes[dir][0]; adj_y = region_y + width * gDirAxes[dir][1]; - to_region_handle(adj_x, adj_y, &adj_handle); - neighborp = getRegionFromHandle(adj_handle); - if (neighborp) + if (mWidth == 256) { - //llinfos << "Connecting " << region_x << ":" << region_y << " -> " << adj_x << ":" << adj_y << llendl; - regionp->connectNeighbor(neighborp, dir); + to_region_handle(adj_x, adj_y, &adj_handle); + neighborp = getRegionFromHandle(adj_handle); + if (neighborp) + { + //llinfos << "Connecting " << region_x << ":" << region_y << " -> " << adj_x << ":" << adj_y << llendl; + regionp->connectNeighbor(neighborp, dir); + } + } + else // Unconventional region size + { + LLViewerRegion* last_neighborp = NULL; + if(gDirAxes[dir][0] < 0) adj_x = region_x - WORLD_PATCH_SIZE; + if(gDirAxes[dir][1] < 0) adj_y = region_y - WORLD_PATCH_SIZE; + + for (S32 offset = 0; offset < width; offset += WORLD_PATCH_SIZE) + { + to_region_handle(adj_x, adj_y, &adj_handle); + neighborp = getRegionFromHandle(adj_handle); + + if (neighborp && last_neighborp != neighborp) + { + regionp->connectNeighbor(neighborp, dir); + last_neighborp = neighborp; + } + + if (dir == NORTHEAST || dir == NORTHWEST || dir == SOUTHWEST || dir == SOUTHEAST) + break; + + if (dir == NORTH || dir == SOUTH) adj_x += WORLD_PATCH_SIZE; + if (dir == EAST || dir == WEST) adj_y += WORLD_PATCH_SIZE; + } } } @@ -409,11 +448,19 @@ LLVector3d LLWorld::clipToVisibleRegions(const LLVector3d &start_pos, const LLVe LLViewerRegion* LLWorld::getRegionFromHandle(const U64 &handle) { + U32 x, y; + from_region_handle(handle, &x, &y); + for (region_list_t::iterator iter = mRegionList.begin(); iter != mRegionList.end(); ++iter) { LLViewerRegion* regionp = *iter; - if (regionp->getHandle() == handle) + U32 checkRegionX, checkRegionY; + F32 checkRegionWidth = regionp->getWidth(); + from_region_handle(regionp->getHandle(), &checkRegionX, &checkRegionY); + + if (x >= checkRegionX && x < (checkRegionX + checkRegionWidth) && + y >= checkRegionY && y < (checkRegionY + checkRegionWidth)) { return regionp; } @@ -840,7 +887,7 @@ F32 LLWorld::getLandFarClip() const void LLWorld::setLandFarClip(const F32 far_clip) { - static S32 const rwidth = (S32)REGION_WIDTH_U32; + static S32 const rwidth = (S32)getRegionWidthInMeters(); S32 const n1 = (llceil(mLandFarClip) - 1) / rwidth; S32 const n2 = (llceil(far_clip) - 1) / rwidth; bool need_water_objects_update = n1 != n2; @@ -915,8 +962,10 @@ void LLWorld::updateWaterObjects() return; } + LLViewerRegion const* regionp = gAgent.getRegion(); + // Region width in meters. - S32 const rwidth = (S32)REGION_WIDTH_U32; + S32 const rwidth = (S32)regionp->getWidth(); // The distance we might see into the void // when standing on the edge of a region, in meters. @@ -933,15 +982,14 @@ void LLWorld::updateWaterObjects() S32 const range = nsims * rwidth; // Get South-West corner of current region. - LLViewerRegion const* regionp = gAgent.getRegion(); U32 region_x, region_y; from_region_handle(regionp->getHandle(), ®ion_x, ®ion_y); // The min. and max. coordinates of the South-West corners of the Hole water objects. S32 const min_x = (S32)region_x - range; S32 const min_y = (S32)region_y - range; - S32 const max_x = (S32)region_x + range; - S32 const max_y = (S32)region_y + range; + S32 const max_x = (S32)region_x + rwidth-256 + range; + S32 const max_y = (S32)region_y + rwidth-256 + range; // Attempt to determine a sensible water height for all the // Hole Water objects. @@ -1120,19 +1168,19 @@ void LLWorld::updateWaterObjects() // the current regions water height. F32 const box_height = 1024; F32 const water_center_z = water_height + box_height / 2; - + const S32 step = 256; // Create new Hole water objects within 'range' where there is no region. - for (S32 x = min_x; x <= max_x; x += rwidth) + for (S32 x = min_x; x <= max_x; x += step) { - for (S32 y = min_y; y <= max_y; y += rwidth) + for (S32 y = min_y; y <= max_y; y += step) { U64 region_handle = to_region_handle(x, y); if (!getRegionFromHandle(region_handle)) { LLVOWater* waterp = (LLVOWater*)gObjectList.createObjectViewer(LLViewerObject::LL_VO_VOID_WATER, gAgent.getRegion()); waterp->setUseTexture(FALSE); - waterp->setPositionGlobal(LLVector3d(x + rwidth / 2, y + rwidth / 2, water_center_z)); - waterp->setScale(LLVector3((F32)rwidth, (F32)rwidth, box_height)); + waterp->setPositionGlobal(LLVector3d(x + step / 2, y + step / 2, water_center_z)); + waterp->setScale(LLVector3((F32)step, (F32)step, box_height)); gPipeline.createObject(waterp); mHoleWaterObjects.push_back(waterp); } @@ -1140,10 +1188,10 @@ void LLWorld::updateWaterObjects() } // Center of the region. - S32 const center_x = region_x + rwidth / 2; - S32 const center_y = region_y + rwidth / 2; + S32 const center_x = region_x + step / 2; + S32 const center_y = region_y + step / 2; // Width of the area with Hole water objects. - S32 const width = rwidth + 2 * range; + S32 const width = step + 2 * range; S32 const horizon_extend = 2048 + 512 - range; // Legacy value. // The overlap is needed to get rid of sky pixels being visible between the // Edge and Hole water object at greater distances (due to floating point @@ -1272,6 +1320,8 @@ void process_enable_simulator(LLMessageSystem *msg, void **user_data) // which simulator should we modify? LLHost sim(ip_u32, port); + LLWorld::getInstance()->setRegionWidth(msg); + // Viewer trusts the simulator. msg->enableCircuit(sim, TRUE); LLWorld::getInstance()->addRegion(handle, sim); diff --git a/indra/newview/llworld.h b/indra/newview/llworld.h index a9b3f3b53..66819c5d9 100644 --- a/indra/newview/llworld.h +++ b/indra/newview/llworld.h @@ -113,6 +113,10 @@ public: LLSurfacePatch * resolveLandPatchGlobal(const LLVector3d &position); LLVector3 resolveLandNormalGlobal(const LLVector3d &position); // absolute frame + // update region size + void setRegionWidth(LLMessageSystem* msg); + void setRegionWidth(const U32 width = 0); + U32 getRegionWidthInPoints() const { return mWidth; } F32 getRegionScale() const { return mScale; } @@ -177,12 +181,12 @@ private: region_list_t mCulledRegionList; // Number of points on edge - static const U32 mWidth; + static U32 mWidth; // meters/point, therefore mWidth * mScale = meters per edge static const F32 mScale; - static const F32 mWidthInMeters; + static F32 mWidthInMeters; F32 mLandFarClip; // Far clip distance for land. LLPatchVertexArray mLandPatch; diff --git a/indra/newview/llworldmap.cpp b/indra/newview/llworldmap.cpp index 3f2d7b5ca..e4b3c722e 100644 --- a/indra/newview/llworldmap.cpp +++ b/indra/newview/llworldmap.cpp @@ -375,10 +375,25 @@ LLSimInfo* LLWorldMap::simInfoFromPosGlobal(const LLVector3d& pos_global) LLSimInfo* LLWorldMap::simInfoFromHandle(const U64 handle) { - sim_info_map_t::iterator it = mSimInfoMap.find(handle); - if (it != mSimInfoMap.end()) + std::map::const_iterator it; + for (it = mSimInfoMap.begin(); it != mSimInfoMap.end(); ++it) { - return it->second; + const U64 hndl = (*it).first; + LLSimInfo* info = (*it).second; + if (hndl == handle) + { + return info; + } + U32 x = 0, y = 0; + from_region_handle(handle, &x, &y); + U32 checkRegionX, checkRegionY; + from_region_handle(hndl, &checkRegionX, &checkRegionY); + + if (x >= checkRegionX && x < (checkRegionX + info->getSizeX()) && + y >= checkRegionY && y < (checkRegionY + info->getSizeY())) + { + return info; + } } return NULL; } From fa8e1f033bde94b48156c4606db3751604e4de4f Mon Sep 17 00:00:00 2001 From: Lirusaito Date: Sun, 20 Jan 2013 22:35:21 -0500 Subject: [PATCH 002/302] AuroraSim: non-power-of-two support. --- indra/llrender/llimagegl.cpp | 2 +- indra/newview/llpatchvertexarray.cpp | 24 +++++++----------------- 2 files changed, 8 insertions(+), 18 deletions(-) diff --git a/indra/llrender/llimagegl.cpp b/indra/llrender/llimagegl.cpp index bd5d4a58e..e7746ffaa 100644 --- a/indra/llrender/llimagegl.cpp +++ b/indra/llrender/llimagegl.cpp @@ -566,7 +566,7 @@ void LLImageGL::setSize(S32 width, S32 height, S32 ncomponents, S32 discard_leve // Check if dimensions are a power of two! if (!checkSize(width,height)) { - llerrs << llformat("Texture has non power of two dimension: %dx%d",width,height) << llendl; + llwarns << llformat("Texture has non power of two dimension: %dx%d",width,height) << " Unless on Aurora-Sim, beware." << llendl; } if (mTexName) diff --git a/indra/newview/llpatchvertexarray.cpp b/indra/newview/llpatchvertexarray.cpp index 4eab93167..2fe72ad04 100644 --- a/indra/newview/llpatchvertexarray.cpp +++ b/indra/newview/llpatchvertexarray.cpp @@ -82,7 +82,8 @@ void LLPatchVertexArray::create(U32 surface_width, U32 patch_width, F32 meters_p surface_order += 1; } - if (power_of_two == (surface_width-1)) + if (power_of_two != (surface_width-1)) + surface_width = power_of_two + 1; { mSurfaceWidth = surface_width; @@ -99,16 +100,11 @@ void LLPatchVertexArray::create(U32 surface_width, U32 patch_width, F32 meters_p power_of_two *= 2; patch_order += 1; } - if (power_of_two == patch_width) - { - mPatchWidth = patch_width; - mPatchOrder = patch_order; - } - else // patch_width is not a power of two... - { - mPatchWidth = 0; - mPatchOrder = 0; - } + if (power_of_two != patch_width) + patch_width = power_of_two; + + mPatchWidth = patch_width; + mPatchOrder = patch_order; } else // patch_width is not a factor of (surface_width - 1)... { @@ -116,12 +112,6 @@ void LLPatchVertexArray::create(U32 surface_width, U32 patch_width, F32 meters_p mPatchOrder = 0; } } - else // surface_width is not a power of two... - { - mSurfaceWidth = 0; - mPatchWidth = 0; - mPatchOrder = 0; - } // PART 2 -- Allocate memory for the render level table if (mPatchWidth > 0) From 36e6946c9610d330525a2f2afd46d29bd126389a Mon Sep 17 00:00:00 2001 From: Lirusaito Date: Sun, 20 Jan 2013 23:22:53 -0500 Subject: [PATCH 003/302] AuroraSim: More tiny bits to help life be normal on the grid. --- indra/llcharacter/llkeyframewalkmotion.cpp | 2 +- indra/newview/llfloaterworldmap.cpp | 6 ++++-- indra/newview/llnetmap.cpp | 1 + indra/newview/llpanelobject.cpp | 5 +++-- indra/newview/llworldmap.cpp | 10 ++++++++-- indra/newview/llworldmap.h | 1 + 6 files changed, 18 insertions(+), 7 deletions(-) diff --git a/indra/llcharacter/llkeyframewalkmotion.cpp b/indra/llcharacter/llkeyframewalkmotion.cpp index 9983be4f5..8de793229 100644 --- a/indra/llcharacter/llkeyframewalkmotion.cpp +++ b/indra/llcharacter/llkeyframewalkmotion.cpp @@ -287,7 +287,7 @@ BOOL LLWalkAdjustMotion::onUpdate(F32 time, U8* joint_mask) avatar_movement_dir.normalize(); // planted foot speed is avatar velocity - foot slip amount along avatar movement direction - F32 foot_speed = speed - ((foot_slip_vector * avatar_movement_dir) / delta_time); + F32 foot_speed = llmax(0.f, speed - ((foot_slip_vector * avatar_movement_dir) / delta_time)); // multiply animation playback rate so that foot speed matches avatar speed F32 min_speed_multiplier = clamp_rescale(speed, 0.f, 1.f, 0.f, 0.1f); diff --git a/indra/newview/llfloaterworldmap.cpp b/indra/newview/llfloaterworldmap.cpp index 0cd3906fb..d1c7b39d8 100644 --- a/indra/newview/llfloaterworldmap.cpp +++ b/indra/newview/llfloaterworldmap.cpp @@ -645,8 +645,10 @@ void LLFloaterWorldMap::trackLocation(const LLVector3d& pos_global) } std::string sim_name = sim_info->getName(); - F32 region_x = (F32)fmod( pos_global.mdV[VX], (F64)REGION_WIDTH_METERS ); - F32 region_y = (F32)fmod( pos_global.mdV[VY], (F64)REGION_WIDTH_METERS ); + U32 locX, locY; + from_region_handle(sim_info->getHandle(), &locX, &locY); + F32 region_x = pos_global.mdV[VX] - locX; + F32 region_y = pos_global.mdV[VY] - locY; std::string full_name = llformat("%s (%d, %d, %d)", // sim_name.c_str(), // [RLVa:KB] - Alternate: Snowglobe-1.2.4 | Checked: 2009-07-04 (RLVa-1.0.0a) diff --git a/indra/newview/llnetmap.cpp b/indra/newview/llnetmap.cpp index be47072d5..12fb45e9a 100644 --- a/indra/newview/llnetmap.cpp +++ b/indra/newview/llnetmap.cpp @@ -539,6 +539,7 @@ LLVector3 LLNetMap::globalPosToView(const LLVector3d& global_pos, BOOL rotated) LLVector3 pos_local; pos_local.setVec(relative_pos_global); // convert to floats from doubles + mPixelsPerMeter = mScale / REGION_WIDTH_METERS; pos_local.mV[VX] *= mPixelsPerMeter; pos_local.mV[VY] *= mPixelsPerMeter; // leave Z component in meters diff --git a/indra/newview/llpanelobject.cpp b/indra/newview/llpanelobject.cpp index eb690720e..52ad8fced 100644 --- a/indra/newview/llpanelobject.cpp +++ b/indra/newview/llpanelobject.cpp @@ -2656,8 +2656,9 @@ void LLPanelObject::onPastePosClip(void* user_data) std::string stringVec = wstring_to_utf8str(temp_string); if(!getvectorfromclip(stringVec, &mClipboardPos)) return; - mClipboardPos.mV[VX] = llclamp(mClipboardPos.mV[VX], -3.5f, 256.f); - mClipboardPos.mV[VY] = llclamp(mClipboardPos.mV[VY], -3.5f, 256.f); + float region_width = gAgent.getRegion()->getWidth(); + mClipboardPos.mV[VX] = llclamp(mClipboardPos.mV[VX], -3.5f, region_width); + mClipboardPos.mV[VY] = llclamp(mClipboardPos.mV[VY], -3.5f, region_width); mClipboardPos.mV[VZ] = llclamp(mClipboardPos.mV[VZ], -3.5f, 4096.f); self->mCtrlPosX->set( mClipboardPos.mV[VX] ); diff --git a/indra/newview/llworldmap.cpp b/indra/newview/llworldmap.cpp index e4b3c722e..094ccb1b0 100644 --- a/indra/newview/llworldmap.cpp +++ b/indra/newview/llworldmap.cpp @@ -43,6 +43,7 @@ #include "llmapresponders.h" #include "llviewercontrol.h" #include "llfloaterworldmap.h" +#include "lltexturecache.h" #include "lltracker.h" #include "llviewertexturelist.h" #include "llviewerregion.h" @@ -91,12 +92,17 @@ LLSimInfo::LLSimInfo(U64 handle) void LLSimInfo::setLandForSaleImage (LLUUID image_id) { + const bool is_aurora = gHippoGridManager->getConnectedGrid()->isAurora(); + if (is_aurora && mMapImageID[SIM_LAYER_OVERLAY].isNull() && image_id.notNull() && gTextureList.findImage(image_id)) + LLAppViewer::getTextureCache()->removeFromCache(image_id); + mMapImageID[SIM_LAYER_OVERLAY] = image_id; // Fetch the image if (mMapImageID[SIM_LAYER_OVERLAY].notNull()) { mLayerImage[SIM_LAYER_OVERLAY] = LLViewerTextureManager::getFetchedTexture(mMapImageID[SIM_LAYER_OVERLAY], MIPMAP_TRUE, LLViewerTexture::BOOST_MAP, LLViewerTexture::LOD_TEXTURE); + if (is_aurora) mLayerImage[SIM_LAYER_OVERLAY]->forceImmediateUpdate(); mLayerImage[SIM_LAYER_OVERLAY]->setAddressMode(LLTexUnit::TAM_CLAMP); } else @@ -526,8 +532,8 @@ void LLWorldMap::processMapLayerReply(LLMessageSystem* msg, void**) bool LLWorldMap::useWebMapTiles() { static const LLCachedControl use_web_map_tiles("UseWebMapTiles",false); - return use_web_map_tiles && - (( gHippoGridManager->getConnectedGrid()->isSecondLife() || sGotMapURL)); + return use_web_map_tiles && !gHippoGridManager->getConnectedGrid()->isAurora() && + ((gHippoGridManager->getConnectedGrid()->isSecondLife() || sGotMapURL)); } void LLWorldMap::reloadItems(bool force) diff --git a/indra/newview/llworldmap.h b/indra/newview/llworldmap.h index c34dc0f21..5e1757906 100644 --- a/indra/newview/llworldmap.h +++ b/indra/newview/llworldmap.h @@ -151,6 +151,7 @@ public: void setMapImageID (const LLUUID& id, const U8 &layer) { mMapImageID[layer] = id; } // Accessors + U64 getHandle() const { return mHandle; } std::string getName() const { return mName; } const std::string getFlagsString() const { return LLViewerRegion::regionFlagsToString(mRegionFlags); } const U32 getRegionFlags() const { return mRegionFlags; } From f7e45332bd99fe22c475c8105f8651866c38a311 Mon Sep 17 00:00:00 2001 From: aragornarda Date: Sat, 25 May 2013 18:26:42 +0300 Subject: [PATCH 004/302] small typo fix --- README | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README b/README index a441bfedf..8d470c1c9 100644 --- a/README +++ b/README @@ -15,8 +15,8 @@ Singularity Viewer is a SecondLife(tm) protocol compatible client application. It can be used to access SecondLife services as well as a number of others such as those based upon the OpenSim platform. -Singulariy is maintained by a small group of volunteers who can be contacted -both, in-world (SingularityViewer group) as well on IRC (#SingularityViewer +Singularity is maintained by a small group of volunteers who can be contacted +both, in-world (SingularityViewer group) as well as on IRC (#SingularityViewer @ FreeNode). Bug requests and features requests can be submitted through our Issue Tracker (http://code.google.com/p/singularity-viewer/issues/list or from the viewer menu: Help --> Bug Reporting --> Singularity Issue Tracker...) From 811935b43ce2befe155e42b3f423634446d85405 Mon Sep 17 00:00:00 2001 From: Damian Zhaoying Date: Thu, 1 Aug 2013 15:00:00 -0300 Subject: [PATCH 005/302] update spanish translations for menu avi list --- .../xui/es/floater_instant_message.xml | 10 +++++--- ...floater_instant_message_concisebuttons.xml | 12 ++++++--- .../skins/default/xui/es/menu_avs_list.xml | 18 +++++++++++++ .../skins/default/xui/es/menu_inventory.xml | 1 + .../skins/default/xui/es/menu_radar.xml | 2 ++ .../skins/default/xui/es/notifications.xml | 25 +++++++++++++++++++ .../xui/es/panel_preferences_ascent_chat.xml | 1 + 7 files changed, 62 insertions(+), 7 deletions(-) create mode 100644 indra/newview/skins/default/xui/es/menu_avs_list.xml diff --git a/indra/newview/skins/default/xui/es/floater_instant_message.xml b/indra/newview/skins/default/xui/es/floater_instant_message.xml index 3b343be29..a625a4086 100644 --- a/indra/newview/skins/default/xui/es/floater_instant_message.xml +++ b/indra/newview/skins/default/xui/es/floater_instant_message.xml @@ -33,9 +33,13 @@ Ofrecido un Item de Inventario - - - - - - - - + - - - - - - + + - - - - - - - - - + + + - - - - - - - - - - - - - - - - - - + + + + + + Lineal: Welt @@ -77,9 +53,7 @@ - + + + + + + + + + - - + - - + - - - - - - + + + + + - + - - - + + + + + + + + + + + - - - - - + + + + - - - - @@ -61,21 +61,21 @@ - + + + Object Info + Name: [NAME] + Exportable Prims: [COUNT]/[TOTAL] + Exportable Textures: [COUNT]/[TOTAL] + + + Options + + + + + TGA + PNG + J2C + BMP + JPG + + + + + + + + From b4697bf732e89615449346a4333854393dfc509d Mon Sep 17 00:00:00 2001 From: Latif Khalifa Date: Sun, 15 Sep 2013 09:26:49 +0200 Subject: [PATCH 140/302] Made texture export on by default when exporting Collada. --- indra/newview/app_settings/settings.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 10b57fd99..7e7bb4796 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -17560,7 +17560,7 @@ This should be as low as possible, but too low may break functionality Type Boolean Value - 0 + 1 DAEExportTextureParams From a5aedfb78314466e28315965e32b20739d8adb8b Mon Sep 17 00:00:00 2001 From: Latif Khalifa Date: Sun, 15 Sep 2013 10:29:52 +0200 Subject: [PATCH 141/302] Typo fix --- indra/plugins/filepicker/llfilepicker.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/plugins/filepicker/llfilepicker.cpp b/indra/plugins/filepicker/llfilepicker.cpp index 3650fb0cf..ab30d2a0b 100644 --- a/indra/plugins/filepicker/llfilepicker.cpp +++ b/indra/plugins/filepicker/llfilepicker.cpp @@ -1435,7 +1435,7 @@ static std::string add_imageload_filter_to_gtkchooser(GtkWindow *picker) return filtername; } -static std::string add_imagesave_filter_to_gtkchooser(GTKWindow *picker) +static std::string add_imagesave_filter_to_gtkchooser(GtkWindow *picker) { GtkFileFilter *gfilter = gtk_file_filter_new(); gtk_file_filter_add_mime_type(gfilter, "image/bmp"); From a2b2af6eb729554aa432cf01b386f9d904fc9095 Mon Sep 17 00:00:00 2001 From: Latif Khalifa Date: Sun, 15 Sep 2013 10:40:16 +0200 Subject: [PATCH 142/302] Don't pass std::string to llformat --- indra/newview/daeexport.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/indra/newview/daeexport.cpp b/indra/newview/daeexport.cpp index 5893f751a..6beff624b 100644 --- a/indra/newview/daeexport.cpp +++ b/indra/newview/daeexport.cpp @@ -766,8 +766,8 @@ bool DAESaver::saveDAE(std::string filename) // File creator daeElement* contributor = asset->add("contributor"); - contributor->add("author")->setCharData(llformat("%s User", LLAppViewer::instance()->getSecondLifeTitle())); - contributor->add("authoring_tool")->setCharData(llformat("%s Collada Export", LLAppViewer::instance()->getSecondLifeTitle())); + contributor->add("author")->setCharData(LLAppViewer::instance()->getSecondLifeTitle() + " User"); + contributor->add("authoring_tool")->setCharData(LLAppViewer::instance()->getSecondLifeTitle() + " Collada Export"); daeElement* images = root->add("library_images"); daeElement* geomLib = root->add("library_geometries"); @@ -1041,13 +1041,13 @@ void DAESaver::generateEffects(daeElement *effects) { colladaName = mTextureNames[i] + "_" + mImageFormat; daeElement* newparam = profile->add("newparam"); - newparam->setAttribute("sid", llformat("%s-surface", colladaName).c_str()); + newparam->setAttribute("sid", (colladaName + "-surface").c_str()); daeElement* surface = newparam->add("surface"); surface->setAttribute("type", "2D"); surface->add("init_from")->setCharData(colladaName.c_str()); newparam = profile->add("newparam"); - newparam->setAttribute("sid", llformat("%s-sampler", colladaName).c_str()); - newparam->add("sampler2D source")->setCharData(llformat("%s-surface", colladaName).c_str()); + newparam->setAttribute("sid", (colladaName + "-sampler").c_str()); + newparam->add("sampler2D source")->setCharData((colladaName + "-surface").c_str()); } } @@ -1059,7 +1059,7 @@ void DAESaver::generateEffects(daeElement *effects) if (!colladaName.empty()) { daeElement* txtr = diffuse->add("texture"); - txtr->setAttribute("texture", llformat("%s-sampler", colladaName).c_str()); + txtr->setAttribute("texture", (colladaName + "-sampler").c_str()); txtr->setAttribute("texcoord", colladaName.c_str()); } else From cb6dec62ec5e9a2bd09750b425b34871093e7c2a Mon Sep 17 00:00:00 2001 From: Inusaito Sayori Date: Sun, 15 Sep 2013 18:01:21 -0400 Subject: [PATCH 143/302] Appease VS2010 warning and make ui code more consistent with the modern standard in daeexport.cpp --- indra/newview/daeexport.cpp | 64 +++++++++---------- .../default/xui/en-us/floater_dae_export.xml | 4 +- 2 files changed, 31 insertions(+), 37 deletions(-) diff --git a/indra/newview/daeexport.cpp b/indra/newview/daeexport.cpp index 6beff624b..1e71bf61b 100644 --- a/indra/newview/daeexport.cpp +++ b/indra/newview/daeexport.cpp @@ -74,7 +74,6 @@ // menu includes #include "llevent.h" #include "llmemberlistener.h" -#include "llview.h" #include "llselectmgr.h" // Floater and UI @@ -82,8 +81,6 @@ #include "lluictrlfactory.h" #include "llscrollcontainer.h" #include "lltexturectrl.h" -#include "llcombobox.h" -#include "llcheckboxctrl.h" // Files and cache #include "llcallbacklist.h" @@ -188,16 +185,13 @@ class ColladaExportFloater { private: typedef std::map texture_list_t; - LLButton* mExportBtn; - LLButton* mBrowseBtn; - LLLineEditor* mFileName; - LLComboBox* mTextureTypeCombo; - LLCheckBoxCtrl* mTextureExportCheck; + LLView* mExportBtn; + LLView* mFileName; + LLView* mTextureTypeCombo; DAESaver mSaver; texture_list_t mTexturesToSave; S32 mTotal; - S32 mIncluded; S32 mNumTextures; S32 mNumExportableTextures; std::string mObjectName; @@ -210,16 +204,25 @@ public: { mCommitCallbackRegistrar.add("ColladaExport.FilePicker", boost::bind(&ColladaExportFloater::onClickBrowse, this)); mCommitCallbackRegistrar.add("ColladaExport.Export", boost::bind(&ColladaExportFloater::onClickExport, this)); - mCommitCallbackRegistrar.add("ColladaExport.TextureTypeCombo", boost::bind(&ColladaExportFloater::onTextureTypeCombo, this)); - mCommitCallbackRegistrar.add("ColladaExport.TextureExport", boost::bind(&ColladaExportFloater::onTextureExportCheck, this)); + mCommitCallbackRegistrar.add("ColladaExport.TextureTypeCombo", boost::bind(&ColladaExportFloater::onTextureTypeCombo, this, boost::bind(&LLUICtrl::getControlName, _1), _2)); + mCommitCallbackRegistrar.add("ColladaExport.TextureExport", boost::bind(&ColladaExportFloater::onTextureExportCheck, this, _2)); LLUICtrlFactory::getInstance()->buildFloater(this, "floater_dae_export.xml"); addSelectedObjects(); - childSetTextArg("Object Name", "[NAME]", mObjectName); - childSetTextArg("Exportable Prims", "[COUNT]", llformat("%d", mIncluded)); - childSetTextArg("Exportable Prims", "[TOTAL]", llformat("%d", mTotal)); - childSetTextArg("Exportable Textures", "[COUNT]", llformat("%d", mNumExportableTextures)); - childSetTextArg("Exportable Textures", "[TOTAL]", llformat("%d", mNumTextures)); + if (LLUICtrl* ctrl = findChild("Object Name")) + { + ctrl->setTextArg("[NAME]", mObjectName); + } + if (LLUICtrl* ctrl = findChild("Exportable Prims")) + { + ctrl->setTextArg("[COUNT]", llformat("%d", mSaver.mObjects.size())); + ctrl->setTextArg("[TOTAL]", llformat("%d", mTotal)); + } + if (LLUICtrl* ctrl = findChild("Exportable Textures")) + { + ctrl->setTextArg("[COUNT]", llformat("%d", mNumExportableTextures)); + ctrl->setTextArg("[TOTAL]", llformat("%d", mNumTextures)); + } addTexturePreview(); } @@ -233,17 +236,13 @@ public: BOOL postBuild() { - mFileName = getChild("file name editor"); - mExportBtn = getChild("export button"); - mBrowseBtn = getChild("browse button"); - mTextureTypeCombo = getChild("texture type combo"); - mTextureExportCheck = getChild("texture export check"); + mFileName = getChildView("file name editor"); + mExportBtn = getChildView("export button"); + mTextureTypeCombo = getChildView("texture type combo"); mTitleProgress = getString("texture_progress"); - mExportBtn->setEnabled(FALSE); - mFileName->setEnabled(FALSE); mTextureTypeCombo->setValue(gSavedSettings.getS32(mTextureTypeCombo->getControlName())); - onTextureExportCheck(); + onTextureExportCheck(getChildView("texture export check")->getValue()); return TRUE; } @@ -253,14 +252,14 @@ public: setTitle(mTitleProgress); } - void onTextureExportCheck() + void onTextureExportCheck(const LLSD& value) { - mTextureTypeCombo->setEnabled(mTextureExportCheck->get()); + mTextureTypeCombo->setEnabled(value); } - void onTextureTypeCombo() + void onTextureTypeCombo(const std::string& control_name, const LLSD& value) { - gSavedSettings.setS32(mTextureTypeCombo->getControlName(), mTextureTypeCombo->getValue()); + gSavedSettings.setS32(control_name, value); } void onClickBrowse() @@ -276,10 +275,7 @@ public: if (filepicker->hasFilename()) { mFileName->setValue(filepicker->getFilename()); - if (mIncluded > 0) - { - mExportBtn->setEnabled(TRUE); - } + mExportBtn->setEnabled(TRUE); } } @@ -310,14 +306,12 @@ public: mSaver.mOffset = -selection->getFirstRootObject()->getRenderPosition(); mObjectName = selection->getFirstRootNode()->mName; mTotal = 0; - mIncluded = 0; for (LLObjectSelection::iterator iter = selection->begin(); iter != selection->end(); ++iter) { mTotal++; LLSelectNode* node = *iter; if (!node->getObject()->getVolume() || !DAEExportUtil::canExportNode(node)) continue; - mIncluded++; mSaver.add(node->getObject(), node->mName); } @@ -814,7 +808,7 @@ bool DAESaver::saveDAE(std::string filename) v4adapt verts(face->mPositions); v4adapt norms(face->mNormals); - LLVector2* newCoord; + LLVector2* newCoord = NULL; if (applyTexCoord) { diff --git a/indra/newview/skins/default/xui/en-us/floater_dae_export.xml b/indra/newview/skins/default/xui/en-us/floater_dae_export.xml index 51f8fd80c..8d01c4ee0 100644 --- a/indra/newview/skins/default/xui/en-us/floater_dae_export.xml +++ b/indra/newview/skins/default/xui/en-us/floater_dae_export.xml @@ -2,11 +2,11 @@ Collada Export: Saving textures ([COUNT] remaining) File Name: - + - From f73caef7a5c2ffa6761e85ffe8df0477729357f1 Mon Sep 17 00:00:00 2001 From: Inusaito Sayori Date: Mon, 16 Sep 2013 14:31:58 -0400 Subject: [PATCH 144/302] Fix log timestamp inconsistency when including seconds --- indra/newview/lllogchat.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/lllogchat.cpp b/indra/newview/lllogchat.cpp index ba734f7bd..300fe4bdd 100644 --- a/indra/newview/lllogchat.cpp +++ b/indra/newview/lllogchat.cpp @@ -92,7 +92,7 @@ std::string LLLogChat::timestamp(bool withdate) std::string text; if (withdate) if (withseconds) - text = llformat("[%d-%02d-%02d %02d:%02d:%02d] ", (timep->tm_year-100)+2000, timep->tm_mon+1, timep->tm_mday, timep->tm_hour, timep->tm_min, timep->tm_sec); + text = llformat("[%d/%02d/%02d %02d:%02d:%02d] ", (timep->tm_year-100)+2000, timep->tm_mon+1, timep->tm_mday, timep->tm_hour, timep->tm_min, timep->tm_sec); else text = llformat("[%d/%02d/%02d %02d:%02d] ", (timep->tm_year-100)+2000, timep->tm_mon+1, timep->tm_mday, timep->tm_hour, timep->tm_min); else From 97c8218463fa77dec206d79100c6b90dc8dbfefe Mon Sep 17 00:00:00 2001 From: Latif Khalifa Date: Tue, 17 Sep 2013 01:48:11 +0200 Subject: [PATCH 145/302] Don't crash when chanelp returned is null --- indra/llaudio/llaudioengine.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/llaudio/llaudioengine.cpp b/indra/llaudio/llaudioengine.cpp index f07965877..aab511ef8 100644 --- a/indra/llaudio/llaudioengine.cpp +++ b/indra/llaudio/llaudioengine.cpp @@ -399,7 +399,7 @@ void LLAudioEngine::idle(F32 max_decode_time) } LLAudioChannel *channelp = sourcep->getChannel(); - bool is_stopped = channelp && channelp->isPlaying(); + bool is_stopped = !channelp || !channelp->isPlaying(); if (is_stopped || (sourcep->isLoop() && channelp->mLoopedThisFrame)) { // This sound isn't playing, so we just process move the queue From afec67e59679ec4bf8193b498160819c705aed0a Mon Sep 17 00:00:00 2001 From: Latif Khalifa Date: Tue, 17 Sep 2013 01:48:39 +0200 Subject: [PATCH 146/302] Kill a compiler warning --- indra/newview/daeexport.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/daeexport.cpp b/indra/newview/daeexport.cpp index 6beff624b..0938bd1cb 100644 --- a/indra/newview/daeexport.cpp +++ b/indra/newview/daeexport.cpp @@ -814,7 +814,7 @@ bool DAESaver::saveDAE(std::string filename) v4adapt verts(face->mPositions); v4adapt norms(face->mNormals); - LLVector2* newCoord; + LLVector2* newCoord = NULL; if (applyTexCoord) { From 69a6968775ed5c3f6b1d944906b456d8c6bc937b Mon Sep 17 00:00:00 2001 From: Inusaito Sayori Date: Mon, 16 Sep 2013 22:36:48 -0400 Subject: [PATCH 147/302] Request: Add menu item separator between replace and remove. --- indra/newview/llinventorybridge.cpp | 1 + indra/newview/skins/default/xui/en-us/menu_inventory.xml | 1 + 2 files changed, 2 insertions(+) diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index f8e9390da..3dd268d60 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -3440,6 +3440,7 @@ void LLFolderBridge::buildContextMenuFolderOptions(U32 flags) mItems.push_back(std::string("Replace Outfit")); } + mItems.push_back(std::string("Replace Remove Separator")); mItems.push_back(std::string("Remove From Outfit")); if (!LLAppearanceMgr::getCanRemoveFromCOF(mUUID)) { diff --git a/indra/newview/skins/default/xui/en-us/menu_inventory.xml b/indra/newview/skins/default/xui/en-us/menu_inventory.xml index 12ebca6f0..a248c26de 100644 --- a/indra/newview/skins/default/xui/en-us/menu_inventory.xml +++ b/indra/newview/skins/default/xui/en-us/menu_inventory.xml @@ -243,6 +243,7 @@ mouse_opaque="true" name="Replace Outfit" width="128"> + From 9b33e592fac9b5af4864f9206b71004cc6f19adc Mon Sep 17 00:00:00 2001 From: Inusaito Sayori Date: Mon, 16 Sep 2013 22:44:31 -0400 Subject: [PATCH 148/302] Fix log being read from the top, woops --- indra/newview/lllogchat.cpp | 52 ++++++++++++++++++++++++++++++++++--- 1 file changed, 49 insertions(+), 3 deletions(-) diff --git a/indra/newview/lllogchat.cpp b/indra/newview/lllogchat.cpp index 300fe4bdd..b5d6bd86e 100644 --- a/indra/newview/lllogchat.cpp +++ b/indra/newview/lllogchat.cpp @@ -127,6 +127,19 @@ void LLLogChat::saveHistory(std::string const& filename, std::string line) } } +const std::streamoff BUFFER_SIZE(4096); + +// Read a chunk of size from pos in ifstr and prepend it to data +// return that chunk's newline count +U32 read_chunk(llifstream& ifstr, const std::streamoff& pos, U32 size, std::string& data) +{ + char buffer[BUFFER_SIZE]; + ifstr.seekg(pos); + ifstr.read(buffer, size); + data.insert(0, buffer, size); + return std::count(buffer, buffer + size, '\n'); +} + void LLLogChat::loadHistory(std::string const& filename , void (*callback)(ELogLineType,std::string,void*), void* userdata) { if(!filename.size()) @@ -143,10 +156,43 @@ void LLLogChat::loadHistory(std::string const& filename , void (*callback)(ELogL else { static const LLCachedControl lines("LogShowHistoryLines", 32); - std::string line; - for (U32 i = 0; i < lines && getline(ifstr, line); ++i) + ifstr.seekg(-1, std::ios_base::end); + if (!lines || !ifstr) { - callback(LOG_LINE, line, userdata); + callback(LOG_EMPTY,LLStringUtil::null,userdata); + return; + } + + std::string data; + U32 nlines = 0; + if (ifstr.get() != '\n') // in case file doesn't end with a newline + { + data.push_back('\n'); + ++nlines; + } + + // Read BUFFER_SIZE byte chunks until we have enough endlines accumulated + for(std::streamoff pos = ifstr.tellg() - BUFFER_SIZE; nlines < lines+1; pos -= BUFFER_SIZE) + { + if (pos > 0) + { + nlines += read_chunk(ifstr, pos, BUFFER_SIZE, data); + } + else // Ran out of file read the remaining from the start + { + nlines += read_chunk(ifstr, 0, pos + BUFFER_SIZE, data); + break; + } + } + + // Break data into lines + std::istringstream sstr(data); + for (std::string line; nlines > 0 && getline(sstr, line); --nlines) + { + if (nlines <= lines) + { + callback(LOG_LINE, line, userdata); + } } callback(LOG_END,LLStringUtil::null,userdata); } From 7346931f7f6f72abc089b9bd7e29250696124f87 Mon Sep 17 00:00:00 2001 From: Latif Khalifa Date: Tue, 17 Sep 2013 04:59:25 +0200 Subject: [PATCH 149/302] Revert OCD commit tick. Revert "Appease VS2010 warning and make ui code more consistent with the modern standard in daeexport.cpp" This reverts commit cb6dec62ec5e9a2bd09750b425b34871093e7c2a. --- indra/newview/daeexport.cpp | 64 ++++++++++--------- .../default/xui/en-us/floater_dae_export.xml | 4 +- 2 files changed, 37 insertions(+), 31 deletions(-) diff --git a/indra/newview/daeexport.cpp b/indra/newview/daeexport.cpp index 1e71bf61b..6beff624b 100644 --- a/indra/newview/daeexport.cpp +++ b/indra/newview/daeexport.cpp @@ -74,6 +74,7 @@ // menu includes #include "llevent.h" #include "llmemberlistener.h" +#include "llview.h" #include "llselectmgr.h" // Floater and UI @@ -81,6 +82,8 @@ #include "lluictrlfactory.h" #include "llscrollcontainer.h" #include "lltexturectrl.h" +#include "llcombobox.h" +#include "llcheckboxctrl.h" // Files and cache #include "llcallbacklist.h" @@ -185,13 +188,16 @@ class ColladaExportFloater { private: typedef std::map texture_list_t; - LLView* mExportBtn; - LLView* mFileName; - LLView* mTextureTypeCombo; + LLButton* mExportBtn; + LLButton* mBrowseBtn; + LLLineEditor* mFileName; + LLComboBox* mTextureTypeCombo; + LLCheckBoxCtrl* mTextureExportCheck; DAESaver mSaver; texture_list_t mTexturesToSave; S32 mTotal; + S32 mIncluded; S32 mNumTextures; S32 mNumExportableTextures; std::string mObjectName; @@ -204,25 +210,16 @@ public: { mCommitCallbackRegistrar.add("ColladaExport.FilePicker", boost::bind(&ColladaExportFloater::onClickBrowse, this)); mCommitCallbackRegistrar.add("ColladaExport.Export", boost::bind(&ColladaExportFloater::onClickExport, this)); - mCommitCallbackRegistrar.add("ColladaExport.TextureTypeCombo", boost::bind(&ColladaExportFloater::onTextureTypeCombo, this, boost::bind(&LLUICtrl::getControlName, _1), _2)); - mCommitCallbackRegistrar.add("ColladaExport.TextureExport", boost::bind(&ColladaExportFloater::onTextureExportCheck, this, _2)); + mCommitCallbackRegistrar.add("ColladaExport.TextureTypeCombo", boost::bind(&ColladaExportFloater::onTextureTypeCombo, this)); + mCommitCallbackRegistrar.add("ColladaExport.TextureExport", boost::bind(&ColladaExportFloater::onTextureExportCheck, this)); LLUICtrlFactory::getInstance()->buildFloater(this, "floater_dae_export.xml"); addSelectedObjects(); - if (LLUICtrl* ctrl = findChild("Object Name")) - { - ctrl->setTextArg("[NAME]", mObjectName); - } - if (LLUICtrl* ctrl = findChild("Exportable Prims")) - { - ctrl->setTextArg("[COUNT]", llformat("%d", mSaver.mObjects.size())); - ctrl->setTextArg("[TOTAL]", llformat("%d", mTotal)); - } - if (LLUICtrl* ctrl = findChild("Exportable Textures")) - { - ctrl->setTextArg("[COUNT]", llformat("%d", mNumExportableTextures)); - ctrl->setTextArg("[TOTAL]", llformat("%d", mNumTextures)); - } + childSetTextArg("Object Name", "[NAME]", mObjectName); + childSetTextArg("Exportable Prims", "[COUNT]", llformat("%d", mIncluded)); + childSetTextArg("Exportable Prims", "[TOTAL]", llformat("%d", mTotal)); + childSetTextArg("Exportable Textures", "[COUNT]", llformat("%d", mNumExportableTextures)); + childSetTextArg("Exportable Textures", "[TOTAL]", llformat("%d", mNumTextures)); addTexturePreview(); } @@ -236,13 +233,17 @@ public: BOOL postBuild() { - mFileName = getChildView("file name editor"); - mExportBtn = getChildView("export button"); - mTextureTypeCombo = getChildView("texture type combo"); + mFileName = getChild("file name editor"); + mExportBtn = getChild("export button"); + mBrowseBtn = getChild("browse button"); + mTextureTypeCombo = getChild("texture type combo"); + mTextureExportCheck = getChild("texture export check"); mTitleProgress = getString("texture_progress"); + mExportBtn->setEnabled(FALSE); + mFileName->setEnabled(FALSE); mTextureTypeCombo->setValue(gSavedSettings.getS32(mTextureTypeCombo->getControlName())); - onTextureExportCheck(getChildView("texture export check")->getValue()); + onTextureExportCheck(); return TRUE; } @@ -252,14 +253,14 @@ public: setTitle(mTitleProgress); } - void onTextureExportCheck(const LLSD& value) + void onTextureExportCheck() { - mTextureTypeCombo->setEnabled(value); + mTextureTypeCombo->setEnabled(mTextureExportCheck->get()); } - void onTextureTypeCombo(const std::string& control_name, const LLSD& value) + void onTextureTypeCombo() { - gSavedSettings.setS32(control_name, value); + gSavedSettings.setS32(mTextureTypeCombo->getControlName(), mTextureTypeCombo->getValue()); } void onClickBrowse() @@ -275,7 +276,10 @@ public: if (filepicker->hasFilename()) { mFileName->setValue(filepicker->getFilename()); - mExportBtn->setEnabled(TRUE); + if (mIncluded > 0) + { + mExportBtn->setEnabled(TRUE); + } } } @@ -306,12 +310,14 @@ public: mSaver.mOffset = -selection->getFirstRootObject()->getRenderPosition(); mObjectName = selection->getFirstRootNode()->mName; mTotal = 0; + mIncluded = 0; for (LLObjectSelection::iterator iter = selection->begin(); iter != selection->end(); ++iter) { mTotal++; LLSelectNode* node = *iter; if (!node->getObject()->getVolume() || !DAEExportUtil::canExportNode(node)) continue; + mIncluded++; mSaver.add(node->getObject(), node->mName); } @@ -808,7 +814,7 @@ bool DAESaver::saveDAE(std::string filename) v4adapt verts(face->mPositions); v4adapt norms(face->mNormals); - LLVector2* newCoord = NULL; + LLVector2* newCoord; if (applyTexCoord) { diff --git a/indra/newview/skins/default/xui/en-us/floater_dae_export.xml b/indra/newview/skins/default/xui/en-us/floater_dae_export.xml index 8d01c4ee0..51f8fd80c 100644 --- a/indra/newview/skins/default/xui/en-us/floater_dae_export.xml +++ b/indra/newview/skins/default/xui/en-us/floater_dae_export.xml @@ -2,11 +2,11 @@ Collada Export: Saving textures ([COUNT] remaining) File Name: - + - From 3f1d05b8397a09c0275598b51298568edf80ee2f Mon Sep 17 00:00:00 2001 From: Latif Khalifa Date: Tue, 17 Sep 2013 05:04:44 +0200 Subject: [PATCH 150/302] Re-apply warning fix after the previous revert --- indra/newview/daeexport.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/daeexport.cpp b/indra/newview/daeexport.cpp index 6beff624b..0938bd1cb 100644 --- a/indra/newview/daeexport.cpp +++ b/indra/newview/daeexport.cpp @@ -814,7 +814,7 @@ bool DAESaver::saveDAE(std::string filename) v4adapt verts(face->mPositions); v4adapt norms(face->mNormals); - LLVector2* newCoord; + LLVector2* newCoord = NULL; if (applyTexCoord) { From 08654cc859980ff9444842cea4ec8ce49a4d684a Mon Sep 17 00:00:00 2001 From: Drake Arconis Date: Tue, 17 Sep 2013 01:25:05 -0400 Subject: [PATCH 151/302] Fixed profile floater not displaying custom account type strings from server --- indra/newview/llpanelavatar.cpp | 54 ++----------------- .../skins/default/xui/en-us/panel_avatar.xml | 27 ---------- .../skins/default/xui/en-us/strings.xml | 17 ++++-- 3 files changed, 19 insertions(+), 79 deletions(-) diff --git a/indra/newview/llpanelavatar.cpp b/indra/newview/llpanelavatar.cpp index 4cda01c3b..2c6e5a057 100644 --- a/indra/newview/llpanelavatar.cpp +++ b/indra/newview/llpanelavatar.cpp @@ -46,6 +46,7 @@ #include "llagent.h" #include "llavataractions.h" +#include "llavatarpropertiesprocessor.h" #include "llcallingcard.h" #include "lldroptarget.h" #include "llfloatergroupinfo.h" @@ -183,56 +184,11 @@ void LLPanelAvatarSecondLife::processProperties(void* data, EAvatarProcessorType if (pAvatarData && (mAvatarID == pAvatarData->avatar_id) && (pAvatarData->avatar_id != LLUUID::null)) { LLStringUtil::format_map_t args; - - U8 caption_index = 0; - std::string caption_text = getString("CaptionTextAcctInfo"); - - const char* ACCT_TYPE[] = - { - "AcctTypeResident", - "AcctTypeTrial", - "AcctTypeCharterMember", - "AcctTypeEmployee" - }; - - - caption_index = llclamp(caption_index, (U8)0, (U8)(LL_ARRAY_SIZE(ACCT_TYPE)-1)); - args["[ACCTTYPE]"] = getString(ACCT_TYPE[caption_index]); + args["[ACCTTYPE]"] = LLAvatarPropertiesProcessor::accountType(pAvatarData); + args["[PAYMENTINFO]"] = LLAvatarPropertiesProcessor::paymentInfo(pAvatarData); + args["[AGEVERIFICATION]"] = " "; - std::string payment_text = " "; - const S32 DEFAULT_CAPTION_LINDEN_INDEX = 3; - if(caption_index != DEFAULT_CAPTION_LINDEN_INDEX) - { - if(pAvatarData->flags & AVATAR_TRANSACTED) - { - payment_text = "PaymentInfoUsed"; - } - else if (pAvatarData->flags & AVATAR_IDENTIFIED) - { - payment_text = "PaymentInfoOnFile"; - } - else - { - payment_text = "NoPaymentInfoOnFile"; - } - args["[PAYMENTINFO]"] = getString(payment_text); - - // Do not display age verification status at this time - Mostly because it /doesn't work/. -HgB - /*bool age_verified = (pAvatarData->flags & AVATAR_AGEVERIFIED); // Not currently getting set in dataserver/lldataavatar.cpp for privacy consideration - std::string age_text = age_verified ? "AgeVerified" : "NotAgeVerified"; - - args["[AGEVERIFICATION]"] = getString(age_text); - */ - args["[AGEVERIFICATION]"] = " "; - } - else - { - args["[PAYMENTINFO]"] = " "; - args["[AGEVERIFICATION]"] = " "; - } - LLStringUtil::format(caption_text, args); - - childSetValue("acct", caption_text); + getChild("acct")->setValue(getString("CaptionTextAcctInfo", args)); getChild("img")->setImageAssetID(pAvatarData->image_id); diff --git a/indra/newview/skins/default/xui/en-us/panel_avatar.xml b/indra/newview/skins/default/xui/en-us/panel_avatar.xml index 284576ba1..9c59c900e 100644 --- a/indra/newview/skins/default/xui/en-us/panel_avatar.xml +++ b/indra/newview/skins/default/xui/en-us/panel_avatar.xml @@ -9,33 +9,6 @@ [PAYMENTINFO] [AGEVERIFICATION] - - Resident - - - Trial - - - Charter Member - - - Linden Lab Employee - - - Payment Info Used - - - Payment Info On File - - - No Payment Info On File - - - Age-verified - - - Not Age-verified - - From ad8ea07a7aa95a8df3f736b8cd54d9604b3ed307 Mon Sep 17 00:00:00 2001 From: Latif Khalifa Date: Thu, 26 Sep 2013 04:09:01 +0200 Subject: [PATCH 180/302] Aurora var region support Firestorm patch by Cinders Adopted from Angstrom viewer with assistance of nhede Core and Revolution Smythe. --- indra/llcommon/indra_constants.h | 8 + indra/llmessage/message_prehash.cpp | 9 +- indra/llmessage/message_prehash.h | 7 + indra/llmessage/patch_code.cpp | 43 ++- indra/llmessage/patch_code.h | 5 +- indra/llmessage/patch_dct.h | 5 +- indra/newview/llagent.cpp | 18 +- indra/newview/llcloud.cpp | 2 +- indra/newview/llfloaterworldmap.cpp | 27 +- indra/newview/llglsandbox.cpp | 10 +- indra/newview/llnetmap.cpp | 31 +- indra/newview/llstartup.cpp | 29 +- indra/newview/llsurface.cpp | 285 +++++++++++++++--- indra/newview/llsurface.h | 3 + indra/newview/llsurfacepatch.cpp | 142 +++++++-- indra/newview/llviewermessage.cpp | 40 ++- indra/newview/llviewerobject.cpp | 5 +- indra/newview/llviewerparcelmgr.cpp | 44 ++- indra/newview/llviewerparcelmgr.h | 3 + indra/newview/llviewerparceloverlay.cpp | 10 +- indra/newview/llviewerparceloverlay.h | 3 + indra/newview/llviewerregion.cpp | 83 ++++- indra/newview/llviewerregion.h | 3 + indra/newview/llvlcomposition.cpp | 5 +- indra/newview/llvlmanager.cpp | 23 +- indra/newview/llvlmanager.h | 3 + indra/newview/llvowater.cpp | 5 +- indra/newview/llwind.cpp | 18 +- indra/newview/llworld.cpp | 100 +++++- indra/newview/llworld.h | 16 +- indra/newview/llworldmap.cpp | 53 +++- indra/newview/llworldmap.h | 24 +- indra/newview/llworldmapmessage.cpp | 9 +- .../default/xui/en-us/floater_world_map.xml | 4 +- 34 files changed, 901 insertions(+), 174 deletions(-) diff --git a/indra/llcommon/indra_constants.h b/indra/llcommon/indra_constants.h index 3f0e8dd6c..ea8c91155 100644 --- a/indra/llcommon/indra_constants.h +++ b/indra/llcommon/indra_constants.h @@ -149,6 +149,14 @@ const char WATER_LAYER_CODE = 'W'; const char WIND_LAYER_CODE = '7'; const char CLOUD_LAYER_CODE = '8'; +// Aurora Sim +// 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 = ':'; +// Aurora Sim + // keys // Bit masks for various keyboard modifier keys. const MASK MASK_NONE = 0x0000; diff --git a/indra/llmessage/message_prehash.cpp b/indra/llmessage/message_prehash.cpp index e279f781d..8544b37e1 100644 --- a/indra/llmessage/message_prehash.cpp +++ b/indra/llmessage/message_prehash.cpp @@ -37,8 +37,6 @@ F32 const gPrehashVersionNumber = 2.000f; char const* const _PREHASH_X = LLMessageStringTable::getInstance()->getString("X"); char const* const _PREHASH_Y = LLMessageStringTable::getInstance()->getString("Y"); char const* const _PREHASH_Z = LLMessageStringTable::getInstance()->getString("Z"); -char const* const _PREHASH_SizeX = LLMessageStringTable::getInstance()->getString("SizeX"); -char const* const _PREHASH_SizeY = LLMessageStringTable::getInstance()->getString("SizeY"); char const* const _PREHASH_AddFlags = LLMessageStringTable::getInstance()->getString("AddFlags"); char const* const _PREHASH_FailureInfo = LLMessageStringTable::getInstance()->getString("FailureInfo"); char const* const _PREHASH_MapData = LLMessageStringTable::getInstance()->getString("MapData"); @@ -1386,3 +1384,10 @@ char const* const _PREHASH_GroupAVSounds = LLMessageStringTable::getInstance()-> char const* const _PREHASH_AppearanceData = LLMessageStringTable::getInstance()->getString("AppearanceData"); char const* const _PREHASH_AppearanceVersion = LLMessageStringTable::getInstance()->getString("AppearanceVersion"); char const* const _PREHASH_CofVersion = LLMessageStringTable::getInstance()->getString("CofVersion"); + +// Aurora Sim +char const* const _PREHASH_RegionSizeX = LLMessageStringTable::getInstance()->getString("RegionSizeX"); +char const* const _PREHASH_RegionSizeY = LLMessageStringTable::getInstance()->getString("RegionSizeY"); +char const* const _PREHASH_SizeX = LLMessageStringTable::getInstance()->getString("SizeX"); +char const* const _PREHASH_SizeY = LLMessageStringTable::getInstance()->getString("SizeY"); +// Aurora Sim diff --git a/indra/llmessage/message_prehash.h b/indra/llmessage/message_prehash.h index 1c1d6e224..7c5046fe2 100644 --- a/indra/llmessage/message_prehash.h +++ b/indra/llmessage/message_prehash.h @@ -1386,4 +1386,11 @@ extern char const* const _PREHASH_GroupAVSounds; extern char const* const _PREHASH_AppearanceData; extern char const* const _PREHASH_AppearanceVersion; extern char const* const _PREHASH_CofVersion; + +// Aurora Sim +extern char const* const _PREHASH_RegionSizeX; +extern char const* const _PREHASH_RegionSizeY; +extern char const* const _PREHASH_SizeX; +extern char const* const _PREHASH_SizeY; +// Aurora Sim #endif diff --git a/indra/llmessage/patch_code.cpp b/indra/llmessage/patch_code.cpp index e5d7f1944..6ab3a6e11 100644 --- a/indra/llmessage/patch_code.cpp +++ b/indra/llmessage/patch_code.cpp @@ -229,7 +229,10 @@ void decode_patch_group_header(LLBitPack &bitpack, LLGroupHeader *gopp) gPatchSize = gopp->patch_size; } -void decode_patch_header(LLBitPack &bitpack, LLPatchHeader *ph) +// Aurora Sim +//void decode_patch_header(LLBitPack &bitpack, LLPatchHeader *ph) +void decode_patch_header(LLBitPack &bitpack, LLPatchHeader *ph, BOOL b_large_patch) +// Aurora Sim { U8 retvalu8; @@ -268,15 +271,41 @@ void decode_patch_header(LLBitPack &bitpack, LLPatchHeader *ph) #endif ph->range = retvalu16; - retvalu16 = 0; +// Aurora Sim + //retvalu16 = 0; + retvalu32 = 0; #ifdef LL_BIG_ENDIAN - ret = (U8 *)&retvalu16; - bitpack.bitUnpack(&(ret[1]), 8); - bitpack.bitUnpack(&(ret[0]), 2); +// Aurora Sim + //ret = (U8 *)&retvalu16; + if(b_large_patch) + { + //todo test + ret = (U8 *)&retvalu32; + bitpack.bitUnpack(&(ret[3]), 8); + bitpack.bitUnpack(&(ret[2]), 8); + bitpack.bitUnpack(&(ret[1]), 8); + bitpack.bitUnpack(&(ret[0]), 8); + } + else + { + ret = (U8 *)&retvalu32; + bitpack.bitUnpack(&(ret[1]), 8); + bitpack.bitUnpack(&(ret[0]), 2); + } + // Aurora Sim #else - bitpack.bitUnpack((U8 *)&retvalu16, 10); +// Aurora Sim + //bitpack.bitUnpack((U8 *)&retvalu16, 10); + if(b_large_patch) + bitpack.bitUnpack((U8 *)&retvalu32, 32); + else + bitpack.bitUnpack((U8 *)&retvalu32, 10); +// Aurora Sim #endif - ph->patchids = retvalu16; +// Aurora Sim + //ph->patchids = retvalu16; + ph->patchids = retvalu32; +// Aurora Sim gWordBits = (ph->quant_wbits & 0xf) + 2; } diff --git a/indra/llmessage/patch_code.h b/indra/llmessage/patch_code.h index 4c87c9808..0b9091f43 100644 --- a/indra/llmessage/patch_code.h +++ b/indra/llmessage/patch_code.h @@ -40,7 +40,10 @@ 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); +// Aurora Sim +//void decode_patch_header(LLBitPack &bitpack, LLPatchHeader *ph); +void decode_patch_header(LLBitPack &bitpack, LLPatchHeader *ph, BOOL b_large_patch); +// Aurora Sim void decode_patch(LLBitPack &bitpack, S32 *patches); #endif diff --git a/indra/llmessage/patch_dct.h b/indra/llmessage/patch_dct.h index 101231ec8..d9c3ec7a5 100644 --- a/indra/llmessage/patch_dct.h +++ b/indra/llmessage/patch_dct.h @@ -73,7 +73,10 @@ 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) - U16 patchids; // 2 = 10 (actually only uses 10 bits, 5 for each) +// Aurora Sim + //U16 patchids; // 2 = 10 (actually only uses 10 bits, 5 for each) + U32 patchids; +// Aurora Sim }; // Compression routines diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp index f42739b20..ea3aa6145 100644 --- a/indra/newview/llagent.cpp +++ b/indra/newview/llagent.cpp @@ -2319,7 +2319,10 @@ void LLAgent::setStartPosition( U32 location_id ) // this simulator. Clamp it to the region the agent is // in, a little bit in on each side. const F32 INSET = 0.5f; //meters - const F32 REGION_WIDTH = LLWorld::getInstance()->getRegionWidthInMeters(); +// Aurora Sim + //const F32 REGION_WIDTH = LLWorld::getInstance()->getRegionWidthInMeters(); + const F32 REGION_WIDTH = getRegion()->getWidth(); +// Aurora Sim LLVector3 agent_pos = getPositionAgent(); @@ -4233,8 +4236,10 @@ void LLAgent::doTeleportViaLocation(const LLVector3d& pos_global) (F32)(pos_global.mdV[VX] - region_origin.mdV[VX]), (F32)(pos_global.mdV[VY] - region_origin.mdV[VY]), (F32)(pos_global.mdV[VZ])); - pos_local += offset; - teleportRequest(handle, pos_local); +// Aurora-sim var region teleports + //teleportRequest(handle, pos_local); + teleportRequest(info->getHandle(), pos_local); +// } else if(regionp && teleportCore(regionp->getHandle() == to_region_handle_global((F32)pos_global.mdV[VX], (F32)pos_global.mdV[VY]))) @@ -4289,6 +4294,13 @@ void LLAgent::doTeleportViaLocationLookAt(const LLVector3d& pos_global) mbTeleportKeepsLookAt = true; gAgentCamera.setFocusOnAvatar(FALSE, ANIMATE); // detach camera form avatar, so it keeps direction U64 region_handle = to_region_handle(pos_global); +// Aurora-sim var region teleports + LLSimInfo* simInfo = LLWorldMap::instance().simInfoFromHandle(region_handle); + if (simInfo) + { + region_handle = simInfo->getHandle(); + } +// LLVector3 pos_local = (LLVector3)(pos_global - from_region_handle(region_handle)); teleportRequest(region_handle, pos_local, getTeleportKeepsLookAt()); } diff --git a/indra/newview/llcloud.cpp b/indra/newview/llcloud.cpp index fcdfbecd4..ebe6460dd 100644 --- a/indra/newview/llcloud.cpp +++ b/indra/newview/llcloud.cpp @@ -441,7 +441,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); + decode_patch_header(bitpack, &patch_header, FALSE); decode_patch(bitpack, gBuffer); decompress_patch(mDensityp, gBuffer, &patch_header); } diff --git a/indra/newview/llfloaterworldmap.cpp b/indra/newview/llfloaterworldmap.cpp index 808191294..24f11cbfc 100644 --- a/indra/newview/llfloaterworldmap.cpp +++ b/indra/newview/llfloaterworldmap.cpp @@ -700,8 +700,14 @@ void LLFloaterWorldMap::trackLocation(const LLVector3d& pos_global) } std::string sim_name = sim_info->getName(); - F32 region_x = (F32)fmod( pos_global.mdV[VX], (F64)REGION_WIDTH_METERS ); - F32 region_y = (F32)fmod( pos_global.mdV[VY], (F64)REGION_WIDTH_METERS ); +// Aurora-sim var region teleports + //F32 region_x = (F32)fmod( pos_global.mdV[VX], (F64)REGION_WIDTH_METERS ); + //F32 region_y = (F32)fmod( pos_global.mdV[VY], (F64)REGION_WIDTH_METERS ); + U32 locX, locY; + from_region_handle(sim_info->getHandle(), &locX, &locY); + F32 region_x = pos_global.mdV[VX] - locX; + F32 region_y = pos_global.mdV[VY] - locY; +// std::string full_name = llformat("%s (%d, %d, %d)", sim_name.c_str(), llround(region_x), @@ -754,17 +760,27 @@ void LLFloaterWorldMap::updateTeleportCoordsDisplay( const LLVector3d& pos ) { // if we're going to update their value, we should also enable them enableTeleportCoordsDisplay( true ); - + // convert global specified position to a local one F32 region_local_x = (F32)fmod( pos.mdV[VX], (F64)REGION_WIDTH_METERS ); F32 region_local_y = (F32)fmod( pos.mdV[VY], (F64)REGION_WIDTH_METERS ); F32 region_local_z = (F32)llclamp( pos.mdV[VZ], 0.0, 8192.0/*(F64)REGION_HEIGHT_METERS*/ ); + LLSimInfo* sim_info = LLWorldMap::getInstance()->simInfoFromPosGlobal(pos); + if (sim_info) // Singu Note: Aurora var region support + { + U32 locX, locY; + from_region_handle(sim_info->getHandle(), &locX, &locY); + region_local_x = pos.mdV[VX] - locX; + region_local_y = pos.mdV[VY] - locY; + region_local_z = (F32)pos.mdV[VZ]; + // write in the values childSetValue("spin x", region_local_x ); childSetValue("spin y", region_local_y ); childSetValue("spin z", region_local_z ); } +} void LLFloaterWorldMap::updateLocation() { @@ -812,7 +828,10 @@ void LLFloaterWorldMap::updateLocation() // Figure out where user is // Set the current SLURL - mSLURL = LLSLURL(agent_sim_name, gAgent.getPositionGlobal()); +// Aurora-sim var region teleports + //mSLURL = LLSLURL(agent_sim_name, gAgent.getPositionGlobal()); + mSLURL = LLSLURL(agent_sim_name, gAgent.getPositionAgent()); +// } } diff --git a/indra/newview/llglsandbox.cpp b/indra/newview/llglsandbox.cpp index b40e3d471..3da03923c 100644 --- a/indra/newview/llglsandbox.cpp +++ b/indra/newview/llglsandbox.cpp @@ -297,7 +297,10 @@ void LLWind::renderVectors() S32 i,j; F32 x,y; - F32 region_width_meters = LLWorld::getInstance()->getRegionWidthInMeters(); +// Aurora Sim + //F32 region_width_meters = LLWorld::getInstance()->getRegionWidthInMeters(); + F32 region_width_meters = gAgent.getRegion()->getWidth(); +// Aurora Sim gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); gGL.pushMatrix(); @@ -505,7 +508,10 @@ 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 = REGION_WIDTH_METERS - 0.1f; +// Aurora Sim + //const F32 BORDER = REGION_WIDTH_METERS - 0.1f; + const F32 BORDER = regionp->getWidth() - 0.1f; +// Aurora Sim F32 clamped_x1 = x1; F32 clamped_y1 = y1; diff --git a/indra/newview/llnetmap.cpp b/indra/newview/llnetmap.cpp index 0f3c9a32b..045c08015 100644 --- a/indra/newview/llnetmap.cpp +++ b/indra/newview/llnetmap.cpp @@ -157,7 +157,10 @@ void LLNetMap::setScale( F32 scale ) F32 height = (F32)(getRect().getHeight()); F32 diameter = sqrt(width * width + height * height); F32 region_widths = diameter / mScale; - F32 meters = region_widths * LLWorld::getInstance()->getRegionWidthInMeters(); +// Aurora Sim + //F32 meters = region_widths * LLWorld::getInstance()->getRegionWidthInMeters(); + F32 meters = region_widths * REGION_WIDTH_METERS; +// Aurora Sim F32 num_pixels = (F32)mObjectImagep->getWidth(); mObjectMapTPM = num_pixels / meters; mObjectMapPixels = diameter; @@ -256,12 +259,15 @@ void LLNetMap::draw() LLColor4 this_region_color = gColors.getColor( "NetMapThisRegion" ); LLColor4 live_region_color = gColors.getColor( "NetMapLiveRegion" ); LLColor4 dead_region_color = gColors.getColor( "NetMapDeadRegion" ); +// Aurora Sim + //S32 region_width = llround(LLWorld::getInstance()->getRegionWidthInMeters()); + S32 region_width = llround(REGION_WIDTH_METERS); +// Aurora Sim for (LLWorld::region_list_t::const_iterator iter = LLWorld::getInstance()->getRegionList().begin(); iter != LLWorld::getInstance()->getRegionList().end(); ++iter) { LLViewerRegion* regionp = *iter; - S32 region_width = llround(regionp->getWidth()); // Find x and y position relative to camera's center. LLVector3 origin_agent = regionp->getOriginAgent(); LLVector3 rel_region_pos = origin_agent - gAgentCamera.getCameraPositionAgent(); @@ -271,8 +277,12 @@ void LLNetMap::draw() // background region rectangle F32 bottom = relative_y; F32 left = relative_x; - F32 top = bottom + mScale ; - F32 right = left + mScale ; +// Aurora Sim + //F32 top = bottom + mScale ; + //F32 right = left + mScale ; + F32 top = bottom + (regionp->getWidth() / region_width) * mScale ; + F32 right = left + (regionp->getWidth() / region_width) * mScale ; +// Aurora Sim gGL.color4fv(regionp == gAgent.getRegion() ? this_region_color.mV : live_region_color.mV); if (!regionp->isAlive()) @@ -479,7 +489,10 @@ void LLNetMap::draw() dot_width); // Draw frustum - F32 meters_to_pixels = mScale/ LLWorld::getInstance()->getRegionWidthInMeters(); +// Aurora Sim + //F32 meters_to_pixels = mScale/ LLWorld::getInstance()->getRegionWidthInMeters(); + F32 meters_to_pixels = mScale/ REGION_WIDTH_METERS; +// Aurora Sim F32 horiz_fov = LLViewerCamera::getInstance()->getView() * LLViewerCamera::getInstance()->getAspect(); F32 far_clip_meters = LLViewerCamera::getInstance()->getFar(); @@ -551,6 +564,9 @@ LLVector3 LLNetMap::globalPosToView(const LLVector3d& global_pos, BOOL rotated) LLVector3 pos_local; pos_local.setVec(relative_pos_global); // convert to floats from doubles +// Aurora Sim + mPixelsPerMeter = mScale / REGION_WIDTH_METERS; +// Aurora Sim pos_local.mV[VX] *= mPixelsPerMeter; pos_local.mV[VY] *= mPixelsPerMeter; // leave Z component in meters @@ -609,7 +625,10 @@ LLVector3d LLNetMap::viewPosToGlobal( S32 x, S32 y, BOOL rotated ) pos_local.rotVec( rot ); } - pos_local *= ( LLWorld::getInstance()->getRegionWidthInMeters() / mScale ); +// Aurora Sim + //pos_local *= ( LLWorld::getInstance()->getRegionWidthInMeters() / mScale ); + pos_local *= ( REGION_WIDTH_METERS / mScale ); +// Aurora Sim LLVector3d pos_global; pos_global.setVec( pos_local ); diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index 77d6b9e6e..bcbc34cf3 100644 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -309,7 +309,10 @@ void init_start_screen(S32 location_id); void release_start_screen(); void reset_login(); void apply_udp_blacklist(const std::string& csv); -bool process_login_success_response(std::string &password); +// Aurora Sim +//bool process_login_success_response(); +bool process_login_success_response(std::string& password, U32 &first_sim_size_x, U32 &first_sim_size_y); +// Aurora Sim void transition_back_to_login_panel(const std::string& emsg); void callback_cache_name(const LLUUID& id, const std::string& full_name, bool is_group) @@ -397,6 +400,10 @@ bool idle_startup() static std::vector requested_options; static std::string redirect_uri; +// Aurora Sim + static U32 first_sim_size_x = 256; + static U32 first_sim_size_y = 256; +// Aurora Sim 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 @@ -1543,7 +1550,7 @@ bool idle_startup() if (successful_login) { // unpack login data needed by the application - if(process_login_success_response(password)) + if(process_login_success_response(password, first_sim_size_x, first_sim_size_y)) { std::string name = firstname; if (!gHippoGridManager->getCurrentGrid()->isSecondLife() || @@ -1662,7 +1669,10 @@ bool idle_startup() gAgent.initOriginGlobal(from_region_handle(gFirstSimHandle)); display_startup(); - LLWorld::getInstance()->addRegion(gFirstSimHandle, gFirstSim); +// Aurora Sim + //LLWorld::getInstance()->addRegion(gFirstSimHandle, gFirstSim); +LLWorld::getInstance()->addRegion(gFirstSimHandle, gFirstSim, first_sim_size_x, first_sim_size_y); +// Aurora Sim display_startup(); LLViewerRegion *regionp = LLWorld::getInstance()->getRegionFromHandle(gFirstSimHandle); @@ -3844,7 +3854,7 @@ void apply_udp_blacklist(const std::string& csv) } -bool process_login_success_response(std::string& password) +bool process_login_success_response(std::string& password, U32 &first_sim_size_x, U32 &first_sim_size_y) { LLSD response = LLUserAuth::getInstance()->getResponse(); @@ -3985,6 +3995,17 @@ bool process_login_success_response(std::string& password) gFirstSimHandle = to_region_handle(region_x, region_y); } +// Aurora Sim + text = response["region_size_x"].asString(); + 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 = response["region_size_y"].asString(); + if(!text.empty()) first_sim_size_y = strtoul(text.c_str(), NULL, 10); +// Aurora Sim const std::string look_at_str = response["look_at"]; if (!look_at_str.empty()) { diff --git a/indra/newview/llsurface.cpp b/indra/newview/llsurface.cpp index ca4c37eff..f6485e0d9 100644 --- a/indra/newview/llsurface.cpp +++ b/indra/newview/llsurface.cpp @@ -172,6 +172,9 @@ void LLSurface::create(const S32 grids_per_edge, mNumberOfPatches = mPatchesPerEdge * mPatchesPerEdge; mMetersPerGrid = width / ((F32)(mGridsPerEdge - 1)); mMetersPerEdge = mMetersPerGrid * (mGridsPerEdge - 1); +// Aurora Sim + sTextureSize = width; +// Aurora Sim mOriginGlobal.setVec(origin_global); @@ -295,7 +298,31 @@ 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(128.0, 128.0, DEFAULT_WATER_HEIGHT); +// Aurora Sim + //water_pos_global += LLVector3d(128.0, 128.0, DEFAULT_WATER_HEIGHT); // region doesn't have a valid water height yet + water_pos_global += LLVector3d(mRegionp->getWidth()/2, mRegionp->getWidth()/2, DEFAULT_WATER_HEIGHT); + mWaterObjp->setPositionGlobal(water_pos_global); + } +} + +void LLSurface::rebuildWater() +{ + BOOL renderwater = gSavedSettings.getBOOL("RenderWater"); + BOOL prev_renderwater = !mWaterObjp.isNull(); + + if(prev_renderwater && !renderwater) + { + gObjectList.killObject(mWaterObjp); + } + + if (!prev_renderwater && renderwater) + { + createWaterTexture(); + 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); +// Aurora Sim mWaterObjp->setPositionGlobal(water_pos_global); } } @@ -325,8 +352,12 @@ void LLSurface::setOriginGlobal(const LLVector3d &origin_global) // Hack! if (mWaterObjp.notNull() && mWaterObjp->mDrawable.notNull()) { - const F64 x = origin_global.mdV[VX] + 128.0; - const F64 y = origin_global.mdV[VY] + 128.0; +// Aurora Sim + //const F64 x = origin_global.mdV[VX] + 128.0; + //const F64 y = origin_global.mdV[VY] + 128.0; + const F64 x = origin_global.mdV[VX] + (F64)mRegionp->getWidth()/2; + const F64 y = origin_global.mdV[VY] + (F64)mRegionp->getWidth()/2; +// Aurora Sim const F64 z = mWaterObjp->getPositionGlobal().mdV[VZ]; LLVector3d water_origin_global(x, y, z); @@ -364,15 +395,52 @@ void LLSurface::connectNeighbor(LLSurface *neighborp, U32 direction) { S32 i; LLSurfacePatch *patchp, *neighbor_patchp; +// Aurora Sim + S32 neighborPatchesPerEdge = neighborp->mPatchesPerEdge; +// Aurora Sim mNeighbors[direction] = neighborp; neighborp->mNeighbors[gDirOpposite[direction]] = this; +// Aurora Sim + S32 ppe[2]; + S32 own_offset[2] = {0, 0}; + S32 neighbor_offset[2] = {0, 0}; + U32 own_xpos, own_ypos, neighbor_xpos, neighbor_ypos; + + ppe[0] = (mPatchesPerEdge < neighborPatchesPerEdge) ? mPatchesPerEdge : neighborPatchesPerEdge; // used for x + ppe[1] = ppe[0]; // used for y + + from_region_handle(mRegionp->getHandle(), &own_xpos, &own_ypos); + from_region_handle(neighborp->getRegion()->getHandle(), &neighbor_xpos, &neighbor_ypos); + + if(own_ypos >= neighbor_ypos) { + neighbor_offset[1] = (own_ypos - neighbor_ypos) / mGridsPerPatchEdge; + ppe[1] = llmin(mPatchesPerEdge, neighborPatchesPerEdge-neighbor_offset[1]); + } + else { + own_offset[1] = (neighbor_ypos - own_ypos) / mGridsPerPatchEdge; + ppe[1] = llmin(mPatchesPerEdge-own_offset[1], neighborPatchesPerEdge); + } + + if(own_xpos >= neighbor_xpos) { + neighbor_offset[0] = (own_xpos - neighbor_xpos) / mGridsPerPatchEdge; + ppe[0] = llmin(mPatchesPerEdge, neighborPatchesPerEdge-neighbor_offset[0]); + } + else { + own_offset[0] = (neighbor_xpos - own_xpos) / mGridsPerPatchEdge; + ppe[0] = llmin(mPatchesPerEdge-own_offset[0], neighborPatchesPerEdge); + } +// Aurora Sim + // Connect patches if (NORTHEAST == direction) { patchp = getPatch(mPatchesPerEdge - 1, mPatchesPerEdge - 1); - neighbor_patchp = neighborp->getPatch(0, 0); +// Aurora Sim + //neighbor_patchp = neighborp->getPatch(0, 0); + neighbor_patchp = neighborp->getPatch(neighbor_offset[0], neighbor_offset[1]); +// Aurora Sim patchp->connectNeighbor(neighbor_patchp, direction); neighbor_patchp->connectNeighbor(patchp, gDirOpposite[direction]); @@ -382,8 +450,14 @@ void LLSurface::connectNeighbor(LLSurface *neighborp, U32 direction) } else if (NORTHWEST == direction) { +// Aurora Sim + S32 off = mPatchesPerEdge + neighbor_offset[1] - own_offset[1]; +// Aurora Sim patchp = getPatch(0, mPatchesPerEdge - 1); - neighbor_patchp = neighborp->getPatch(mPatchesPerEdge - 1, 0); +// Aurora Sim + //neighbor_patchp = neighborp->getPatch(mPatchesPerEdge - 1, 0); + neighbor_patchp = neighborp->getPatch(neighbor_offset[0] - 1, off); //neighborPatchesPerEdge - 1 +// Aurora Sim patchp->connectNeighbor(neighbor_patchp, direction); neighbor_patchp->connectNeighbor(patchp, gDirOpposite[direction]); @@ -391,18 +465,31 @@ void LLSurface::connectNeighbor(LLSurface *neighborp, U32 direction) else if (SOUTHWEST == direction) { patchp = getPatch(0, 0); - neighbor_patchp = neighborp->getPatch(mPatchesPerEdge - 1, mPatchesPerEdge - 1); +// Aurora Sim + //neighbor_patchp = neighborp->getPatch(mPatchesPerEdge - 1, mPatchesPerEdge - 1); + neighbor_patchp = neighborp->getPatch(neighbor_offset[0] - 1, neighbor_offset[1] - 1); +// Aurora Sim patchp->connectNeighbor(neighbor_patchp, direction); neighbor_patchp->connectNeighbor(patchp, gDirOpposite[direction]); - neighbor_patchp->updateNorthEdge(); // Only update one of north or east. +// Aurora Sim + //neighbor_patchp->updateNorthEdge(); // Only update one of north or east. + neighbor_patchp->updateEastEdge(); // Only update one of north or east. +// Aurora Sim neighbor_patchp->dirtyZ(); } else if (SOUTHEAST == direction) { +// Aurora Sim + S32 off = mPatchesPerEdge + neighbor_offset[0] - own_offset[0]; +// Aurora Sim + patchp = getPatch(mPatchesPerEdge - 1, 0); - neighbor_patchp = neighborp->getPatch(0, mPatchesPerEdge - 1); +// Aurora Sim + //neighbor_patchp = neighborp->getPatch(0, mPatchesPerEdge - 1); + neighbor_patchp = neighborp->getPatch(off, neighbor_offset[1] - 1); //0 +// Aurora Sim patchp->connectNeighbor(neighbor_patchp, direction); neighbor_patchp->connectNeighbor(patchp, gDirOpposite[direction]); @@ -410,10 +497,17 @@ void LLSurface::connectNeighbor(LLSurface *neighborp, U32 direction) else if (EAST == direction) { // Do east/west connections, first - for (i = 0; i < (S32)mPatchesPerEdge; i++) +// Aurora Sim + //for (i = 0; i < (S32)mPatchesPerEdge; i++) + for (i = 0; i < ppe[1]; i++) +// Aurora Sim { - patchp = getPatch(mPatchesPerEdge - 1, i); - neighbor_patchp = neighborp->getPatch(0, i); +// Aurora Sim + //patchp = getPatch(mPatchesPerEdge - 1, i); + //neighbor_patchp = neighborp->getPatch(0, i); + patchp = getPatch(mPatchesPerEdge - 1, i + own_offset[1]); + neighbor_patchp = neighborp->getPatch(0, i + neighbor_offset[1]); +// Aurora Sim patchp->connectNeighbor(neighbor_patchp, direction); neighbor_patchp->connectNeighbor(patchp, gDirOpposite[direction]); @@ -423,19 +517,33 @@ void LLSurface::connectNeighbor(LLSurface *neighborp, U32 direction) } // Now do northeast/southwest connections - for (i = 0; i < (S32)mPatchesPerEdge - 1; i++) +// Aurora Sim + //for (i = 0; i < (S32)mPatchesPerEdge - 1; i++) + for (i = 0; i < ppe[1] - 1; i++) +// Aurora Sim { - patchp = getPatch(mPatchesPerEdge - 1, i); - neighbor_patchp = neighborp->getPatch(0, i+1); +// Aurora Sim + //patchp = getPatch(mPatchesPerEdge - 1, i); + //neighbor_patchp = neighborp->getPatch(0, i+1); + patchp = getPatch(mPatchesPerEdge - 1, i + own_offset[1]); + neighbor_patchp = neighborp->getPatch(0, i+1 + neighbor_offset[1]); +// Aurora Sim patchp->connectNeighbor(neighbor_patchp, NORTHEAST); neighbor_patchp->connectNeighbor(patchp, SOUTHWEST); } // Now do southeast/northwest connections - for (i = 1; i < (S32)mPatchesPerEdge; i++) +// Aurora Sim + //for (i = 1; i < (S32)mPatchesPerEdge; i++) + for (i = 1; i < ppe[1]; i++) +// Aurora Sim { - patchp = getPatch(mPatchesPerEdge - 1, i); - neighbor_patchp = neighborp->getPatch(0, i-1); +// Aurora Sim + //patchp = getPatch(mPatchesPerEdge - 1, i); + //neighbor_patchp = neighborp->getPatch(0, i-1); + patchp = getPatch(mPatchesPerEdge - 1, i + own_offset[1]); + neighbor_patchp = neighborp->getPatch(0, i-1 + neighbor_offset[1]); +// Aurora Sim patchp->connectNeighbor(neighbor_patchp, SOUTHEAST); neighbor_patchp->connectNeighbor(patchp, NORTHWEST); @@ -444,10 +552,17 @@ void LLSurface::connectNeighbor(LLSurface *neighborp, U32 direction) else if (NORTH == direction) { // Do north/south connections, first - for (i = 0; i < (S32)mPatchesPerEdge; i++) +// Aurora Sim + //for (i = 0; i < (S32)mPatchesPerEdge; i++) + for (i = 0; i < ppe[0]; i++) +// Aurora Sim { - patchp = getPatch(i, mPatchesPerEdge - 1); - neighbor_patchp = neighborp->getPatch(i, 0); +// Aurora Sim + //patchp = getPatch(i, mPatchesPerEdge - 1); + //neighbor_patchp = neighborp->getPatch(i, 0); + patchp = getPatch(i + own_offset[0], mPatchesPerEdge - 1); + neighbor_patchp = neighborp->getPatch(i + neighbor_offset[0], 0); +// Aurora Sim patchp->connectNeighbor(neighbor_patchp, direction); neighbor_patchp->connectNeighbor(patchp, gDirOpposite[direction]); @@ -457,19 +572,33 @@ void LLSurface::connectNeighbor(LLSurface *neighborp, U32 direction) } // Do northeast/southwest connections - for (i = 0; i < (S32)mPatchesPerEdge - 1; i++) +// Aurora Sim + //for (i = 0; i < (S32)mPatchesPerEdge - 1; i++) + for (i = 0; i < ppe[0] - 1; i++) +// Aurora Sim { - patchp = getPatch(i, mPatchesPerEdge - 1); - neighbor_patchp = neighborp->getPatch(i+1, 0); +// Aurora Sim + //patchp = getPatch(i, mPatchesPerEdge - 1); + //neighbor_patchp = neighborp->getPatch(i+1, 0); + patchp = getPatch(i + own_offset[0], mPatchesPerEdge - 1); + neighbor_patchp = neighborp->getPatch(i+1 + neighbor_offset[0], 0); +// Aurora Sim patchp->connectNeighbor(neighbor_patchp, NORTHEAST); neighbor_patchp->connectNeighbor(patchp, SOUTHWEST); } // Do southeast/northwest connections - for (i = 1; i < (S32)mPatchesPerEdge; i++) +// Aurora Sim + //for (i = 1; i < (S32)mPatchesPerEdge; i++) + for (i = 1; i < ppe[0]; i++) +// Aurora Sim { - patchp = getPatch(i, mPatchesPerEdge - 1); - neighbor_patchp = neighborp->getPatch(i-1, 0); +// Aurora Sim + //patchp = getPatch(i, mPatchesPerEdge - 1); + //neighbor_patchp = neighborp->getPatch(i-1, 0); + patchp = getPatch(i + own_offset[0], mPatchesPerEdge - 1); + neighbor_patchp = neighborp->getPatch(i-1 + neighbor_offset[0], 0); +// Aurora Sim patchp->connectNeighbor(neighbor_patchp, NORTHWEST); neighbor_patchp->connectNeighbor(patchp, SOUTHEAST); @@ -478,10 +607,17 @@ void LLSurface::connectNeighbor(LLSurface *neighborp, U32 direction) else if (WEST == direction) { // Do east/west connections, first - for (i = 0; i < mPatchesPerEdge; i++) +// Aurora Sim + //for (i = 0; i < mPatchesPerEdge; i++) + for (i = 0; i < ppe[1]; i++) +// Aurora Sim { - patchp = getPatch(0, i); - neighbor_patchp = neighborp->getPatch(mPatchesPerEdge - 1, i); +// Aurora Sim + //patchp = getPatch(0, i); + //neighbor_patchp = neighborp->getPatch(mPatchesPerEdge - 1, i); + patchp = getPatch(0, i + own_offset[1]); + neighbor_patchp = neighborp->getPatch(neighborPatchesPerEdge - 1, i + neighbor_offset[1]); +// Aurora Sim patchp->connectNeighbor(neighbor_patchp, direction); neighbor_patchp->connectNeighbor(patchp, gDirOpposite[direction]); @@ -491,20 +627,34 @@ void LLSurface::connectNeighbor(LLSurface *neighborp, U32 direction) } // Now do northeast/southwest connections - for (i = 1; i < mPatchesPerEdge; i++) +// Aurora Sim + //for (i = 1; i < mPatchesPerEdge; i++) + for (i = 1; i < ppe[1]; i++) +// Aurora Sim { - patchp = getPatch(0, i); - neighbor_patchp = neighborp->getPatch(mPatchesPerEdge - 1, i - 1); +// Aurora Sim + //patchp = getPatch(0, i); + //neighbor_patchp = neighborp->getPatch(mPatchesPerEdge - 1, i - 1); + patchp = getPatch(0, i + own_offset[1]); + neighbor_patchp = neighborp->getPatch(neighborPatchesPerEdge - 1, i - 1 + neighbor_offset[1]); +// Aurora Sim patchp->connectNeighbor(neighbor_patchp, SOUTHWEST); neighbor_patchp->connectNeighbor(patchp, NORTHEAST); } // Now do northwest/southeast connections - for (i = 0; i < mPatchesPerEdge - 1; i++) +// Aurora Sim + //for (i = 0; i < mPatchesPerEdge - 1; i++) + for (i = 0; i < ppe[1] - 1; i++) +// Aurora Sim { - patchp = getPatch(0, i); - neighbor_patchp = neighborp->getPatch(mPatchesPerEdge - 1, i + 1); +// Aurora Sim + //patchp = getPatch(0, i); + //neighbor_patchp = neighborp->getPatch(mPatchesPerEdge - 1, i + 1); + patchp = getPatch(0, i + own_offset[1]); + neighbor_patchp = neighborp->getPatch(neighborPatchesPerEdge - 1, i + 1 + neighbor_offset[1]); +// Aurora Sim patchp->connectNeighbor(neighbor_patchp, NORTHWEST); neighbor_patchp->connectNeighbor(patchp, SOUTHEAST); @@ -513,10 +663,17 @@ void LLSurface::connectNeighbor(LLSurface *neighborp, U32 direction) else if (SOUTH == direction) { // Do north/south connections, first - for (i = 0; i < mPatchesPerEdge; i++) +// Aurora Sim + //for (i = 0; i < mPatchesPerEdge; i++) + for (i = 0; i < ppe[0]; i++) +// Aurora Sim { - patchp = getPatch(i, 0); - neighbor_patchp = neighborp->getPatch(i, mPatchesPerEdge - 1); +// Aurora Sim + //patchp = getPatch(i, 0); + //neighbor_patchp = neighborp->getPatch(i, mPatchesPerEdge - 1); + patchp = getPatch(i + own_offset[0], 0); + neighbor_patchp = neighborp->getPatch(i + neighbor_offset[0], neighborPatchesPerEdge - 1); +// Aurora Sim patchp->connectNeighbor(neighbor_patchp, direction); neighbor_patchp->connectNeighbor(patchp, gDirOpposite[direction]); @@ -526,19 +683,33 @@ void LLSurface::connectNeighbor(LLSurface *neighborp, U32 direction) } // Now do northeast/southwest connections - for (i = 1; i < mPatchesPerEdge; i++) +// Aurora Sim + //for (i = 1; i < mPatchesPerEdge; i++) + for (i = 1; i < ppe[0]; i++) +// Aurora Sim { - patchp = getPatch(i, 0); - neighbor_patchp = neighborp->getPatch(i - 1, mPatchesPerEdge - 1); +// Aurora Sim + //patchp = getPatch(i, 0); + //neighbor_patchp = neighborp->getPatch(i - 1, mPatchesPerEdge - 1); + patchp = getPatch(i + own_offset[0], 0); + neighbor_patchp = neighborp->getPatch(i - 1 + neighbor_offset[0], neighborPatchesPerEdge - 1); +// Aurora Sim patchp->connectNeighbor(neighbor_patchp, SOUTHWEST); neighbor_patchp->connectNeighbor(patchp, NORTHEAST); } // Now do northeast/southwest connections - for (i = 0; i < mPatchesPerEdge - 1; i++) +// Aurora Sim + //for (i = 0; i < mPatchesPerEdge - 1; i++) + for (i = 0; i < ppe[0] - 1; i++) +// Aurora Sim { - patchp = getPatch(i, 0); - neighbor_patchp = neighborp->getPatch(i + 1, mPatchesPerEdge - 1); +// Aurora Sim + //patchp = getPatch(i, 0); + //neighbor_patchp = neighborp->getPatch(i + 1, mPatchesPerEdge - 1); + patchp = getPatch(i + own_offset[0], 0); + neighbor_patchp = neighborp->getPatch(i + 1 + neighbor_offset[0], neighborPatchesPerEdge - 1); +// Aurora Sim patchp->connectNeighbor(neighbor_patchp, SOUTHEAST); neighbor_patchp->connectNeighbor(patchp, NORTHWEST); @@ -700,14 +871,29 @@ void LLSurface::decompressDCTPatch(LLBitPack &bitpack, LLGroupHeader *gopp, BOOL while (1) { - decode_patch_header(bitpack, &ph); +// Aurora Sim + //decode_patch_header(bitpack, &ph); + decode_patch_header(bitpack, &ph, b_large_patch); +// Aurora Sim if (ph.quant_wbits == END_OF_PATCHES) { break; } - i = ph.patchids >> 5; - j = ph.patchids & 0x1F; +// Aurora Sim + //i = ph.patchids >> 5; + //j = ph.patchids & 0x1F; + 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 + } +// Aurora Sim if ((i >= mPatchesPerEdge) || (j >= mPatchesPerEdge)) { @@ -1229,7 +1415,10 @@ BOOL LLSurface::generateWaterTexture(const F32 x, const F32 y, LLPointer raw = new LLImageRaw(tex_width, tex_height, tex_comps); U8 *rawp = raw->getData(); - F32 scale = 256.f * getMetersPerGrid() / (F32)tex_width; +// Aurora Sim + //F32 scale = 256.f * getMetersPerGrid() / (F32)tex_width; + F32 scale = getRegion()->getWidth() * getMetersPerGrid() / (F32)tex_width; +// Aurora Sim F32 scale_inv = 1.f / scale; S32 x_begin, y_begin, x_end, y_end; diff --git a/indra/newview/llsurface.h b/indra/newview/llsurface.h index a693f6943..aedac01a3 100644 --- a/indra/newview/llsurface.h +++ b/indra/newview/llsurface.h @@ -85,6 +85,9 @@ public: void disconnectNeighbor(LLSurface *neighborp); void disconnectAllNeighbors(); +// Aurora Sim + void rebuildWater(); +// Aurora Sim virtual void decompressDCTPatch(LLBitPack &bitpack, LLGroupHeader *gopp, BOOL b_large_patch); virtual void updatePatchVisibilities(LLAgent &agent); diff --git a/indra/newview/llsurfacepatch.cpp b/indra/newview/llsurfacepatch.cpp index 3ebea883c..b85b7b99a 100644 --- a/indra/newview/llsurfacepatch.cpp +++ b/indra/newview/llsurfacepatch.cpp @@ -36,6 +36,7 @@ #include "timing.h" #include "llsky.h" #include "llviewercamera.h" +#include "llregionhandle.h" // Aurora Sim // For getting composition values #include "llviewerregion.h" @@ -231,8 +232,8 @@ void LLSurfacePatch::eval(const U32 x, const U32 y, const U32 stride, LLVector3 const F32 xyScaleInv = (1.f / xyScale)*(0.2222222222f); F32 vec[3] = { - (F32)fmod((F32)(mOriginGlobal.mdV[0] + x)*xyScaleInv, 256.f), - (F32)fmod((F32)(mOriginGlobal.mdV[1] + y)*xyScaleInv, 256.f), + (F32)fmod((F32)(mOriginGlobal.mdV[0] + x)*xyScaleInv, 256.f), // Added (F32) for proper array initialization + (F32)fmod((F32)(mOriginGlobal.mdV[1] + y)*xyScaleInv, 256.f), // Added (F32) for proper array initialization 0.f }; F32 rand_val = llclamp(noise2(vec)* 0.75f + 0.5f, 0.f, 1.f); @@ -249,18 +250,33 @@ void LLSurfacePatch::calcNormal(const U32 x, const U32 y, const U32 stride) const F32 mpg = mSurfacep->getMetersPerGrid() * stride; - S32 poffsets[2][2][2]; +// Aurora Sim + //S32 poffsets[2][2][2]; + S32 poffsets[2][2][3]; +// Aurora Sim poffsets[0][0][0] = x - stride; poffsets[0][0][1] = y - stride; +// Aurora Sim + poffsets[0][0][2] = surface_stride; +// Aurora Sim poffsets[0][1][0] = x - stride; poffsets[0][1][1] = y + stride; +// Aurora Sim + poffsets[0][1][2] = surface_stride; +// Aurora Sim poffsets[1][0][0] = x + stride; poffsets[1][0][1] = y - stride; +// Aurora Sim + poffsets[1][0][2] = surface_stride; +// Aurora Sim poffsets[1][1][0] = x + stride; poffsets[1][1][1] = y + stride; +// Aurora Sim + poffsets[1][1][2] = surface_stride; +// Aurora Sim const LLSurfacePatch *ppatches[2][2]; @@ -284,8 +300,11 @@ void LLSurfacePatch::calcNormal(const U32 x, const U32 y, const U32 stride) } else { - poffsets[i][j][0] += patch_width; +// Aurora Sim ppatches[i][j] = ppatches[i][j]->getNeighborPatch(WEST); + poffsets[i][j][0] += patch_width; + poffsets[i][j][2] = ppatches[i][j]->getSurface()->getGridsPerEdge(); +// Aurora Sim } } if (poffsets[i][j][1] < 0) @@ -296,8 +315,11 @@ void LLSurfacePatch::calcNormal(const U32 x, const U32 y, const U32 stride) } else { - poffsets[i][j][1] += patch_width; +// Aurora Sim ppatches[i][j] = ppatches[i][j]->getNeighborPatch(SOUTH); + poffsets[i][j][1] += patch_width; + poffsets[i][j][2] = ppatches[i][j]->getSurface()->getGridsPerEdge(); +// CR> Aurora Sim } } if (poffsets[i][j][0] >= (S32)patch_width) @@ -308,8 +330,11 @@ void LLSurfacePatch::calcNormal(const U32 x, const U32 y, const U32 stride) } else { - poffsets[i][j][0] -= patch_width; +// Aurora Sim ppatches[i][j] = ppatches[i][j]->getNeighborPatch(EAST); + poffsets[i][j][0] -= patch_width; + poffsets[i][j][2] = ppatches[i][j]->getSurface()->getGridsPerEdge(); +// Aurora Sim } } if (poffsets[i][j][1] >= (S32)patch_width) @@ -320,8 +345,11 @@ void LLSurfacePatch::calcNormal(const U32 x, const U32 y, const U32 stride) } else { - poffsets[i][j][1] -= patch_width; +// Aurora Sim ppatches[i][j] = ppatches[i][j]->getNeighborPatch(NORTH); + poffsets[i][j][1] -= patch_width; + poffsets[i][j][2] = ppatches[i][j]->getSurface()->getGridsPerEdge(); +// Aurora Sim } } } @@ -330,19 +358,31 @@ void LLSurfacePatch::calcNormal(const U32 x, const U32 y, const U32 stride) LLVector3 p00(-mpg,-mpg, *(ppatches[0][0]->mDataZ + poffsets[0][0][0] - + poffsets[0][0][1]*surface_stride)); +// Aurora Sim + //+ poffsets[0][0][1]*surface_stride)); + + poffsets[0][0][1]*poffsets[0][0][2])); +// Aurora Sim LLVector3 p01(-mpg,+mpg, *(ppatches[0][1]->mDataZ + poffsets[0][1][0] - + poffsets[0][1][1]*surface_stride)); +// Aurora Sim + //+ poffsets[0][1][1]*surface_stride)); + + poffsets[0][1][1]*poffsets[0][1][2])); +// Aurora Sim LLVector3 p10(+mpg,-mpg, *(ppatches[1][0]->mDataZ + poffsets[1][0][0] - + poffsets[1][0][1]*surface_stride)); +// Aurora Sim + //+ poffsets[1][0][1]*surface_stride)); + + poffsets[1][0][1]*poffsets[1][0][2])); +// Aurora Sim LLVector3 p11(+mpg,+mpg, *(ppatches[1][1]->mDataZ + poffsets[1][1][0] - + poffsets[1][1][1]*surface_stride)); +// Aurora Sim + //+ poffsets[1][1][1]*surface_stride)); + + poffsets[1][1][1]*poffsets[1][1][2])); +// Aurora Sim LLVector3 c1 = p11 - p00; LLVector3 c2 = p01 - p10; @@ -480,6 +520,18 @@ void LLSurfacePatch::updateNormals() // update the north edge if (mNormalsInvalid[NORTHEAST] || mNormalsInvalid[NORTH] || mNormalsInvalid[NORTHWEST]) { +// Aurora Sim + /* + if(!getNeighborPatch(EAST) && getNeighborPatch(NORTHEAST)) + { + if(getNeighborPatch(NORTHEAST)->getHasReceivedData()) + { + *(getNeighborPatch(NORTHEAST)->mDataZ) = 100.0f; + } + } + */ +// Aurora Sim + for (i = 0; i <= grids_per_patch_edge; i++) { calcNormal(i, grids_per_patch_edge, 2); @@ -493,6 +545,16 @@ void LLSurfacePatch::updateNormals() // update the west edge if (mNormalsInvalid[NORTHWEST] || mNormalsInvalid[WEST] || mNormalsInvalid[SOUTHWEST]) { +// Aurora Sim + if(!getNeighborPatch(NORTH) && getNeighborPatch(NORTHWEST)) + { + if(getNeighborPatch(NORTHWEST)->getHasReceivedData()) + { + *(mDataZ + grids_per_patch_edge*grids_per_edge) = *(getNeighborPatch(NORTHWEST)->mDataZ + grids_per_patch_edge); + } + } +// Aurora Sim + for (j = 0; j < grids_per_patch_edge; j++) { calcNormal(0, j, 2); @@ -504,6 +566,17 @@ void LLSurfacePatch::updateNormals() // update the south edge if (mNormalsInvalid[SOUTHWEST] || mNormalsInvalid[SOUTH] || mNormalsInvalid[SOUTHEAST]) { +// Aurora Sim + if(!getNeighborPatch(EAST) && getNeighborPatch(SOUTHEAST)) + { + if(getNeighborPatch(SOUTHEAST)->getHasReceivedData()) + { + *(mDataZ + grids_per_patch_edge) = + *(getNeighborPatch(SOUTHEAST)->mDataZ + grids_per_patch_edge * getNeighborPatch(SOUTHEAST)->getSurface()->getGridsPerEdge()); + } + } +// Aurora Sim + for (i = 0; i < grids_per_patch_edge; i++) { calcNormal(i, 0, 2); @@ -532,7 +605,10 @@ void LLSurfacePatch::updateNormals() { // East, but not north. Pull from your east neighbor's northwest point. *(mDataZ + grids_per_patch_edge + grids_per_patch_edge*grids_per_edge) = - *(getNeighborPatch(EAST)->mDataZ + (grids_per_patch_edge - 1)*grids_per_edge); +// Aurora Sim + //*(getNeighborPatch(EAST)->mDataZ + (grids_per_patch_edge - 1)*grids_per_edge); + *(getNeighborPatch(EAST)->mDataZ + (getNeighborPatch(EAST)->getSurface()->getGridsPerPatchEdge() - 1)*getNeighborPatch(EAST)->getSurface()->getGridsPerEdge()); +// Aurora Sim } else { @@ -557,7 +633,10 @@ void LLSurfacePatch::updateNormals() { // North, but not east. Pull from your north neighbor's southeast corner. *(mDataZ + grids_per_patch_edge + grids_per_patch_edge*grids_per_edge) = - *(getNeighborPatch(NORTH)->mDataZ + (grids_per_patch_edge - 1)); +// Aurora Sim + //*(getNeighborPatch(NORTH)->mDataZ + (grids_per_patch_edge - 1)); + *(getNeighborPatch(NORTH)->mDataZ + (getNeighborPatch(NORTH)->getSurface()->getGridsPerPatchEdge() - 1)); +// Aurora Sim } else { @@ -574,8 +653,25 @@ void LLSurfacePatch::updateNormals() && (!getNeighborPatch(EAST) || (getNeighborPatch(EAST)->mSurfacep != mSurfacep))) { +// Aurora Sim + U32 own_xpos, own_ypos, neighbor_xpos, neighbor_ypos; + S32 own_offset = 0, neighbor_offset = 0; + from_region_handle(mSurfacep->getRegion()->getHandle(), &own_xpos, &own_ypos); + from_region_handle(getNeighborPatch(NORTHEAST)->mSurfacep->getRegion()->getHandle(), &neighbor_xpos, &neighbor_ypos); + if(own_ypos >= neighbor_ypos) { + neighbor_offset = own_ypos - neighbor_ypos; + } + else { + own_offset = neighbor_ypos - own_ypos; + } +// Aurora Sim + *(mDataZ + grids_per_patch_edge + grids_per_patch_edge*grids_per_edge) = - *(getNeighborPatch(NORTHEAST)->mDataZ); + *(getNeighborPatch(NORTHEAST)->mDataZ + +// Aurora Sim + (grids_per_edge + neighbor_offset - own_offset - 1) * + getNeighborPatch(NORTHEAST)->getSurface()->getGridsPerEdge() ); +// Aurora Sim } } else @@ -618,8 +714,12 @@ void LLSurfacePatch::updateEastEdge() { U32 grids_per_patch_edge = mSurfacep->getGridsPerPatchEdge(); U32 grids_per_edge = mSurfacep->getGridsPerEdge(); +// Aurora Sim + U32 grids_per_edge_east = grids_per_edge; - U32 j, k; + //U32 j, k; + U32 j, k, h; +// Aurora Sim F32 *west_surface, *east_surface; if (!getNeighborPatch(EAST)) @@ -631,6 +731,9 @@ void LLSurfacePatch::updateEastEdge() { west_surface = mDataZ + grids_per_patch_edge; east_surface = getNeighborPatch(EAST)->mDataZ; +// Aurora Sim + grids_per_edge_east = getNeighborPatch(EAST)->getSurface()->getGridsPerEdge(); +// Aurora Sim } else { @@ -642,7 +745,11 @@ void LLSurfacePatch::updateEastEdge() for (j=0; j < grids_per_patch_edge; j++) { k = j * grids_per_edge; - *(west_surface + k) = *(east_surface + k); // update buffer Z +// Aurora Sim + h = j * grids_per_edge_east; + *(west_surface + k) = *(east_surface + h); // update buffer Z + //*(west_surface + k) = *(east_surface + k); // update buffer Z +// Aurora Sim } } @@ -671,13 +778,12 @@ void LLSurfacePatch::updateNorthEdge() } // Update patchp's north edge ... - for (i=0; igetU64Fast(_PREHASH_Info, _PREHASH_RegionHandle, region_handle); U32 teleport_flags; msg->getU32Fast(_PREHASH_Info, _PREHASH_TeleportFlags, teleport_flags); - + +// Aurora Sim + 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; + } +// Aurora Sim std::string seedCap; msg->getStringFast(_PREHASH_Info, _PREHASH_SeedCapability, seedCap); @@ -4429,7 +4443,10 @@ 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); +// Aurora Sim + //LLViewerRegion* regionp = LLWorld::getInstance()->addRegion(region_handle, sim_host); + LLViewerRegion* regionp = LLWorld::getInstance()->addRegion(region_handle, sim_host, region_size_x, region_size_y); +// Aurora Sim /* // send camera update to new region @@ -4752,9 +4769,26 @@ void process_crossed_region(LLMessageSystem* msg, void**) std::string seedCap; msg->getStringFast(_PREHASH_RegionData, _PREHASH_SeedCapability, seedCap); +// Aurora Sim + 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; + } +// Aurora Sim send_complete_agent_movement(sim_host); - LLViewerRegion* regionp = LLWorld::getInstance()->addRegion(region_handle, sim_host); +// Aurora Sim + //LLViewerRegion* regionp = LLWorld::getInstance()->addRegion(region_handle, sim_host); + LLViewerRegion* regionp = LLWorld::getInstance()->addRegion(region_handle, sim_host, region_size_x, region_size_y); +// Aurora Sim regionp->setSeedCapability(seedCap); } diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp index 6429b89c7..234ebab2e 100644 --- a/indra/newview/llviewerobject.cpp +++ b/indra/newview/llviewerobject.cpp @@ -962,7 +962,10 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys, U16 valswizzle[4]; #endif U16 *val; - const F32 size = LLWorld::getInstance()->getRegionWidthInMeters(); +// Aurora Sim + //const F32 size = LLWorld::getInstance()->getRegionWidthInMeters(); + const F32 size = mRegionp->getWidth(); +// Aurora Sim const F32 MAX_HEIGHT = LLWorld::getInstance()->getRegionMaxHeight(); const F32 MIN_HEIGHT = LLWorld::getInstance()->getRegionMinHeight(); S32 length; diff --git a/indra/newview/llviewerparcelmgr.cpp b/indra/newview/llviewerparcelmgr.cpp index 5b7c7f274..51aeffff3 100644 --- a/indra/newview/llviewerparcelmgr.cpp +++ b/indra/newview/llviewerparcelmgr.cpp @@ -145,7 +145,13 @@ LLViewerParcelMgr::LLViewerParcelMgr() mHoverParcel = new LLParcel(); mCollisionParcel = new LLParcel(); - mParcelsPerEdge = S32( REGION_WIDTH_METERS / PARCEL_GRID_STEP_METERS ); +// Aurora Sim + // Max region size on Aurora-Sim, 8192, just creating larger buffers, it will still work on Second Life and Opensim + F32 region_size = 8192.f; + + mParcelsPerEdge = S32( region_size / PARCEL_GRID_STEP_METERS ); + //mParcelsPerEdge = S32( REGION_WIDTH_METERS / PARCEL_GRID_STEP_METERS ); +// Aurora Sim mHighlightSegments = new U8[(mParcelsPerEdge+1)*(mParcelsPerEdge+1)]; resetSegments(mHighlightSegments); @@ -168,9 +174,19 @@ LLViewerParcelMgr::LLViewerParcelMgr() mAgentParcelOverlay[i] = 0; } +// Aurora Sim + mParcelsPerEdge = S32( REGION_WIDTH_METERS / PARCEL_GRID_STEP_METERS ); +// Aurora Sim + mTeleportInProgress = TRUE; // the initial parcel update is treated like teleport } +// Aurora Sim +void LLViewerParcelMgr::init(F32 region_size) +{ + mParcelsPerEdge = S32( region_size / PARCEL_GRID_STEP_METERS ); +} +// Aurora Sim LLViewerParcelMgr::~LLViewerParcelMgr() { @@ -450,9 +466,15 @@ LLParcelSelectionHandle LLViewerParcelMgr::selectParcelInRectangle() void LLViewerParcelMgr::selectCollisionParcel() { // BUG: Claim to be in the agent's region - mWestSouth = gAgent.getRegion()->getOriginGlobal(); +// Aurora Sim + //mWestSouth = gAgent.getRegion()->getOriginGlobal(); + //mEastNorth = mWestSouth; + //mEastNorth += LLVector3d(PARCEL_GRID_STEP_METERS, PARCEL_GRID_STEP_METERS, 0.0); + 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); +// Aurora Sim // BUG: must be in the sim you are in LLMessageSystem *msg = gMessageSystem; @@ -1410,8 +1432,11 @@ 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; +// Aurora Sim + //S32 parcels_per_edge = LLViewerParcelMgr::getInstance()->mParcelsPerEdge; + //S32 expected_size = parcels_per_edge * parcels_per_edge / PARCEL_OVERLAY_CHUNKS; + S32 expected_size = 1024; +// Aurora Sim if (packed_overlay_size != expected_size) { llwarns << "Got parcel overlay size " << packed_overlay_size @@ -1474,6 +1499,15 @@ void LLViewerParcelMgr::processParcelProperties(LLMessageSystem *msg, void **use S32 other_clean_time = 0; LLViewerParcelMgr& parcel_mgr = LLViewerParcelMgr::instance(); +// Aurora Sim + 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 ); + } +// Aurora Sim msg->getS32Fast(_PREHASH_ParcelData, _PREHASH_RequestResult, request_result ); msg->getS32Fast(_PREHASH_ParcelData, _PREHASH_SequenceID, sequence_id ); diff --git a/indra/newview/llviewerparcelmgr.h b/indra/newview/llviewerparcelmgr.h index 5ae44e2d0..022465a97 100644 --- a/indra/newview/llviewerparcelmgr.h +++ b/indra/newview/llviewerparcelmgr.h @@ -89,6 +89,9 @@ public: LLViewerParcelMgr(); ~LLViewerParcelMgr(); +// Aurora Sim + void init(F32 region_size); +// Aurora Sim static void cleanupGlobals(); BOOL selectionEmpty() const; diff --git a/indra/newview/llviewerparceloverlay.cpp b/indra/newview/llviewerparceloverlay.cpp index 42bf3100c..6eb83a9f7 100644 --- a/indra/newview/llviewerparceloverlay.cpp +++ b/indra/newview/llviewerparceloverlay.cpp @@ -59,6 +59,9 @@ 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 ) ), +// Aurora Sim + mRegionSize(S32(region_width_meters)), +// Aurora Sim mDirty( FALSE ), mTimeSinceLastUpdate(), mOverlayTextureIdx(-1), @@ -413,7 +416,12 @@ void LLViewerParcelOverlay::uncompressLandOverlay(S32 chunk, U8 *packed_overlay) { // Unpack the message data into the ownership array S32 size = mParcelGridsPerEdge * mParcelGridsPerEdge; - S32 chunk_size = size / PARCEL_OVERLAY_CHUNKS; + +// Aurora Sim + //S32 chunk_size = size / PARCEL_OVERLAY_CHUNKS; + S32 mParcelOverLayChunks = mRegionSize * mRegionSize / (128 * 128); + S32 chunk_size = size / mParcelOverLayChunks; +// Aurora Sim memcpy(mOwnership + chunk*chunk_size, packed_overlay, chunk_size); /*Flawfinder: ignore*/ diff --git a/indra/newview/llviewerparceloverlay.h b/indra/newview/llviewerparceloverlay.h index 794a485e6..d53a4c15f 100644 --- a/indra/newview/llviewerparceloverlay.h +++ b/indra/newview/llviewerparceloverlay.h @@ -109,6 +109,9 @@ private: LLViewerRegion* mRegion; S32 mParcelGridsPerEdge; +// Aurora Sim + S32 mRegionSize; +// Aurora Sim LLPointer mTexture; LLPointer mImageRaw; diff --git a/indra/newview/llviewerregion.cpp b/indra/newview/llviewerregion.cpp index 50865c610..761de56be 100644 --- a/indra/newview/llviewerregion.cpp +++ b/indra/newview/llviewerregion.cpp @@ -78,6 +78,7 @@ #include "llviewercontrol.h" #include "llsdserialize.h" +#include "llviewerparcelmgr.h" //Aurora Sim #ifdef LL_WINDOWS #pragma warning(disable:4355) #endif @@ -309,9 +310,12 @@ LLViewerRegion::LLViewerRegion(const U64 &handle, mReleaseNotesRequested(FALSE), mCapabilitiesReceived(false), mFeaturesReceived(false), - mGamingFlags(0) + mGamingFlags(0), +// Aurora Sim + mWidth(region_width_meters) { - mWidth = region_width_meters; + // Moved this up... -> mWidth = region_width_meters; +// mImpl->mOriginGlobal = from_region_handle(handle); updateRenderMatrix(); @@ -321,7 +325,10 @@ LLViewerRegion::LLViewerRegion(const U64 &handle, mImpl->mCompositionp = new LLVLComposition(mImpl->mLandp, grids_per_region_edge, - region_width_meters / grids_per_region_edge); +// Aurora Sim + //region_width_meters / grids_per_region_edge); + mWidth / grids_per_region_edge); +// Aurora Sim mImpl->mCompositionp->setSurface(mImpl->mLandp); // Create the surfaces @@ -331,7 +338,11 @@ LLViewerRegion::LLViewerRegion(const U64 &handle, mImpl->mOriginGlobal, mWidth); - mParcelOverlay = new LLViewerParcelOverlay(this, region_width_meters); +// Aurora Sim + //mParcelOverlay = new LLViewerParcelOverlay(this, region_width_meters); + mParcelOverlay = new LLViewerParcelOverlay(this, mWidth); + LLViewerParcelMgr::getInstance()->init(mWidth); +// Aurora Sim setOriginGlobal(from_region_handle(handle)); calculateCenterGlobal(); @@ -493,6 +504,13 @@ void LLViewerRegion::setWaterHeight(F32 water_level) mImpl->mLandp->setWaterHeight(water_level); } +// Aurora Sim +void LLViewerRegion::rebuildWater() +{ + mImpl->mLandp->rebuildWater(); +} +// Aurora Sim + F32 LLViewerRegion::getWaterHeight() const { return mImpl->mLandp->getWaterHeight(); @@ -838,11 +856,20 @@ LLVLComposition * LLViewerRegion::getComposition() const F32 LLViewerRegion::getCompositionXY(const S32 x, const S32 y) const { - if (x >= 256) +// Aurora Sim + //if (x >= 256) + if (x >= mWidth) +// Aurora Sim { - if (y >= 256) +// Aurora Sim + //if (y >= 256) + if (y >= mWidth) +// Aurora Sim { - LLVector3d center = getCenterGlobal() + LLVector3d(256.f, 256.f, 0.f); +// Aurora Sim + //LLVector3d center = getCenterGlobal() + LLVector3d(256.f, 256.f, 0.f); + LLVector3d center = getCenterGlobal() + LLVector3d(mWidth, mWidth, 0.f); +// Aurora Sim LLViewerRegion *regionp = LLWorld::getInstance()->getRegionFromPosGlobal(center); if (regionp) { @@ -851,8 +878,12 @@ F32 LLViewerRegion::getCompositionXY(const S32 x, const S32 y) const // If we're attempting to blend, then we want to make the fractional part of // this region match the fractional of the adjacent. For now, just minimize // the delta. - F32 our_comp = getComposition()->getValueScaled(255, 255); - F32 adj_comp = regionp->getComposition()->getValueScaled(x - 256.f, y - 256.f); +// Aurora Sim + //F32 our_comp = getComposition()->getValueScaled(255, 255); + //F32 adj_comp = regionp->getComposition()->getValueScaled(x - 256.f, y - 256.f); + F32 our_comp = getComposition()->getValueScaled(mWidth-1.f, mWidth-1.f); + F32 adj_comp = regionp->getComposition()->getValueScaled(x - regionp->getWidth(), y - regionp->getWidth()); +// Aurora Sim while (llabs(our_comp - adj_comp) >= 1.f) { if (our_comp > adj_comp) @@ -869,7 +900,10 @@ F32 LLViewerRegion::getCompositionXY(const S32 x, const S32 y) const } else { - LLVector3d center = getCenterGlobal() + LLVector3d(256.f, 0, 0.f); +// Aurora Sim + //LLVector3d center = getCenterGlobal() + LLVector3d(256.f, 0, 0.f); + LLVector3d center = getCenterGlobal() + LLVector3d(mWidth, 0.f, 0.f); +// Aurora Sim LLViewerRegion *regionp = LLWorld::getInstance()->getRegionFromPosGlobal(center); if (regionp) { @@ -878,8 +912,12 @@ F32 LLViewerRegion::getCompositionXY(const S32 x, const S32 y) const // If we're attempting to blend, then we want to make the fractional part of // this region match the fractional of the adjacent. For now, just minimize // the delta. - F32 our_comp = getComposition()->getValueScaled(255.f, (F32)y); - F32 adj_comp = regionp->getComposition()->getValueScaled(x - 256.f, (F32)y); +// Aurora Sim + //F32 our_comp = getComposition()->getValueScaled(255.f, (F32)y); + //F32 adj_comp = regionp->getComposition()->getValueScaled(x - 256.f, (F32)y); + F32 our_comp = getComposition()->getValueScaled(mWidth-1.f, (F32)y); + F32 adj_comp = regionp->getComposition()->getValueScaled(x - regionp->getWidth(), (F32)y); +// Aurora Sim while (llabs(our_comp - adj_comp) >= 1.f) { if (our_comp > adj_comp) @@ -895,9 +933,15 @@ F32 LLViewerRegion::getCompositionXY(const S32 x, const S32 y) const } } } - else if (y >= 256) +// Aurora Sim + //else if (y >= 256) + else if (y >= mWidth) +// Aurora Sim { - LLVector3d center = getCenterGlobal() + LLVector3d(0.f, 256.f, 0.f); +// Aurora Sim + //LLVector3d center = getCenterGlobal() + LLVector3d(0.f, 256.f, 0.f); + LLVector3d center = getCenterGlobal() + LLVector3d(0.f, mWidth, 0.f); +// Aurora Sim LLViewerRegion *regionp = LLWorld::getInstance()->getRegionFromPosGlobal(center); if (regionp) { @@ -906,8 +950,12 @@ F32 LLViewerRegion::getCompositionXY(const S32 x, const S32 y) const // If we're attempting to blend, then we want to make the fractional part of // this region match the fractional of the adjacent. For now, just minimize // the delta. - F32 our_comp = getComposition()->getValueScaled((F32)x, 255.f); - F32 adj_comp = regionp->getComposition()->getValueScaled((F32)x, y - 256.f); +// Aurora Sim + //F32 our_comp = getComposition()->getValueScaled((F32)x, 255.f); + //F32 adj_comp = regionp->getComposition()->getValueScaled((F32)x, y - 256.f); + F32 our_comp = getComposition()->getValueScaled((F32)x, mWidth-1.f); + F32 adj_comp = regionp->getComposition()->getValueScaled((F32)x, y - regionp->getWidth()); +// Aurora Sim while (llabs(our_comp - adj_comp) >= 1.f) { if (our_comp > adj_comp) @@ -1651,6 +1699,9 @@ void LLViewerRegionImpl::buildCapabilityNames(LLSD& capabilityNames) capabilityNames.append("CustomMenuAction"); capabilityNames.append("DispatchRegionInfo"); capabilityNames.append("EnvironmentSettings"); +// Aurora Sim + capabilityNames.append("DispatchOpenRegionSettings"); +// Aurora Sim capabilityNames.append("EstateChangeInfo"); capabilityNames.append("EventQueueGet"); capabilityNames.append("FetchLib2"); diff --git a/indra/newview/llviewerregion.h b/indra/newview/llviewerregion.h index 6b0e73b49..460bc34c3 100644 --- a/indra/newview/llviewerregion.h +++ b/indra/newview/llviewerregion.h @@ -147,6 +147,9 @@ public: void setWaterHeight(F32 water_level); F32 getWaterHeight() const; +// Aurora Sim + void rebuildWater(); +// Aurora Sim BOOL isVoiceEnabled() const; diff --git a/indra/newview/llvlcomposition.cpp b/indra/newview/llvlcomposition.cpp index 8954a2da2..94ae918be 100644 --- a/indra/newview/llvlcomposition.cpp +++ b/indra/newview/llvlcomposition.cpp @@ -164,7 +164,10 @@ 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/mWidth; +// Aurora Sim + //const F32 inv_width = 1.f/mWidth; + const F32 inv_width = 1.f/(F32)mWidth; +// Aurora Sim // OK, for now, just have the composition value equal the height at the point. for (S32 j = y_begin; j < y_end; j++) diff --git a/indra/newview/llvlmanager.cpp b/indra/newview/llvlmanager.cpp index 88afc9cc3..43b42f0ec 100644 --- a/indra/newview/llvlmanager.cpp +++ b/indra/newview/llvlmanager.cpp @@ -44,11 +44,6 @@ LLVLManager gVLManager; -// Extended land layer for Aurora Sim -const char AURORA_LAND_LAYER_CODE = 'M'; -const char AURORA_WIND_LAYER_CODE = '9'; -const char AURORA_CLOUD_LAYER_CODE = ':'; - LLVLManager::~LLVLManager() { S32 i; @@ -61,18 +56,33 @@ LLVLManager::~LLVLManager() void LLVLManager::addLayerData(LLVLData *vl_datap, const S32 mesg_size) { +// Aurora Sim + //if (LAND_LAYER_CODE == vl_datap->mType) if (LAND_LAYER_CODE == vl_datap->mType || AURORA_LAND_LAYER_CODE == vl_datap->mType) +// Aurora Sim { mLandBits += mesg_size * 8; } +// Aurora Sim + //else if (WIND_LAYER_CODE == vl_datap->mType) else if (WIND_LAYER_CODE == vl_datap->mType || AURORA_WIND_LAYER_CODE == vl_datap->mType) +// Aurora Sim { mWindBits += mesg_size * 8; } +// Aurora Sim + //else if (CLOUD_LAYER_CODE == vl_datap->mType) else if (CLOUD_LAYER_CODE == vl_datap->mType || AURORA_CLOUD_LAYER_CODE == vl_datap->mType) +// Aurora Sim { mCloudBits += mesg_size * 8; } +// Aurora Sim + else if (WATER_LAYER_CODE == vl_datap->mType || AURORA_CLOUD_LAYER_CODE == vl_datap->mType) + { + mWaterBits += mesg_size * 8; + } +// Aurora Sim else { llerrs << "Unknown layer type!" << (S32)vl_datap->mType << llendl; @@ -98,11 +108,14 @@ void LLVLManager::unpackData(const S32 num_packets) { datap->mRegionp->getLand().decompressDCTPatch(bit_pack, &goph, FALSE); } +// Aurora Sim else if (AURORA_LAND_LAYER_CODE == datap->mType) { datap->mRegionp->getLand().decompressDCTPatch(bit_pack, &goph, TRUE); } + //else if (WIND_LAYER_CODE == datap->mType) else if (WIND_LAYER_CODE == datap->mType || AURORA_WIND_LAYER_CODE == datap->mType) +// Aurora Sim { datap->mRegionp->mWind.decompress(bit_pack, &goph); diff --git a/indra/newview/llvlmanager.h b/indra/newview/llvlmanager.h index 9d64d6f24..6bf495e62 100644 --- a/indra/newview/llvlmanager.h +++ b/indra/newview/llvlmanager.h @@ -65,6 +65,9 @@ protected: U32 mLandBits; U32 mWindBits; U32 mCloudBits; +// Aurora Sim + U32 mWaterBits; +// Aurora Sim }; class LLVLData diff --git a/indra/newview/llvowater.cpp b/indra/newview/llvowater.cpp index 049a89d1a..c4e73d90b 100644 --- a/indra/newview/llvowater.cpp +++ b/indra/newview/llvowater.cpp @@ -74,7 +74,10 @@ LLVOWater::LLVOWater(const LLUUID &id, { // Terrain must draw during selection passes so it can block objects behind it. mbCanSelect = FALSE; - setScale(LLVector3(256.f, 256.f, 0.f)); // Hack for setting scale for bounding boxes/visibility. +// Aurora Sim + //setScale(LLVector3(256.f, 256.f, 0.f)); // Hack for setting scale for bounding boxes/visibility. + setScale(LLVector3(mRegionp->getWidth(), mRegionp->getWidth(), 0.f)); +// Aurora Sim mUseTexture = TRUE; mIsEdgePatch = FALSE; diff --git a/indra/newview/llwind.cpp b/indra/newview/llwind.cpp index 2b0f0d969..a6679cf2d 100644 --- a/indra/newview/llwind.cpp +++ b/indra/newview/llwind.cpp @@ -54,6 +54,9 @@ const F32 CLOUD_DIVERGENCE_COEF = 0.5f; +// Aurora Sim +#include "llviewerregion.h" +// Aurora Sim ////////////////////////////////////////////////////////////////////// // Construction/Destruction @@ -121,12 +124,18 @@ void LLWind::decompress(LLBitPack &bitpack, LLGroupHeader *group_headerp) set_group_of_patch_header(group_headerp); // X component - decode_patch_header(bitpack, &patch_header); +// Aurora Sim + //decode_patch_header(bitpack, &patch_header); + decode_patch_header(bitpack, &patch_header, FALSE); +// Aurora Sim decode_patch(bitpack, buffer); decompress_patch(mVelX, buffer, &patch_header); // Y component - decode_patch_header(bitpack, &patch_header); +// Aurora Sim + //decode_patch_header(bitpack, &patch_header); + decode_patch_header(bitpack, &patch_header, FALSE); +// Aurora Sim decode_patch(bitpack, buffer); decompress_patch(mVelY, buffer, &patch_header); @@ -254,7 +263,10 @@ LLVector3 LLWind::getVelocity(const LLVector3 &pos_region) LLVector3 pos_clamped_region(pos_region); - F32 region_width_meters = LLWorld::getInstance()->getRegionWidthInMeters(); +// Aurora Sim + //F32 region_width_meters = LLWorld::getInstance()->getRegionWidthInMeters(); + F32 region_width_meters = gAgent.getRegion()->getWidth(); +// Aurora Sim if (pos_clamped_region.mV[VX] < 0.f) { diff --git a/indra/newview/llworld.cpp b/indra/newview/llworld.cpp index 5c8c8f4a8..a0498781d 100644 --- a/indra/newview/llworld.cpp +++ b/indra/newview/llworld.cpp @@ -80,13 +80,18 @@ const S32 MAX_NUMBER_OF_CLOUDS = 750; const S32 WORLD_PATCH_SIZE = 16; extern LLColor4U MAX_WATER_COLOR; - -const U32 LLWorld::mWidth = 256; +// Aurora Sim +//const U32 LLWorld::mWidth = 256; +U32 LLWorld::mWidth = 256; +// Aurora Sim // meters/point, therefore mWidth * mScale = meters per edge const F32 LLWorld::mScale = 1.f; -const F32 LLWorld::mWidthInMeters = mWidth * mScale; +// Aurora Sim +//const F32 LLWorld::mWidthInMeters = mWidth * mScale; +F32 LLWorld::mWidthInMeters = mWidth * mScale; +// Aurora Sim // // Functions @@ -147,7 +152,7 @@ void LLWorld::destroyClass() } -LLViewerRegion* LLWorld::addRegion(const U64 ®ion_handle, const LLHost &host) +LLViewerRegion* LLWorld::addRegion(const U64 ®ion_handle, const LLHost &host, const U32 ®ion_size_x, const U32 ®ion_size_y) { llinfos << "Add region with handle: " << region_handle << " on host " << host << llendl; LLViewerRegion *regionp = getRegionFromHandle(region_handle); @@ -179,9 +184,17 @@ LLViewerRegion* LLWorld::addRegion(const U64 ®ion_handle, const LLHost &host) U32 iindex = 0; U32 jindex = 0; +// Aurora Sim + mWidth = region_size_x; //MegaRegion + mWidthInMeters = mWidth * mScale; //MegaRegion +// Aurora Sim from_region_handle(region_handle, &iindex, &jindex); - S32 x = (S32)(iindex/mWidth); - S32 y = (S32)(jindex/mWidth); +// Aurora Sim + //S32 x = (S32)(iindex/mWidth); + //S32 y = (S32)(jindex/mWidth); + S32 x = (S32)(iindex/256); //MegaRegion + S32 y = (S32)(jindex/256); //MegaRegion +// Aurora Sim llinfos << "Adding new region (" << x << ":" << y << ")" << llendl; llinfos << "Host: " << host << llendl; @@ -223,21 +236,48 @@ LLViewerRegion* LLWorld::addRegion(const U64 ®ion_handle, const LLHost &host) F32 width = getRegionWidthInMeters(); LLViewerRegion *neighborp; +// Aurora Sim + LLViewerRegion *last_neighborp; +// Aurora Sim from_region_handle(region_handle, ®ion_x, ®ion_y); // Iterate through all directions, and connect neighbors if there. S32 dir; for (dir = 0; dir < 8; dir++) { +// Aurora Sim + last_neighborp = NULL; +// Aurora Sim adj_x = region_x + width * gDirAxes[dir][0]; adj_y = region_y + width * gDirAxes[dir][1]; - to_region_handle(adj_x, adj_y, &adj_handle); +// Aurora Sim + //to_region_handle(adj_x, adj_y, &adj_handle); + if(gDirAxes[dir][0] < 0) adj_x = region_x - WORLD_PATCH_SIZE; + if(gDirAxes[dir][1] < 0) adj_y = region_y - WORLD_PATCH_SIZE; - neighborp = getRegionFromHandle(adj_handle); - if (neighborp) + for(S32 offset = 0; offset < width; offset += WORLD_PATCH_SIZE) { - //llinfos << "Connecting " << region_x << ":" << region_y << " -> " << adj_x << ":" << adj_y << llendl; - regionp->connectNeighbor(neighborp, dir); + to_region_handle(adj_x, adj_y, &adj_handle); + neighborp = getRegionFromHandle(adj_handle); + + if (neighborp && last_neighborp != neighborp) + { + //llinfos << "Connecting " << region_x << ":" << region_y << " -> " << adj_x << ":" << adj_y << " dir:" << dir << llendl; + regionp->connectNeighbor(neighborp, dir); + last_neighborp = neighborp; + } + + if(dir == NORTHEAST || + dir == NORTHWEST || + dir == SOUTHWEST || + dir == SOUTHEAST) + { + break; + } + + if(dir == NORTH || dir == SOUTH) adj_x += WORLD_PATCH_SIZE; + if(dir == EAST || dir == WEST) adj_y += WORLD_PATCH_SIZE; +// Aurora Sim } } @@ -409,11 +449,24 @@ LLVector3d LLWorld::clipToVisibleRegions(const LLVector3d &start_pos, const LLVe LLViewerRegion* LLWorld::getRegionFromHandle(const U64 &handle) { +// Aurora Sim + U32 x, y; + from_region_handle(handle, &x, &y); +// Aurora Sim + for (region_list_t::iterator iter = mRegionList.begin(); iter != mRegionList.end(); ++iter) { LLViewerRegion* regionp = *iter; - if (regionp->getHandle() == handle) +// Aurora Sim + //if (regionp->getHandle() == handle) + U32 checkRegionX, checkRegionY; + F32 checkRegionWidth = regionp->getWidth(); + from_region_handle(regionp->getHandle(), &checkRegionX, &checkRegionY); + + if (x >= checkRegionX && x < (checkRegionX + checkRegionWidth) && + y >= checkRegionY && y < (checkRegionY + checkRegionWidth)) +// Aurora Sim { return regionp; } @@ -862,7 +915,10 @@ F32 LLWorld::getLandFarClip() const void LLWorld::setLandFarClip(const F32 far_clip) { - static S32 const rwidth = (S32)REGION_WIDTH_U32; +// Aurora Sim + //static S32 const rwidth = (S32)REGION_WIDTH_U32; + static S32 const rwidth = (S32)getRegionWidthInMeters(); +// Aurora Sim S32 const n1 = (llceil(mLandFarClip) - 1) / rwidth; S32 const n2 = (llceil(far_clip) - 1) / rwidth; bool need_water_objects_update = n1 != n2; @@ -1294,9 +1350,25 @@ void process_enable_simulator(LLMessageSystem *msg, void **user_data) // which simulator should we modify? LLHost sim(ip_u32, port); +// Aurora Sim + 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; + } +// Aurora Sim // Viewer trusts the simulator. msg->enableCircuit(sim, TRUE); - LLWorld::getInstance()->addRegion(handle, sim); +// Aurora Sim + //LLWorld::getInstance()->addRegion(handle, sim); + LLWorld::getInstance()->addRegion(handle, sim, region_size_x, region_size_y); +// Aurora Sim // give the simulator a message it can use to get ip and port llinfos << "simulator_enable() Enabling " << sim << " with code " << msg->getOurCircuitCode() << llendl; diff --git a/indra/newview/llworld.h b/indra/newview/llworld.h index 8cdaeae4e..8056139bd 100644 --- a/indra/newview/llworld.h +++ b/indra/newview/llworld.h @@ -71,7 +71,11 @@ public: LLWorld(); void destroyClass(); - LLViewerRegion* addRegion(const U64 ®ion_handle, const LLHost &host); +// Aurora Sim + void updateLimits(); // Aurora Sim + //LLViewerRegion* addRegion(const U64 ®ion_handle, const LLHost &host); + LLViewerRegion* addRegion(const U64 ®ion_handle, const LLHost &host, const U32 ®ion_size_x, const U32 ®ion_size_y); +// Aurora Sim // 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); @@ -182,12 +186,18 @@ private: region_remove_signal_t mRegionRemovedSignal; // Number of points on edge - static const U32 mWidth; +// Aurora Sim + //static const U32 mWidth; + static U32 mWidth; +// Aurora Sim // meters/point, therefore mWidth * mScale = meters per edge static const F32 mScale; - static const F32 mWidthInMeters; +// Aurora Sim + //static const F32 mWidthInMeters; + static F32 mWidthInMeters; +// Aurora Sim F32 mLandFarClip; // Far clip distance for land. LLPatchVertexArray mLandPatch; diff --git a/indra/newview/llworldmap.cpp b/indra/newview/llworldmap.cpp index b153cfafd..64f5eb082 100644 --- a/indra/newview/llworldmap.cpp +++ b/indra/newview/llworldmap.cpp @@ -84,8 +84,10 @@ LLSimInfo::LLSimInfo(U64 handle) mAccess(0x0), mRegionFlags(0x0), mFirstAgentRequest(true), +// Aurora Sim mSizeX(REGION_WIDTH_UNITS), mSizeY(REGION_WIDTH_UNITS), +// Aurora Sim mAlpha(0.f) { } @@ -376,10 +378,31 @@ LLSimInfo* LLWorldMap::simInfoFromPosGlobal(const LLVector3d& pos_global) LLSimInfo* LLWorldMap::simInfoFromHandle(const U64 handle) { - sim_info_map_t::iterator it = mSimInfoMap.find(handle); - if (it != mSimInfoMap.end()) +// Aurora Sim + //sim_info_map_t::iterator it = mSimInfoMap.find(handle); + //if (it != mSimInfoMap.end()) + //{ + // return it->second; + std::map::const_iterator it; + for (it = LLWorldMap::getInstance()->mSimInfoMap.begin(); it != LLWorldMap::getInstance()->mSimInfoMap.end(); ++it) { - return it->second; + const U64 hndl = (*it).first; + LLSimInfo* info = (*it).second; + if(hndl == handle) + { + return info; + } + U32 x = 0, y = 0; + from_region_handle(handle, &x, &y); + U32 checkRegionX, checkRegionY; + from_region_handle(hndl, &checkRegionX, &checkRegionY); + + if(x >= checkRegionX && x < (checkRegionX + info->mSizeX) && + y >= checkRegionY && y < (checkRegionY + info->mSizeY)) + { + return info; + } +// Aurora Sim } return NULL; } @@ -538,7 +561,10 @@ void LLWorldMap::reloadItems(bool force) // static public // Insert a region in the region map // returns true if region inserted, false otherwise -bool LLWorldMap::insertRegion(U32 x_world, U32 y_world, U32 x_size, U32 y_size, U32 agent_flags, std::string& name, LLUUID& image_id, U32 accesscode, U32 region_flags) +// Aurora Sim +//bool LLWorldMap::insertRegion(U32 x_world, U32 y_world, std::string& name, LLUUID& image_id, U32 accesscode, U64 region_flags) +bool LLWorldMap::insertRegion(U32 x_world, U32 y_world, U16 x_size, U16 y_size, std::string& name, LLUUID& image_id, U32 accesscode, U64 region_flags) +// Aurora Sim { // This region doesn't exist if (accesscode == 255) @@ -562,17 +588,14 @@ bool LLWorldMap::insertRegion(U32 x_world, U32 y_world, U32 x_size, U32 y_size, { siminfo = LLWorldMap::getInstance()->createSimInfoFromHandle(handle); } - - siminfo->setName( name ); - siminfo->setAccess( accesscode ); - siminfo->setRegionFlags( region_flags ); - //siminfo->setWaterHeight((F32) water_height); - U32 layer = flagsToLayer(agent_flags); - if (layer == SIM_LAYER_OVERLAY) - siminfo->setLandForSaleImage(image_id); - else if(layer < SIM_LAYER_COUNT) - siminfo->setMapImageID( image_id, layer ); - siminfo->setSize( x_size, y_size ); + siminfo->setName(name); + siminfo->setAccess(accesscode); + siminfo->setRegionFlags(region_flags); + // siminfo->setWaterHeight((F32) water_height); + siminfo->setLandForSaleImage(image_id); +// Aurora Sim + siminfo->setSize(x_size, y_size); +// Aurora Sim // Handle the location tracking (for teleport, UI feedback and info display) if (LLWorldMap::getInstance()->isTrackingInRectangle( x_world, y_world, x_world + REGION_WIDTH_UNITS, y_world + REGION_WIDTH_UNITS)) diff --git a/indra/newview/llworldmap.h b/indra/newview/llworldmap.h index fd654316d..794b0f767 100644 --- a/indra/newview/llworldmap.h +++ b/indra/newview/llworldmap.h @@ -192,8 +192,15 @@ public: const LLSimInfo::item_info_list_t& getLandForSaleAdult() const { return mLandForSaleAdult; } const LLSimInfo::item_info_list_t& getAgentLocation() const { return mAgentLocations; } + const U64 &getHandle() const { return mHandle; } + +//private: + U64 mHandle; // This is a hash of the X and Y world coordinates of the SW corner of the sim + U16 mSizeX; + U16 mSizeY; + private: - U64 mHandle; +// Aurora Sim std::string mName; F64 mAgentsUpdateTime; // Time stamp giving the last time the agents information was requested for that region @@ -201,8 +208,6 @@ private: U32 mAccess; // Down/up and maturity rating of the region U32 mRegionFlags; - U16 mSizeX; - U16 mSizeY; F32 mAlpha; @@ -235,8 +240,12 @@ struct LLWorldMapLayer // We request region data on the world by "blocks" of (MAP_BLOCK_SIZE x MAP_BLOCK_SIZE) regions // This is to reduce the number of requests to the asset DB and get things in big "blocks" -const S32 MAP_MAX_SIZE = 2048; -const S32 MAP_BLOCK_SIZE = 4; +// Aurora Sim +//const S32 MAP_MAX_SIZE = 2048; +//const S32 MAP_BLOCK_SIZE = 4; +const S32 MAP_MAX_SIZE = 16384; +const S32 MAP_BLOCK_SIZE = 16; +// Aurora Sim const S32 MAP_BLOCK_RES = (MAP_MAX_SIZE / MAP_BLOCK_SIZE); class LLWorldMap : public LLSingleton @@ -262,7 +271,10 @@ public: // Insert a region and items in the map global instance // Note: x_world and y_world in world coordinates (meters) - static bool insertRegion(U32 x_world, U32 y_world, U32 x_size, U32 y_size, U32 agent_flags, std::string& name, LLUUID& image_id, U32 accesscode, U32 region_flags); +// Aurora Sim + static bool insertRegion(U32 x_world, U32 y_world, std::string& name, LLUUID& uuid, U32 accesscode, U64 region_flags); + static bool insertRegion(U32 x_world, U32 y_world, U16 x_size, U16 y_size, std::string& name, LLUUID& uuid, U32 accesscode, U64 region_flags); +// Aurora Sim static bool insertItem(U32 x_world, U32 y_world, std::string& name, LLUUID& uuid, U32 type, S32 extra, S32 extra2); // Get info on sims (region) : note that those methods only search the range of loaded sims (the one that are being browsed) diff --git a/indra/newview/llworldmapmessage.cpp b/indra/newview/llworldmapmessage.cpp index 5729bcb11..d7eaaafb6 100644 --- a/indra/newview/llworldmapmessage.cpp +++ b/indra/newview/llworldmapmessage.cpp @@ -170,8 +170,10 @@ void LLWorldMapMessage::processMapBlockReply(LLMessageSystem* msg, void**) { U16 x_regions; U16 y_regions; +// Aurora Sim U16 x_size = 256; U16 y_size = 256; +// Aurora Sim std::string name; U8 accesscode; U32 region_flags; @@ -186,6 +188,7 @@ void LLWorldMapMessage::processMapBlockReply(LLMessageSystem* msg, void**) // msg->getU8Fast(_PREHASH_Data, _PREHASH_WaterHeight, water_height, block); // msg->getU8Fast(_PREHASH_Data, _PREHASH_Agents, agents, block); msg->getUUIDFast(_PREHASH_Data, _PREHASH_MapImageID, image_id, block); +// Aurora Sim if(msg->getNumberOfBlocksFast(_PREHASH_Size) > 0) { msg->getU16Fast(_PREHASH_Size, _PREHASH_SizeX, x_size, block); @@ -196,6 +199,7 @@ void LLWorldMapMessage::processMapBlockReply(LLMessageSystem* msg, void**) x_size = 256; y_size = 256; } +// Aurora Sim U32 x_world = (U32)(x_regions) * REGION_WIDTH_UNITS; U32 y_world = (U32)(y_regions) * REGION_WIDTH_UNITS; @@ -209,7 +213,10 @@ void LLWorldMapMessage::processMapBlockReply(LLMessageSystem* msg, void**) continue; // Insert that region in the world map, if failure, flag it as a "null_sim" - if (!(LLWorldMap::getInstance()->insertRegion(x_world, y_world, x_size, y_size, agent_flags, name, image_id, (U32)accesscode, region_flags))) +// Aurora Sim + //if (!(LLWorldMap::getInstance()->insertRegion(x_world, y_world, name, image_id, (U32)accesscode, region_flags))) + if (!(LLWorldMap::getInstance()->insertRegion(x_world, y_world, x_size, y_size, name, image_id, (U32)accesscode, region_flags))) +// Aurora Sim { found_null_sim = true; } diff --git a/indra/newview/skins/default/xui/en-us/floater_world_map.xml b/indra/newview/skins/default/xui/en-us/floater_world_map.xml index ba1f068c2..580286dda 100644 --- a/indra/newview/skins/default/xui/en-us/floater_world_map.xml +++ b/indra/newview/skins/default/xui/en-us/floater_world_map.xml @@ -156,14 +156,14 @@ Location: Date: Fri, 27 Sep 2013 11:58:03 -0400 Subject: [PATCH 181/302] [VarRegions] Made the radar aware that region width may not be 256 always anymore --- indra/newview/llfloateravatarlist.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/indra/newview/llfloateravatarlist.cpp b/indra/newview/llfloateravatarlist.cpp index 1cef54918..14ef9b2b6 100644 --- a/indra/newview/llfloateravatarlist.cpp +++ b/indra/newview/llfloateravatarlist.cpp @@ -747,6 +747,7 @@ void LLFloaterAvatarList::refreshAvatarList() LLVector3d posagent; posagent.setVec(gAgent.getPositionAgent()); LLVector3d simpos = mypos - posagent; + const S32 width(gAgent.getRegion() ? gAgent.getRegion()->getWidth() : 256); BOOST_FOREACH(av_list_t::value_type& entry, mAvatars) { @@ -904,7 +905,7 @@ void LLFloaterAvatarList::refreshAvatarList() S32 x = (S32)position.mdV[VX]; S32 y = (S32)position.mdV[VY]; - if (x >= 0 && x <= 256 && y >= 0 && y <= 256) + if (x >= 0 && x <= width && y >= 0 && y <= width) { snprintf(temp, sizeof(temp), "%d, %d", x, y); } @@ -915,7 +916,7 @@ void LLFloaterAvatarList::refreshAvatarList() { strcat(temp, "S"); } - else if (y > 256) + else if (y > width) { strcat(temp, "N"); } @@ -923,7 +924,7 @@ void LLFloaterAvatarList::refreshAvatarList() { strcat(temp, "W"); } - else if (x > 256) + else if (x > width) { strcat(temp, "E"); } From da38d4bc482e5e58393d3de22b4cda7efefa2218 Mon Sep 17 00:00:00 2001 From: Inusaito Sayori Date: Fri, 27 Sep 2013 13:41:45 -0400 Subject: [PATCH 182/302] [VarRegions] Fix copy slurl on map to take the fmod of the x and y against the width of the region in question, instead of 256 --- indra/newview/llfloaterworldmap.cpp | 5 +++++ indra/newview/llslurl.cpp | 8 ++++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/indra/newview/llfloaterworldmap.cpp b/indra/newview/llfloaterworldmap.cpp index 24f11cbfc..1d33194a0 100644 --- a/indra/newview/llfloaterworldmap.cpp +++ b/indra/newview/llfloaterworldmap.cpp @@ -875,6 +875,11 @@ void LLFloaterWorldMap::updateLocation() // [/RLVa:KB] // if ( gotSimName ) { + // Singu Note: Var region support for SLURLs + const LLSimInfo* sim = LLWorldMap::getInstance()->simInfoFromPosGlobal(pos_global); + const F64 size(sim ? sim->getSizeX() : 256); + pos_global[0] = fmod(pos_global[0], size); + pos_global[1] = fmod(pos_global[1], size); mSLURL = LLSLURL(sim_name, pos_global); } else diff --git a/indra/newview/llslurl.cpp b/indra/newview/llslurl.cpp index 3f1b194c5..abd21bd75 100644 --- a/indra/newview/llslurl.cpp +++ b/indra/newview/llslurl.cpp @@ -312,9 +312,9 @@ LLSLURL::LLSLURL(const std::string& slurl) mPosition = LLVector3(path_array); // this construction handles LLSD without all components (values default to 0.f) if((F32(mPosition[VX]) < 0.f) || - (mPosition[VX] > REGION_WIDTH_METERS) || + (mPosition[VX] > 8192.f/*REGION_WIDTH_METERS*/) || (F32(mPosition[VY]) < 0.f) || - (mPosition[VY] > REGION_WIDTH_METERS) || + (mPosition[VY] > 8192.f/*REGION_WIDTH_METERS*/) || (F32(mPosition[VZ]) < 0.f) || (mPosition[VZ] > 8192.f/*REGION_HEIGHT_METERS*/)) { @@ -355,8 +355,8 @@ LLSLURL::LLSLURL(const std::string& grid, { mGrid = grid; mRegion = region; - S32 x = llround( (F32)fmod( position[VX], (F32)REGION_WIDTH_METERS ) ); - S32 y = llround( (F32)fmod( position[VY], (F32)REGION_WIDTH_METERS ) ); + S32 x = llround( (F32)position[VX] ); + S32 y = llround( (F32)position[VY] ); S32 z = llround( (F32)position[VZ] ); mType = LOCATION; mPosition = LLVector3(x, y, z); From afe0f7ef3d9d69d3170a59885067812ab4ab0d16 Mon Sep 17 00:00:00 2001 From: Salvatore La Bua Date: Sat, 28 Sep 2013 05:15:45 +0200 Subject: [PATCH 183/302] Revert "Trees shadow parameters use actual debug settings" This reverts commit 3c5a0efb8daff076d2191b2eb065aca4f466fcf6. --- indra/newview/lldrawpooltree.cpp | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/indra/newview/lldrawpooltree.cpp b/indra/newview/lldrawpooltree.cpp index 1a5832039..bb2fb09eb 100644 --- a/indra/newview/lldrawpooltree.cpp +++ b/indra/newview/lldrawpooltree.cpp @@ -110,9 +110,7 @@ void LLDrawPoolTree::render(S32 pass) renderTree(); } else - { - gGL.getTexUnit(sDiffTex)->bind(mTexturep); - } + gGL.getTexUnit(sDiffTex)->bind(mTexturep); for (std::vector::iterator iter = mDrawFace.begin(); iter != mDrawFace.end(); iter++) @@ -189,8 +187,8 @@ void LLDrawPoolTree::beginShadowPass(S32 pass) { LLFastTimer t(FTM_SHADOW_TREE); - static const LLCachedControl render_deferred_offset(gSavedSettings, "RenderDeferredTreeShadowOffset"); - static const LLCachedControl render_deferred_bias(gSavedSettings, "RenderDeferredTreeShadowBias"); + static const LLCachedControl render_deferred_offset("RenderDeferredTreeShadowOffset",1.f); + static const LLCachedControl render_deferred_bias("RenderDeferredTreeShadowBias",1.f); glPolygonOffset(render_deferred_offset,render_deferred_bias); gDeferredTreeShadowProgram.bind(); gDeferredTreeShadowProgram.setMinimumAlpha(0.5f); @@ -205,8 +203,8 @@ void LLDrawPoolTree::endShadowPass(S32 pass) { LLFastTimer t(FTM_SHADOW_TREE); - static const LLCachedControl render_deferred_offset(gSavedSettings, "RenderDeferredSpotShadowOffset"); - static const LLCachedControl render_deferred_bias(gSavedSettings, "RenderDeferredSpotShadowBias"); + static const LLCachedControl render_deferred_offset("RenderDeferredSpotShadowOffset",1.f); + static const LLCachedControl render_deferred_bias("RenderDeferredSpotShadowBias",1.f); glPolygonOffset(render_deferred_offset,render_deferred_bias); gDeferredTreeShadowProgram.unbind(); } From df7c60de357f960d19b43d4e4e438e523ae900f5 Mon Sep 17 00:00:00 2001 From: Salvatore La Bua Date: Sat, 28 Sep 2013 05:32:54 +0200 Subject: [PATCH 184/302] Add option to show Client tags on a new line The checkbox is available in Preferences > Vanity > Tags/Colors. Debug Setting: SLBDisplayClientTagOnNewLine --- indra/newview/app_settings/settings.xml | 11 +++++++++++ indra/newview/ascentprefsvan.cpp | 3 +++ indra/newview/ascentprefsvan.h | 1 + indra/newview/llvoavatar.cpp | 9 ++++++++- .../xui/de/panel_preferences_ascent_vanity.xml | 1 + .../xui/en-us/panel_preferences_ascent_vanity.xml | 7 ++++--- .../xui/es/panel_preferences_ascent_vanity.xml | 1 + .../xui/fr/panel_preferences_ascent_vanity.xml | 1 + 8 files changed, 30 insertions(+), 4 deletions(-) diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 240c181b8..50cc566dc 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -868,6 +868,17 @@ Found in Advanced->Rendering->Info Displays Value 0 + SLBDisplayClientTagOnNewLine + + Comment + Display the client tag on a new line + Persist + 1 + Type + Boolean + Value + 0 + LogShowHistoryLines Comment diff --git a/indra/newview/ascentprefsvan.cpp b/indra/newview/ascentprefsvan.cpp index 33a3a12be..a69c60aee 100644 --- a/indra/newview/ascentprefsvan.cpp +++ b/indra/newview/ascentprefsvan.cpp @@ -66,6 +66,7 @@ LLPrefsAscentVan::LLPrefsAscentVan() getChild("show_self_tag_color_check")->setCommitCallback(boost::bind(&LLPrefsAscentVan::onCommitCheckBox, this, _1, _2)); getChild("customize_own_tag_check")->setCommitCallback(boost::bind(&LLPrefsAscentVan::onCommitCheckBox, this, _1, _2)); getChild("show_friend_tag_check")->setCommitCallback(boost::bind(&LLPrefsAscentVan::onCommitCheckBox, this, _1, _2)); + getChild("display_client_new_line_check")->setCommitCallback(boost::bind(&LLPrefsAscentVan::onCommitCheckBox, this, _1, _2)); getChild("use_status_check")->setCommitCallback(boost::bind(&LLPrefsAscentVan::onCommitCheckBox, this, _1, _2)); getChild("custom_tag_label_box")->setCommitCallback(boost::bind(&LLPrefsAscentVan::onCommitTextModified, this, _1, _2)); @@ -174,6 +175,7 @@ void LLPrefsAscentVan::refreshValues() mShowSelfClientTag = gSavedSettings.getBOOL("AscentShowSelfTag"); mShowSelfClientTagColor = gSavedSettings.getBOOL("AscentShowSelfTagColor"); mShowFriendsTag = gSavedSettings.getBOOL("AscentShowFriendsTag"); + mDisplayClientTagOnNewLine = gSavedSettings.getBOOL("SLBDisplayClientTagOnNewLine"); mCustomTagOn = gSavedSettings.getBOOL("AscentUseCustomTag"); mCustomTagLabel = gSavedSettings.getString("AscentCustomTagLabel"); mCustomTagColor = gSavedSettings.getColor4("AscentCustomTagColor"); @@ -246,6 +248,7 @@ void LLPrefsAscentVan::cancel() gSavedSettings.setBOOL("AscentShowSelfTag", mShowSelfClientTag); gSavedSettings.setBOOL("AscentShowSelfTagColor", mShowSelfClientTagColor); gSavedSettings.setBOOL("AscentShowFriendsTag", mShowFriendsTag); + gSavedSettings.setBOOL("SLBDisplayClientTagOnNewLine", mDisplayClientTagOnNewLine); gSavedSettings.setBOOL("AscentUseCustomTag", mCustomTagOn); gSavedSettings.setString("AscentCustomTagLabel", mCustomTagLabel); gSavedSettings.setColor4("AscentCustomTagColor", mCustomTagColor); diff --git a/indra/newview/ascentprefsvan.h b/indra/newview/ascentprefsvan.h index 5d0c6af44..77285b23d 100644 --- a/indra/newview/ascentprefsvan.h +++ b/indra/newview/ascentprefsvan.h @@ -71,6 +71,7 @@ protected: BOOL mShowSelfClientTag; BOOL mShowSelfClientTagColor; BOOL mShowFriendsTag; + BOOL mDisplayClientTagOnNewLine; BOOL mCustomTagOn; std::string mCustomTagLabel; LLColor4 mCustomTagColor; diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index a599df745..88ea18c52 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -564,6 +564,7 @@ SHClientTagMgr::SHClientTagMgr() gSavedSettings.getControl("AscentEstateOwnerColor")->getSignal()->connect(boost::bind(&LLVOAvatar::invalidateNameTags)); gSavedSettings.getControl("AscentFriendColor")->getSignal()->connect(boost::bind(&LLVOAvatar::invalidateNameTags)); gSavedSettings.getControl("AscentMutedColor")->getSignal()->connect(boost::bind(&LLVOAvatar::invalidateNameTags)); + gSavedSettings.getControl("SLBDisplayClientTagOnNewLine")->getSignal()->connect(boost::bind(&LLVOAvatar::invalidateNameTags)); //Following group of settings all actually manipulate the tag cache for agent avatar. Even if the tag system is 'disabled', we still allow an //entry to exist for the agent avatar. @@ -3060,6 +3061,7 @@ void LLVOAvatar::idleUpdateNameTagText(BOOL new_name) LLNameValue *title = getNVPair("Title"); LLNameValue* firstname = getNVPair("FirstName"); LLNameValue* lastname = getNVPair("LastName"); + static const LLCachedControl display_client_new_line("SLBDisplayClientTagOnNewLine"); // Avatars must have a first and last name if (!firstname || !lastname) return; @@ -3282,7 +3284,12 @@ void LLVOAvatar::idleUpdateNameTagText(BOOL new_name) else if(allow_nameplate_override && !mCCSAttachmentText.empty()) tag_format=mCCSAttachmentText; else - tag_format=sRenderGroupTitles ? "%g\n%f %l %t" : "%f %l %t"; + { + if(!display_client_new_line) + tag_format=sRenderGroupTitles ? "%g\n%f %l %t" : "%f %l %t"; + else + tag_format=sRenderGroupTitles ? "%g\n%f %l\n%t" : "%f %l\n%t"; + } // replace first name, last name and title typedef boost::tokenizer > tokenizer; diff --git a/indra/newview/skins/default/xui/de/panel_preferences_ascent_vanity.xml b/indra/newview/skins/default/xui/de/panel_preferences_ascent_vanity.xml index 5a808509c..c0dcbb781 100644 --- a/indra/newview/skins/default/xui/de/panel_preferences_ascent_vanity.xml +++ b/indra/newview/skins/default/xui/de/panel_preferences_ascent_vanity.xml @@ -24,6 +24,7 @@ + Label: diff --git a/indra/newview/skins/default/xui/en-us/panel_preferences_ascent_vanity.xml b/indra/newview/skins/default/xui/en-us/panel_preferences_ascent_vanity.xml index afe08c144..59af05819 100644 --- a/indra/newview/skins/default/xui/en-us/panel_preferences_ascent_vanity.xml +++ b/indra/newview/skins/default/xui/en-us/panel_preferences_ascent_vanity.xml @@ -24,8 +24,9 @@ + - + Label: Color: @@ -33,7 +34,7 @@ - +