Merge branch 'master' of git://github.com/Lirusaito/SingularityViewer

This commit is contained in:
Latif Khalifa
2013-09-28 16:23:28 +02:00
27 changed files with 187 additions and 348 deletions

View File

@@ -280,7 +280,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);

View File

@@ -231,7 +231,7 @@ void decode_patch_group_header(LLBitPack &bitpack, LLGroupHeader *gopp)
// <FS:CR> Aurora Sim
//void decode_patch_header(LLBitPack &bitpack, LLPatchHeader *ph)
void decode_patch_header(LLBitPack &bitpack, LLPatchHeader *ph, BOOL b_large_patch)
void decode_patch_header(LLBitPack &bitpack, LLPatchHeader *ph, bool b_large_patch)
// </FS:CR> Aurora Sim
{
U8 retvalu8;
@@ -275,12 +275,11 @@ void decode_patch_header(LLBitPack &bitpack, LLPatchHeader *ph, BOOL b_large_pat
//retvalu16 = 0;
retvalu32 = 0;
#ifdef LL_BIG_ENDIAN
// <FS:CR> Aurora Sim
//ret = (U8 *)&retvalu16;
if(b_large_patch)
ret = (U8*)&retvalu32;
// </FS:CR> Aurora Sim
if (b_large_patch)
{
//todo test
ret = (U8 *)&retvalu32;
bitpack.bitUnpack(&(ret[3]), 8);
bitpack.bitUnpack(&(ret[2]), 8);
bitpack.bitUnpack(&(ret[1]), 8);
@@ -288,21 +287,14 @@ void decode_patch_header(LLBitPack &bitpack, LLPatchHeader *ph, BOOL b_large_pat
}
else
{
ret = (U8 *)&retvalu32;
bitpack.bitUnpack(&(ret[1]), 8);
bitpack.bitUnpack(&(ret[0]), 2);
}
// </FS:CR> Aurora Sim
#else
// <FS:CR> Aurora Sim
//bitpack.bitUnpack((U8 *)&retvalu16, 10);
if(b_large_patch)
bitpack.bitUnpack((U8 *)&retvalu32, 32);
else
bitpack.bitUnpack((U8 *)&retvalu32, 10);
// </FS:CR> Aurora Sim
bitpack.bitUnpack((U8*)&retvalu32, b_large_patch ? 32 : 10);
#endif
// <FS:CR> Aurora Sim
//ph->patchids = retvalu16;
ph->patchids = retvalu32;
// </FS:CR> Aurora Sim

View File

@@ -42,7 +42,7 @@ void init_patch_decoding(LLBitPack &bitpack);
void decode_patch_group_header(LLBitPack &bitpack, LLGroupHeader *gopp);
// <FS:CR> Aurora Sim
//void decode_patch_header(LLBitPack &bitpack, LLPatchHeader *ph);
void decode_patch_header(LLBitPack &bitpack, LLPatchHeader *ph, BOOL b_large_patch);
void decode_patch_header(LLBitPack &bitpack, LLPatchHeader *ph, bool b_large_patch = false);
// </FS:CR> Aurora Sim
void decode_patch(LLBitPack &bitpack, S32 *patches);

View File

@@ -565,7 +565,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)

View File

@@ -2321,7 +2321,7 @@ void LLAgent::setStartPosition( U32 location_id )
const F32 INSET = 0.5f; //meters
// <FS:CR> Aurora Sim
//const F32 REGION_WIDTH = LLWorld::getInstance()->getRegionWidthInMeters();
const F32 REGION_WIDTH = getRegion()->getWidth();
const F32 REGION_WIDTH = getRegion()->getWidth();
// </FS:CR> Aurora Sim
LLVector3 agent_pos = getPositionAgent();

View File

@@ -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, FALSE);
decode_patch_header(bitpack, &patch_header);
decode_patch(bitpack, gBuffer);
decompress_patch(mDensityp, gBuffer, &patch_header);
}

View File

@@ -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");
}

View File

@@ -86,6 +86,7 @@
#include "llvlcomposition.h"
#include "llwaterparammanager.h"
#include "llagentui.h"
#include "hippogridmanager.h"
// [RLVa:KB]
#include "rlvhandler.h"
// [/RLVa:KB]
@@ -1300,8 +1301,8 @@ BOOL LLPanelRegionTerrainInfo::sendUpdate()
// =======================================
// Assemble and send texturedetail message
// 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;
}

View File

@@ -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

View File

@@ -47,9 +47,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"
@@ -406,7 +406,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;

View File

@@ -1344,7 +1344,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;
{

View File

@@ -101,7 +101,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();
@@ -166,7 +166,7 @@ void LLNetMap::setScale( F32 scale )
mObjectMapPixels = diameter;
}
mPixelsPerMeter = mScale / LLWorld::getInstance()->getRegionWidthInMeters();
mPixelsPerMeter = mScale / REGION_WIDTH_METERS;
mDotRadius = llmax(DOT_SCALE * mPixelsPerMeter, MIN_DOT_RADIUS);
mUpdateNow = TRUE;
@@ -261,7 +261,7 @@ void LLNetMap::draw()
LLColor4 dead_region_color = gColors.getColor( "NetMapDeadRegion" );
// <FS:CR> Aurora Sim
//S32 region_width = llround(LLWorld::getInstance()->getRegionWidthInMeters());
S32 region_width = llround(REGION_WIDTH_METERS);
S32 region_width = REGION_WIDTH_UNITS;
// </FS:CR> Aurora Sim
for (LLWorld::region_list_t::const_iterator iter = LLWorld::getInstance()->getRegionList().begin();
@@ -280,8 +280,8 @@ void LLNetMap::draw()
// <FS:CR> 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 ;
F32 top = bottom + (regionp->getWidth() / REGION_WIDTH_METERS) * mScale ;
F32 right = left + (regionp->getWidth() / REGION_WIDTH_METERS) * mScale ;
// </FS:CR> Aurora Sim
gGL.color4fv(regionp == gAgent.getRegion() ? this_region_color.mV : live_region_color.mV);
@@ -351,8 +351,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/REGION_WIDTH_METERS;
map_center_agent.mV[1] *= mScale/REGION_WIDTH_METERS;
gGL.getTexUnit(0)->bind(mObjectImagep);
F32 image_half_width = 0.5f*mObjectMapPixels;

View File

@@ -2568,7 +2568,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, gHippoLimits->getMaxHeight());
@@ -2648,7 +2648,9 @@ void LLPanelObject::onPastePosClip(void* user_data)
std::string stringVec = wstring_to_utf8str(temp_string);
if(!getvectorfromclip(stringVec, &mClipboardPos)) return;
float region_width = LLWorld::getInstance()->getRegionWidthInMeters();
const LLViewerRegion* region(self->mObject ? self->mObject->getRegion() : NULL);
if (!region) return;
F32 region_width = region->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, gHippoLimits->getMaxHeight());

View File

@@ -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)

View File

@@ -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);

View File

@@ -310,8 +310,8 @@ void release_start_screen();
void reset_login();
void apply_udp_blacklist(const std::string& csv);
// <FS:CR> 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);
//bool process_login_success_response(std::string& password);
bool process_login_success_response(std::string& password, U32& first_sim_size_x);
// </FS:CR> Aurora Sim
void transition_back_to_login_panel(const std::string& emsg);
@@ -402,7 +402,6 @@ bool idle_startup()
// <FS:CR> Aurora Sim
static U32 first_sim_size_x = 256;
static U32 first_sim_size_y = 256;
// </FS:CR> 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
@@ -1550,7 +1549,7 @@ bool idle_startup()
if (successful_login)
{
// unpack login data needed by the application
if(process_login_success_response(password, first_sim_size_x, first_sim_size_y))
if (process_login_success_response(password, first_sim_size_x))
{
std::string name = firstname;
if (!gHippoGridManager->getCurrentGrid()->isSecondLife() ||
@@ -1670,9 +1669,9 @@ bool idle_startup()
display_startup();
// <FS:CR> Aurora Sim
//LLWorld::getInstance()->addRegion(gFirstSimHandle, gFirstSim);
LLWorld::getInstance()->addRegion(gFirstSimHandle, gFirstSim, first_sim_size_x, first_sim_size_y);
LLWorld::getInstance()->setRegionWidth(first_sim_size_x);
// </FS:CR> Aurora Sim
LLWorld::getInstance()->addRegion(gFirstSimHandle, gFirstSim);
display_startup();
LLViewerRegion *regionp = LLWorld::getInstance()->getRegionFromHandle(gFirstSimHandle);
@@ -3854,7 +3853,7 @@ void apply_udp_blacklist(const std::string& csv)
}
bool process_login_success_response(std::string& password, U32 &first_sim_size_x, U32 &first_sim_size_y)
bool process_login_success_response(std::string& password, U32& first_sim_size_x)
{
LLSD response = LLUserAuth::getInstance()->getResponse();
@@ -3994,18 +3993,12 @@ bool process_login_success_response(std::string& password, U32 &first_sim_size_x
U32 region_y = strtoul(region_y_str.c_str(), NULL, 10);
gFirstSimHandle = to_region_handle(region_x, region_y);
}
// <FS:CR> 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);
if (!text.empty()) LLViewerParcelMgr::getInstance()->init(first_sim_size_x = atoi(text.c_str()));
// </FS:CR> Aurora Sim
const std::string look_at_str = response["look_at"];
if (!look_at_str.empty())
{

View File

@@ -302,28 +302,7 @@ void LLSurface::initTextures()
//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);
// </FS:CR> Aurora Sim
mWaterObjp->setPositionGlobal(water_pos_global);
}
}
@@ -414,20 +393,24 @@ void LLSurface::connectNeighbor(LLSurface *neighborp, U32 direction)
from_region_handle(mRegionp->getHandle(), &own_xpos, &own_ypos);
from_region_handle(neighborp->getRegion()->getHandle(), &neighbor_xpos, &neighbor_ypos);
if(own_ypos >= neighbor_ypos) {
if(own_ypos >= neighbor_ypos)
{
neighbor_offset[1] = (own_ypos - neighbor_ypos) / mGridsPerPatchEdge;
ppe[1] = llmin(mPatchesPerEdge, neighborPatchesPerEdge-neighbor_offset[1]);
}
else {
else
{
own_offset[1] = (neighbor_ypos - own_ypos) / mGridsPerPatchEdge;
ppe[1] = llmin(mPatchesPerEdge-own_offset[1], neighborPatchesPerEdge);
}
if(own_xpos >= neighbor_xpos) {
if(own_xpos >= neighbor_xpos)
{
neighbor_offset[0] = (own_xpos - neighbor_xpos) / mGridsPerPatchEdge;
ppe[0] = llmin(mPatchesPerEdge, neighborPatchesPerEdge-neighbor_offset[0]);
}
else {
else
{
own_offset[0] = (neighbor_xpos - own_xpos) / mGridsPerPatchEdge;
ppe[0] = llmin(mPatchesPerEdge-own_offset[0], neighborPatchesPerEdge);
}

View File

@@ -36,7 +36,6 @@
#include "timing.h"
#include "llsky.h"
#include "llviewercamera.h"
#include "llregionhandle.h" // <FS:CR> Aurora Sim
// For getting composition values
#include "llviewerregion.h"
@@ -251,30 +250,23 @@ void LLSurfacePatch::calcNormal(const U32 x, const U32 y, const U32 stride)
const F32 mpg = mSurfacep->getMetersPerGrid() * stride;
// <FS:CR> Aurora Sim
// Singu Note: poffsets gets an extra space each for surface stride (tag clutter removed)
//S32 poffsets[2][2][2];
S32 poffsets[2][2][3];
// </FS:CR> Aurora Sim
poffsets[0][0][0] = x - stride;
poffsets[0][0][1] = y - stride;
// <FS:CR> Aurora Sim
poffsets[0][0][2] = surface_stride;
// </FS:CR> Aurora Sim
poffsets[0][1][0] = x - stride;
poffsets[0][1][1] = y + stride;
// <FS:CR> Aurora Sim
poffsets[0][1][2] = surface_stride;
// </FS:CR> Aurora Sim
poffsets[1][0][0] = x + stride;
poffsets[1][0][1] = y - stride;
// <FS:CR> Aurora Sim
poffsets[1][0][2] = surface_stride;
// </FS:CR> Aurora Sim
poffsets[1][1][0] = x + stride;
poffsets[1][1][1] = y + stride;
// <FS:CR> Aurora Sim
poffsets[1][1][2] = surface_stride;
// </FS:CR> Aurora Sim
@@ -312,12 +304,6 @@ void LLSurfacePatch::calcNormal(const U32 x, const U32 y, const U32 stride)
if (!ppatches[i][j]->getNeighborPatch(SOUTH))
{
poffsets[i][j][1] = 0;
}
else
{
// <FS:CR> 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();
// </FS>CR> Aurora Sim
}
@@ -359,28 +345,19 @@ void LLSurfacePatch::calcNormal(const U32 x, const U32 y, const U32 stride)
*(ppatches[0][0]->mDataZ
+ poffsets[0][0][0]
// <FS:CR> Aurora Sim
//+ poffsets[0][0][1]*surface_stride));
// Singu Note: multiply the y poffsets by its own surface stride (tag clutter removed)
+ poffsets[0][0][1]*poffsets[0][0][2]));
// </FS:CR> Aurora Sim
LLVector3 p01(-mpg,+mpg,
*(ppatches[0][1]->mDataZ
+ poffsets[0][1][0]
// <FS:CR> Aurora Sim
//+ poffsets[0][1][1]*surface_stride));
+ poffsets[0][1][1]*poffsets[0][1][2]));
// </FS:CR> Aurora Sim
LLVector3 p10(+mpg,-mpg,
*(ppatches[1][0]->mDataZ
+ poffsets[1][0][0]
// <FS:CR> Aurora Sim
//+ poffsets[1][0][1]*surface_stride));
+ poffsets[1][0][1]*poffsets[1][0][2]));
// </FS:CR> Aurora Sim
LLVector3 p11(+mpg,+mpg,
*(ppatches[1][1]->mDataZ
+ poffsets[1][1][0]
// <FS:CR> Aurora Sim
//+ poffsets[1][1][1]*surface_stride));
+ poffsets[1][1][1]*poffsets[1][1][2]));
// </FS:CR> Aurora Sim
@@ -520,18 +497,6 @@ void LLSurfacePatch::updateNormals()
// update the north edge
if (mNormalsInvalid[NORTHEAST] || mNormalsInvalid[NORTH] || mNormalsInvalid[NORTHWEST])
{
// <FS:CR> Aurora Sim
/*
if(!getNeighborPatch(EAST) && getNeighborPatch(NORTHEAST))
{
if(getNeighborPatch(NORTHEAST)->getHasReceivedData())
{
*(getNeighborPatch(NORTHEAST)->mDataZ) = 100.0f;
}
}
*/
// </FS:CR> Aurora Sim
for (i = 0; i <= grids_per_patch_edge; i++)
{
calcNormal(i, grids_per_patch_edge, 2);
@@ -546,12 +511,9 @@ void LLSurfacePatch::updateNormals()
if (mNormalsInvalid[NORTHWEST] || mNormalsInvalid[WEST] || mNormalsInvalid[SOUTHWEST])
{
// <FS:CR> Aurora Sim
if(!getNeighborPatch(NORTH) && getNeighborPatch(NORTHWEST))
if (!getNeighborPatch(NORTH) && getNeighborPatch(NORTHWEST) && getNeighborPatch(NORTHWEST)->getHasReceivedData())
{
if(getNeighborPatch(NORTHWEST)->getHasReceivedData())
{
*(mDataZ + grids_per_patch_edge*grids_per_edge) = *(getNeighborPatch(NORTHWEST)->mDataZ + grids_per_patch_edge);
}
*(mDataZ + grids_per_patch_edge*grids_per_edge) = *(getNeighborPatch(NORTHWEST)->mDataZ + grids_per_patch_edge);
}
// </FS:CR> Aurora Sim
@@ -567,13 +529,9 @@ void LLSurfacePatch::updateNormals()
if (mNormalsInvalid[SOUTHWEST] || mNormalsInvalid[SOUTH] || mNormalsInvalid[SOUTHEAST])
{
// <FS:CR> Aurora Sim
if(!getNeighborPatch(EAST) && getNeighborPatch(SOUTHEAST))
if (!getNeighborPatch(EAST) && getNeighborPatch(SOUTHEAST) && getNeighborPatch(SOUTHEAST)->getHasReceivedData())
{
if(getNeighborPatch(SOUTHEAST)->getHasReceivedData())
{
*(mDataZ + grids_per_patch_edge) =
*(getNeighborPatch(SOUTHEAST)->mDataZ + grids_per_patch_edge * getNeighborPatch(SOUTHEAST)->getSurface()->getGridsPerEdge());
}
*(mDataZ + grids_per_patch_edge) = *(getNeighborPatch(SOUTHEAST)->mDataZ + grids_per_patch_edge * getNeighborPatch(SOUTHEAST)->getSurface()->getGridsPerEdge());
}
// </FS:CR> Aurora Sim
@@ -658,19 +616,13 @@ void LLSurfacePatch::updateNormals()
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) {
if (own_ypos >= neighbor_ypos)
neighbor_offset = own_ypos - neighbor_ypos;
}
else {
else
own_offset = neighbor_ypos - own_ypos;
}
// </FS:CR> Aurora Sim
*(mDataZ + grids_per_patch_edge + grids_per_patch_edge*grids_per_edge) =
*(getNeighborPatch(NORTHEAST)->mDataZ +
// <FS:CR> Aurora Sim
(grids_per_edge + neighbor_offset - own_offset - 1) *
getNeighborPatch(NORTHEAST)->getSurface()->getGridsPerEdge() );
*(getNeighborPatch(NORTHEAST)->mDataZ + (grids_per_edge + neighbor_offset - own_offset - 1) * getNeighborPatch(NORTHEAST)->getSurface()->getGridsPerEdge());
// </FS:CR> Aurora Sim
}
}

View File

@@ -4410,21 +4410,6 @@ void process_teleport_finish(LLMessageSystem* msg, void**)
U32 teleport_flags;
msg->getU32Fast(_PREHASH_Info, _PREHASH_TeleportFlags, teleport_flags);
// <FS:CR> 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;
}
// </FS:CR> Aurora Sim
std::string seedCap;
msg->getStringFast(_PREHASH_Info, _PREHASH_SeedCapability, seedCap);
@@ -4444,9 +4429,11 @@ void process_teleport_finish(LLMessageSystem* msg, void**)
// Viewer trusts the simulator.
gMessageSystem->enableCircuit(sim_host, TRUE);
// <FS:CR> 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);
U32 region_size_x = 256;
msg->getU32Fast(_PREHASH_Info, _PREHASH_RegionSizeX, region_size_x);
LLWorld::getInstance()->setRegionWidth(region_size_x);
// </FS:CR> Aurora Sim
LLViewerRegion* regionp = LLWorld::getInstance()->addRegion(region_handle, sim_host);
/*
// send camera update to new region
@@ -4769,26 +4756,14 @@ void process_crossed_region(LLMessageSystem* msg, void**)
std::string seedCap;
msg->getStringFast(_PREHASH_RegionData, _PREHASH_SeedCapability, seedCap);
// <FS:CR> 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;
}
// </FS:CR> Aurora Sim
send_complete_agent_movement(sim_host);
// <FS:CR> 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);
U32 region_size_x = 256;
msg->getU32(_PREHASH_RegionData, _PREHASH_RegionSizeX, region_size_x);
LLWorld::getInstance()->setRegionWidth(region_size_x);
// </FS:CR> Aurora Sim
LLViewerRegion* regionp = LLWorld::getInstance()->addRegion(region_handle, sim_host);
regionp->setSeedCapability(seedCap);
}

View File

@@ -146,10 +146,7 @@ LLViewerParcelMgr::LLViewerParcelMgr()
mCollisionParcel = new LLParcel();
// <FS:CR> 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(8192.f / PARCEL_GRID_STEP_METERS); // 8192 is the maximum region size on Aurora and solves the audio problem.
//mParcelsPerEdge = S32( REGION_WIDTH_METERS / PARCEL_GRID_STEP_METERS );
// </FS:CR> Aurora Sim
mHighlightSegments = new U8[(mParcelsPerEdge+1)*(mParcelsPerEdge+1)];
@@ -175,7 +172,7 @@ LLViewerParcelMgr::LLViewerParcelMgr()
}
// <FS:CR> Aurora Sim
mParcelsPerEdge = S32( REGION_WIDTH_METERS / PARCEL_GRID_STEP_METERS );
mParcelsPerEdge = S32(REGION_WIDTH_METERS / PARCEL_GRID_STEP_METERS);
// </FS:CR> Aurora Sim
mTeleportInProgress = TRUE; // the initial parcel update is treated like teleport
@@ -184,7 +181,7 @@ LLViewerParcelMgr::LLViewerParcelMgr()
// <FS:CR> Aurora Sim
void LLViewerParcelMgr::init(F32 region_size)
{
mParcelsPerEdge = S32( region_size / PARCEL_GRID_STEP_METERS );
mParcelsPerEdge = S32(region_size / PARCEL_GRID_STEP_METERS);
}
// </FS:CR> Aurora Sim
@@ -472,8 +469,7 @@ void LLViewerParcelMgr::selectCollisionParcel()
//mEastNorth += LLVector3d(PARCEL_GRID_STEP_METERS, PARCEL_GRID_STEP_METERS, 0.0);
mWestSouth = getSelectionRegion()->getOriginGlobal();
mEastNorth = mWestSouth;
mEastNorth += LLVector3d((getSelectionRegion()->getWidth() / REGION_WIDTH_METERS) * PARCEL_GRID_STEP_METERS,
(getSelectionRegion()->getWidth() / REGION_WIDTH_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);
// </FS:CR> Aurora Sim
// BUG: must be in the sim you are in
@@ -1500,13 +1496,11 @@ void LLViewerParcelMgr::processParcelProperties(LLMessageSystem *msg, void **use
LLViewerParcelMgr& parcel_mgr = LLViewerParcelMgr::instance();
// <FS:CR> 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 );
}
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);
// </FS:CR> Aurora Sim
msg->getS32Fast(_PREHASH_ParcelData, _PREHASH_RequestResult, request_result );

View File

@@ -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"
@@ -504,13 +505,6 @@ void LLViewerRegion::setWaterHeight(F32 water_level)
mImpl->mLandp->setWaterHeight(water_level);
}
// <FS:CR> Aurora Sim
void LLViewerRegion::rebuildWater()
{
mImpl->mLandp->rebuildWater();
}
// <FS:CR> Aurora Sim
F32 LLViewerRegion::getWaterHeight() const
{
return mImpl->mLandp->getWaterHeight();
@@ -856,20 +850,13 @@ LLVLComposition * LLViewerRegion::getComposition() const
F32 LLViewerRegion::getCompositionXY(const S32 x, const S32 y) const
{
// Singu Note: The Aurora Sim patches here were too many to read the code itself, mWidth and getWidth() (-1) replace 256 (255) in this function, only the first and last tags remain
// <FS:CR> Aurora Sim
//if (x >= 256)
if (x >= mWidth)
// </FS:CR> Aurora Sim
{
// <FS:CR> Aurora Sim
//if (y >= 256)
if (y >= mWidth)
// </FS:CR> Aurora Sim
{
// <FS:CR> Aurora Sim
//LLVector3d center = getCenterGlobal() + LLVector3d(256.f, 256.f, 0.f);
LLVector3d center = getCenterGlobal() + LLVector3d(mWidth, mWidth, 0.f);
// </FS:CR> Aurora Sim
LLViewerRegion *regionp = LLWorld::getInstance()->getRegionFromPosGlobal(center);
if (regionp)
{
@@ -878,12 +865,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.
// <FS:CR> 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());
// </FS:CR> Aurora Sim
while (llabs(our_comp - adj_comp) >= 1.f)
{
if (our_comp > adj_comp)
@@ -900,10 +883,7 @@ F32 LLViewerRegion::getCompositionXY(const S32 x, const S32 y) const
}
else
{
// <FS:CR> Aurora Sim
//LLVector3d center = getCenterGlobal() + LLVector3d(256.f, 0, 0.f);
LLVector3d center = getCenterGlobal() + LLVector3d(mWidth, 0.f, 0.f);
// </FS:CR> Aurora Sim
LLViewerRegion *regionp = LLWorld::getInstance()->getRegionFromPosGlobal(center);
if (regionp)
{
@@ -912,12 +892,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.
// <FS:CR> 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);
// </FS:CR> Aurora Sim
while (llabs(our_comp - adj_comp) >= 1.f)
{
if (our_comp > adj_comp)
@@ -933,15 +909,9 @@ F32 LLViewerRegion::getCompositionXY(const S32 x, const S32 y) const
}
}
}
// <FS:CR> Aurora Sim
//else if (y >= 256)
else if (y >= mWidth)
// </FS:CR> Aurora Sim
{
// <FS:CR> Aurora Sim
//LLVector3d center = getCenterGlobal() + LLVector3d(0.f, 256.f, 0.f);
LLVector3d center = getCenterGlobal() + LLVector3d(0.f, mWidth, 0.f);
// </FS:CR> Aurora Sim
LLViewerRegion *regionp = LLWorld::getInstance()->getRegionFromPosGlobal(center);
if (regionp)
{
@@ -950,9 +920,6 @@ 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.
// <FS:CR> 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());
// <FS:CR> Aurora Sim
@@ -1699,9 +1666,6 @@ void LLViewerRegionImpl::buildCapabilityNames(LLSD& capabilityNames)
capabilityNames.append("CustomMenuAction");
capabilityNames.append("DispatchRegionInfo");
capabilityNames.append("EnvironmentSettings");
// <FS:CR> Aurora Sim
capabilityNames.append("DispatchOpenRegionSettings");
// </FS:CR> Aurora Sim
capabilityNames.append("EstateChangeInfo");
capabilityNames.append("EventQueueGet");
capabilityNames.append("FetchLib2");

View File

@@ -147,9 +147,6 @@ public:
void setWaterHeight(F32 water_level);
F32 getWaterHeight() const;
// <FS:CR> Aurora Sim
void rebuildWater();
// </FS:CR> Aurora Sim
BOOL isVoiceEnabled() const;

View File

@@ -50,13 +50,10 @@
#include "noise.h"
#include "v4color.h"
#include "llagent.h"
#include "llworld.h"
#include "llviewerregion.h"
const F32 CLOUD_DIVERGENCE_COEF = 0.5f;
// <FS:CR> Aurora Sim
#include "llviewerregion.h"
// </FS:CR> Aurora Sim
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
@@ -124,18 +121,12 @@ void LLWind::decompress(LLBitPack &bitpack, LLGroupHeader *group_headerp)
set_group_of_patch_header(group_headerp);
// X component
// <FS:CR> Aurora Sim
//decode_patch_header(bitpack, &patch_header);
decode_patch_header(bitpack, &patch_header, FALSE);
// </FS:CR> Aurora Sim
decode_patch_header(bitpack, &patch_header);
decode_patch(bitpack, buffer);
decompress_patch(mVelX, buffer, &patch_header);
// Y component
// <FS:CR> Aurora Sim
//decode_patch_header(bitpack, &patch_header);
decode_patch_header(bitpack, &patch_header, FALSE);
// </FS:CR> Aurora Sim
decode_patch_header(bitpack, &patch_header);
decode_patch(bitpack, buffer);
decompress_patch(mVelY, buffer, &patch_header);
@@ -333,7 +324,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)
{

View File

@@ -80,6 +80,7 @@ const S32 MAX_NUMBER_OF_CLOUDS = 750;
const S32 WORLD_PATCH_SIZE = 16;
extern LLColor4U MAX_WATER_COLOR;
// <FS:CR> Aurora Sim
//const U32 LLWorld::mWidth = 256;
U32 LLWorld::mWidth = 256;
@@ -151,8 +152,13 @@ void LLWorld::destroyClass()
}
}
void LLWorld::setRegionWidth(const U32 width)
{
mWidth = width ? width : 256; // Width of 0 is really 256
mWidthInMeters = mWidth * mScale;
}
LLViewerRegion* LLWorld::addRegion(const U64 &region_handle, const LLHost &host, const U32 &region_size_x, const U32 &region_size_y)
LLViewerRegion* LLWorld::addRegion(const U64 &region_handle, const LLHost &host)
{
llinfos << "Add region with handle: " << region_handle << " on host " << host << llendl;
LLViewerRegion *regionp = getRegionFromHandle(region_handle);
@@ -184,10 +190,6 @@ LLViewerRegion* LLWorld::addRegion(const U64 &region_handle, const LLHost &host,
U32 iindex = 0;
U32 jindex = 0;
// <FS:CR> Aurora Sim
mWidth = region_size_x; //MegaRegion
mWidthInMeters = mWidth * mScale; //MegaRegion
// </FS:CR> Aurora Sim
from_region_handle(region_handle, &iindex, &jindex);
// <FS:CR> Aurora Sim
//S32 x = (S32)(iindex/mWidth);
@@ -236,48 +238,51 @@ LLViewerRegion* LLWorld::addRegion(const U64 &region_handle, const LLHost &host,
F32 width = getRegionWidthInMeters();
LLViewerRegion *neighborp;
// <FS:CR> Aurora Sim
LLViewerRegion *last_neighborp;
// </FS:CR> Aurora Sim
from_region_handle(region_handle, &region_x, &region_y);
// Iterate through all directions, and connect neighbors if there.
S32 dir;
for (dir = 0; dir < 8; dir++)
{
// <FS:CR> Aurora Sim
last_neighborp = NULL;
// </FS:CR> Aurora Sim
adj_x = region_x + width * gDirAxes[dir][0];
adj_y = region_y + width * gDirAxes[dir][1];
// <FS:CR> 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;
for(S32 offset = 0; offset < width; offset += WORLD_PATCH_SIZE)
if (mWidth == 256)
{
to_region_handle(adj_x, adj_y, &adj_handle);
neighborp = getRegionFromHandle(adj_handle);
if (neighborp && last_neighborp != neighborp)
if (neighborp)
{
//llinfos << "Connecting " << region_x << ":" << region_y << " -> " << adj_x << ":" << adj_y << " dir:" << dir << llendl;
//llinfos << "Connecting " << region_x << ":" << region_y << " -> " << adj_x << ":" << adj_y << llendl;
regionp->connectNeighbor(neighborp, dir);
last_neighborp = neighborp;
}
}
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;
if(dir == NORTHEAST ||
dir == NORTHWEST ||
dir == SOUTHWEST ||
dir == SOUTHEAST)
for (S32 offset = 0; offset < width; offset += WORLD_PATCH_SIZE)
{
break;
}
to_region_handle(adj_x, adj_y, &adj_handle);
neighborp = getRegionFromHandle(adj_handle);
if(dir == NORTH || dir == SOUTH) adj_x += WORLD_PATCH_SIZE;
if(dir == EAST || dir == WEST) adj_y += WORLD_PATCH_SIZE;
// </FS:CR> Aurora Sim
if (neighborp && last_neighborp != neighborp)
{
//llinfos << "Connecting " << region_x << ":" << region_y << " -> " << adj_x << ":" << adj_y << llendl;
regionp->connectNeighbor(neighborp, dir);
last_neighborp = neighborp;
}
if (dir == NORTH || dir == SOUTH)
adj_x += WORLD_PATCH_SIZE;
else if (dir == EAST || dir == WEST)
adj_y += WORLD_PATCH_SIZE;
else if (dir == NORTHEAST || dir == NORTHWEST || dir == SOUTHWEST || dir == SOUTHEAST)
break;
}
}
}
@@ -917,7 +922,7 @@ void LLWorld::setLandFarClip(const F32 far_clip)
{
// <FS:CR> Aurora Sim
//static S32 const rwidth = (S32)REGION_WIDTH_U32;
static S32 const rwidth = (S32)getRegionWidthInMeters();
S32 const rwidth = (S32)getRegionWidthInMeters();
// </FS:CR> Aurora Sim
S32 const n1 = (llceil(mLandFarClip) - 1) / rwidth;
S32 const n2 = (llceil(far_clip) - 1) / rwidth;
@@ -993,8 +998,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.
@@ -1011,15 +1018,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(), &region_x, &region_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.
@@ -1198,19 +1204,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);
}
@@ -1218,10 +1224,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
@@ -1350,25 +1356,14 @@ void process_enable_simulator(LLMessageSystem *msg, void **user_data)
// which simulator should we modify?
LLHost sim(ip_u32, port);
// <FS:CR> 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;
}
// </FS:CR> Aurora Sim
// Viewer trusts the simulator.
msg->enableCircuit(sim, TRUE);
// <FS:CR> Aurora Sim
//LLWorld::getInstance()->addRegion(handle, sim);
LLWorld::getInstance()->addRegion(handle, sim, region_size_x, region_size_y);
U32 region_size_x = 256;
msg->getU32Fast(_PREHASH_SimulatorInfo, _PREHASH_RegionSizeX, region_size_x);
LLWorld::getInstance()->setRegionWidth(region_size_x);
// </FS:CR> Aurora Sim
LLWorld::getInstance()->addRegion(handle, sim);
// give the simulator a message it can use to get ip and port
llinfos << "simulator_enable() Enabling " << sim << " with code " << msg->getOurCircuitCode() << llendl;

View File

@@ -71,11 +71,7 @@ public:
LLWorld();
void destroyClass();
// <FS:CR> Aurora Sim
void updateLimits(); // <FS:CR> Aurora Sim
//LLViewerRegion* addRegion(const U64 &region_handle, const LLHost &host);
LLViewerRegion* addRegion(const U64 &region_handle, const LLHost &host, const U32 &region_size_x, const U32 &region_size_y);
// <FS:CR> Aurora Sim
LLViewerRegion* addRegion(const U64 &region_handle, const LLHost &host);
// safe to call if already present, does the "right thing" if
// hosts are same, or if hosts are different, etc...
void removeRegion(const LLHost &host);
@@ -118,6 +114,9 @@ public:
LLSurfacePatch * resolveLandPatchGlobal(const LLVector3d &position);
LLVector3 resolveLandNormalGlobal(const LLVector3d &position); // absolute frame
// update region size
void setRegionWidth(const U32 width = 0);
U32 getRegionWidthInPoints() const { return mWidth; }
F32 getRegionScale() const { return mScale; }

View File

@@ -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"
@@ -94,12 +95,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, LLGLTexture::BOOST_MAP, LLViewerTexture::LOD_TEXTURE);
if (is_aurora) mLayerImage[SIM_LAYER_OVERLAY]->forceImmediateUpdate();
mLayerImage[SIM_LAYER_OVERLAY]->setAddressMode(LLTexUnit::TAM_CLAMP);
}
else
@@ -378,32 +384,28 @@ LLSimInfo* LLWorldMap::simInfoFromPosGlobal(const LLVector3d& pos_global)
LLSimInfo* LLWorldMap::simInfoFromHandle(const U64 handle)
{
// <FS:CR> Aurora Sim
//sim_info_map_t::iterator it = mSimInfoMap.find(handle);
//if (it != mSimInfoMap.end())
//{
// return it->second;
std::map<U64, LLSimInfo*>::const_iterator it;
for (it = LLWorldMap::getInstance()->mSimInfoMap.begin(); it != LLWorldMap::getInstance()->mSimInfoMap.end(); ++it)
sim_info_map_t::const_iterator it = mSimInfoMap.find(handle);
if (it != mSimInfoMap.end())
{
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;
}
// </FS:CR> Aurora Sim
return it->second;
}
// <FS:CR> Aurora Sim
U32 x = 0, y = 0;
from_region_handle(handle, &x, &y);
for (it = mSimInfoMap.begin(); it != mSimInfoMap.end(); ++it)
{
U32 checkRegionX, checkRegionY;
from_region_handle((*it).first, &checkRegionX, &checkRegionY);
LLSimInfo* info = (*it).second;
if (x >= checkRegionX && x < (checkRegionX + info->getSizeX()) &&
y >= checkRegionY && y < (checkRegionY + info->getSizeY()))
{
return info;
}
}
// </FS:CR> Aurora Sim
return NULL;
}

View File

@@ -142,9 +142,11 @@ public:
// Setters
void setName(std::string& name) { mName = name; }
// <FS:CR> Aurora Sim
void setSize(U16 sizeX, U16 sizeY) { mSizeX = sizeX; mSizeY = sizeY; }
// </FS:CR> Aurora Sim
void setAccess (U32 accesscode) { mAccess = accesscode; }
void setRegionFlags (U32 region_flags) { mRegionFlags = region_flags; }
void setSize(U16 sizeX, U16 sizeY) { mSizeX = sizeX; mSizeY = sizeY; }
void setAlpha(F32 alpha) { mAlpha = alpha; }
void setLandForSaleImage (LLUUID image_id);
@@ -160,8 +162,11 @@ public:
LLPointer<LLViewerFetchedTexture> getLandForSaleImage(); // Get the overlay image, fetch it if necessary
const F32 getAlpha() const { return mAlpha; }
// <FS:CR> Aurora Sim
const U64& getHandle() const { return mHandle; }
const U16 getSizeX() const { return mSizeX; }
const U16 getSizeY() const { return mSizeY; }
// </FS:CR> Aurora Sim
bool isName(const std::string& name) const;
bool isDown() { return (mAccess == SIM_ACCESS_DOWN); }
bool isPG() { return (mAccess <= SIM_ACCESS_PG); }
@@ -192,15 +197,13 @@ 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:
private:
U64 mHandle; // This is a hash of the X and Y world coordinates of the SW corner of the sim
// <FS:CR> Aurora Sim
U16 mSizeX;
U16 mSizeY;
private:
// </FS:CR> Aurora Sim
std::string mName;
F64 mAgentsUpdateTime; // Time stamp giving the last time the agents information was requested for that region