diff --git a/indra/llcommon/indra_constants.h b/indra/llcommon/indra_constants.h
index 8d961167d4..f48604333d 100644
--- a/indra/llcommon/indra_constants.h
+++ b/indra/llcommon/indra_constants.h
@@ -147,6 +147,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 d7658862da..9ef3aa722d 100644
--- a/indra/llmessage/message_prehash.cpp
+++ b/indra/llmessage/message_prehash.cpp
@@ -1376,3 +1376,10 @@ char const* const _PREHASH_ProductSKU = LLMessageStringTable::getInstance()->get
char const* const _PREHASH_SeeAVs = LLMessageStringTable::getInstance()->getString("SeeAVs");
char const* const _PREHASH_AnyAVSounds = LLMessageStringTable::getInstance()->getString("AnyAVSounds");
char const* const _PREHASH_GroupAVSounds = LLMessageStringTable::getInstance()->getString("GroupAVSounds");
+
+// 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 da2b613f53..b63951463f 100644
--- a/indra/llmessage/message_prehash.h
+++ b/indra/llmessage/message_prehash.h
@@ -1376,4 +1376,11 @@ extern char const* const _PREHASH_ProductSKU;
extern char const* const _PREHASH_SeeAVs;
extern char const* const _PREHASH_AnyAVSounds;
extern char const* const _PREHASH_GroupAVSounds;
+
+// 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 e5d7f19448..6ab3a6e110 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 4c87c9808a..0b9091f431 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 101231ec84..d9c3ec7a53 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/fsgridhandler.cpp b/indra/newview/fsgridhandler.cpp
index cfbcf064af..832c74d78b 100644
--- a/indra/newview/fsgridhandler.cpp
+++ b/indra/newview/fsgridhandler.cpp
@@ -181,6 +181,9 @@ LLGridManager::LLGridManager()
: mIsInSLMain(false),
mIsInSLBeta(false),
mIsInOpenSim(false),
+// Aurora Sim
+ mIsInAuroraSim(false),
+// Aurora Sim
mReadyToLogin(false),
mCommandLineDone(false),
mResponderCount(0)
@@ -539,6 +542,71 @@ void LLGridManager::gridInfoResponderCB(GridEntry* grid_entry)
LL_DEBUGS("GridManager") << "[\""<grid[check] << LL_ENDL;
continue;
}
+// Aurora Sim
+ check = "search";
+ if (node->hasName(check))
+ {
+ grid_entry->grid[GRID_SEARCH] = node->getTextContents();
+ LL_DEBUGS("GridManager") << "[\""<grid[GRID_SEARCH] << LL_ENDL;
+ continue;
+ }
+ check = "profileuri";
+ if (node->hasName(check))
+ {
+ grid_entry->grid[GRID_PROFILE_URI_VALUE] = node->getTextContents();
+ LL_DEBUGS("GridManager") << "[\""<grid[GRID_PROFILE_URI_VALUE] << LL_ENDL;
+ continue;
+ }
+ check = "SendGridInfoToViewerOnLogin";
+ if (node->hasName(check))
+ {
+ grid_entry->grid[GRID_SENDGRIDINFO] = node->getTextContents();
+ LL_DEBUGS("GridManager") << "[\""<grid[GRID_SENDGRIDINFO] << LL_ENDL;
+ continue;
+ }
+ check = "DirectoryFee";
+ if (node->hasName(check))
+ {
+ grid_entry->grid[GRID_DIRECTORY_FEE] = node->getTextContents();
+ LL_DEBUGS("GridManager") << "[\""<grid[GRID_DIRECTORY_FEE] << LL_ENDL;
+ continue;
+ }
+ check = "CurrencySymbol";
+ if (node->hasName(check))
+ {
+ grid_entry->grid[GRID_CURRENCY_SYMBOL] = node->getTextContents();
+ LL_DEBUGS("GridManager") << "[\""<grid[GRID_CURRENCY_SYMBOL] << LL_ENDL;
+ continue;
+ }
+ check = "RealCurrencySymbol";
+ if (node->hasName(check))
+ {
+ grid_entry->grid[GRID_REAL_CURRENCY_SYMBOL] = node->getTextContents();
+ LL_DEBUGS("GridManager") << "[\""<grid[GRID_REAL_CURRENCY_SYMBOL] << LL_ENDL;
+ continue;
+ }
+ check = "MaxGroups";
+ if (node->hasName(check))
+ {
+ grid_entry->grid[GRID_MAXGROUPS] = node->getTextContents();
+ LL_DEBUGS("GridManager") << "[\""<grid[GRID_MAXGROUPS] << LL_ENDL;
+ continue;
+ }
+ check = "platform";
+ if (node->hasName(check))
+ {
+ grid_entry->grid[GRID_PLATFORM] = node->getTextContents();
+ LL_DEBUGS("GridManager") << "[\""<grid[GRID_PLATFORM] << LL_ENDL;
+ continue;
+ }
+ check = "message";
+ if (node->hasName(check))
+ {
+ grid_entry->grid[GRID_MESSAGE] = node->getTextContents();
+ LL_DEBUGS("GridManager") << "[\""<grid[GRID_MESSAGE] << LL_ENDL;
+ continue;
+ }
+// Aurora Sim
check = "helperuri";
if (node->hasName(check))
{
@@ -1253,6 +1321,9 @@ void LLGridManager::updateIsInProductionGrid()
mIsInSLMain = false;
mIsInSLBeta = false;
mIsInOpenSim = false;
+// Aurora Sim
+ mIsInAuroraSim = false;
+// Aurora Sim
// *NOTE:Mani This used to compare GRID_INFO_AGNI to gGridChoice,
// but it seems that loginURI trumps that.
@@ -1281,6 +1352,15 @@ void LLGridManager::updateIsInProductionGrid()
return;
}
+// Aurora Sim
+ if(mGridList[mGrid][GRID_PLATFORM].asString() == "Aurora") {
+ LL_DEBUGS("GridManager")<< "uri: "<< uris[0] << "set isInAuroraSim" << LL_ENDL;
+ mIsInAuroraSim = true;
+ mIsInOpenSim = true; //also enable opensim related options here
+ return;
+ }
+// Aurora Sim
+
// TPVP compliance: a SL login screen must connect to SL.
// NOTE: This is more TPVP compliant than LLs own viewer, where
// setting the command line login page can be used for spoofing.
diff --git a/indra/newview/fsgridhandler.h b/indra/newview/fsgridhandler.h
index a9071c8a27..8c5b1ea93c 100644
--- a/indra/newview/fsgridhandler.h
+++ b/indra/newview/fsgridhandler.h
@@ -52,6 +52,19 @@ extern const char* DEFAULT_LOGIN_PAGE;
#define GRID_IS_FAVORITE_VALUE "favorite"
#define GRID_REGISTER_NEW_ACCOUNT "register"
#define GRID_FORGOT_PASSWORD "password"
+// Aurora Sim
+#define GRID_HELP "help"
+#define GRID_ABOUT "about"
+#define GRID_SEARCH "search"
+#define GRID_PROFILE_URI_VALUE "profileuri"
+#define GRID_SENDGRIDINFO "SendGridInfoToViewerOnLogin"
+#define GRID_DIRECTORY_FEE "DirectoryFee"
+#define GRID_CURRENCY_SYMBOL "CurrencySymbol"
+#define GRID_REAL_CURRENCY_SYMBOL "RealCurrencySymbol"
+#define GRID_MAXGROUPS "MaxGroups"
+#define GRID_PLATFORM "platform"
+#define GRID_MESSAGE "message"
+// Aurora Sim
//
#define GRID_IS_SYSTEM_GRID_VALUE "system_grid"
#define GRID_IS_FAVORITE_VALUE "favorite"
@@ -235,6 +248,9 @@ public:
bool isInSLMain();
bool isInSLBeta();
bool isInOpenSim();
+// Aurora Sim
+ bool isInAuroraSim();
+// Aurora Sim
void saveGridList();
//
void clearFavorites();
@@ -269,6 +285,9 @@ protected:
bool mIsInSLMain;
bool mIsInSLBeta;
bool mIsInOpenSim;
+// Aurora Sim
+ bool mIsInAuroraSim;
+// Aurora Sim
int mResponderCount;
bool mReadyToLogin;
bool mCommandLineDone;
diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp
index 119c848155..9306039bf0 100644
--- a/indra/newview/llagent.cpp
+++ b/indra/newview/llagent.cpp
@@ -2578,7 +2578,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();
diff --git a/indra/newview/llavatarlistitem.cpp b/indra/newview/llavatarlistitem.cpp
index 138f0c43b7..cedfe61c73 100644
--- a/indra/newview/llavatarlistitem.cpp
+++ b/indra/newview/llavatarlistitem.cpp
@@ -53,6 +53,8 @@
#include "llnotificationsutil.h"
#include "llvoiceclient.h"
+#include "llworld.h" // Aurora Sim
+
bool LLAvatarListItem::sStaticInitialized = false;
S32 LLAvatarListItem::sLeftPadding = 0;
S32 LLAvatarListItem::sNameRightPadding = 0;
@@ -443,9 +445,15 @@ void LLAvatarListItem::setRange(F32 distance)
// Get default style params
LLStyle::Params rangeHighlight = LLStyle::Params();
- if (mUseRangeColors && mDistance > CHAT_NORMAL_RADIUS)
+// Aurora Sim
+ //if (mUseRangeColors && mDistance > CHAT_NORMAL_RADIUS)
+ if (mUseRangeColors && mDistance > LLWorld::getInstance()->getSayDistance())
+// Aurora Sim
{
- if (mDistance < CHAT_SHOUT_RADIUS)
+// Aurora Sim
+ //if (mDistance < CHAT_SHOUT_RADIUS)
+ if (mDistance < LLWorld::getInstance()->getShoutDistance())
+// Aurora Sim
{
rangeHighlight.color = mShoutRangeColor;
}
diff --git a/indra/newview/llfloatermap.cpp b/indra/newview/llfloatermap.cpp
index 22d6b37032..3dfb1cfab7 100644
--- a/indra/newview/llfloatermap.cpp
+++ b/indra/newview/llfloatermap.cpp
@@ -47,6 +47,7 @@
#include "rlvhandler.h"
#include "llviewermenu.h"
+#include "llworld.h" // Aurora Sim />
//
// Constants
@@ -269,7 +270,13 @@ void LLFloaterMap::draw()
mPopupMenu->setItemEnabled("Stop Tracking", true);
}
- LLFloater::draw();
+// Aurora Sim
+ //LLFloater::draw();
+ if(LLWorld::getInstance()->getAllowMinimap())
+ {
+ LLFloater::draw();
+ }
+// Aurora Sim
}
void LLFloaterMap::stretchMiniMap(S32 width,S32 height)
@@ -369,4 +376,4 @@ void LLFloaterMap::handleStartTracking()
{
mMap->startTracking();
}
-// Avatar tracking feature
\ No newline at end of file
+// Avatar tracking feature
diff --git a/indra/newview/llfloatertools.cpp b/indra/newview/llfloatertools.cpp
index 7e197827d5..e2c7327ff3 100644
--- a/indra/newview/llfloatertools.cpp
+++ b/indra/newview/llfloatertools.cpp
@@ -91,6 +91,8 @@
#include "llselectmgr.h"
#include "llmeshrepository.h"
+#include "llviewernetwork.h" // Aurora Sim
+
// Globals
LLFloaterTools *gFloaterTools = NULL;
bool LLFloaterTools::sShowObjectCost = true;
@@ -220,6 +222,13 @@ LLPCode toolData[]={
LL_PCODE_LEGACY_TREE,
LL_PCODE_LEGACY_GRASS};
+// Aurora Sim
+void LLFloaterTools::updateToolsSizeLimits()
+{
+ mPanelObject->updateLimits();
+}
+// Aurora Sim
+
BOOL LLFloaterTools::postBuild()
{
// Hide until tool selected
diff --git a/indra/newview/llfloatertools.h b/indra/newview/llfloatertools.h
index deda52dd45..176c0b0ed4 100644
--- a/indra/newview/llfloatertools.h
+++ b/indra/newview/llfloatertools.h
@@ -65,6 +65,9 @@ public:
static void* createPanelContents(void* vdata);
static void* createPanelLandInfo(void* vdata);
+// Aurora Sim
+ void updateToolsSizeLimits();
+// Aurora Sim
LLFloaterTools(const LLSD& key);
virtual ~LLFloaterTools();
diff --git a/indra/newview/llfloaterworldmap.cpp b/indra/newview/llfloaterworldmap.cpp
index 98d38a6099..9a1c8a020b 100644
--- a/indra/newview/llfloaterworldmap.cpp
+++ b/indra/newview/llfloaterworldmap.cpp
@@ -664,8 +664,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
+ //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;
+// Aurora Sim
std::string full_name = llformat("%s (%d, %d, %d)",
sim_name.c_str(),
llround(region_x),
@@ -717,11 +723,20 @@ void LLFloaterWorldMap::enableTeleportCoordsDisplay( bool enabled )
void LLFloaterWorldMap::updateTeleportCoordsDisplay( const LLVector3d& pos )
{
// if we're going to update their value, we should also enable them
+// Aurora Sim
+ LLSimInfo* sim_info = LLWorldMap::getInstance()->simInfoFromPosGlobal(pos );
+// Aurora Sim
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 );
+// Aurora Sim
+ //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 );
+ U32 locX, locY;
+ from_region_handle(sim_info->getHandle(), &locX, &locY);
+ F32 region_local_x = pos.mdV[VX] - locX;
+ F32 region_local_y = pos.mdV[VY] - locY;
+// Aurora Sim
//F32 region_local_z = (F32)fmod( pos.mdV[VZ], (F64)REGION_WIDTH_METERS );
F32 region_local_z = (F32)pos.mdV[VZ];
diff --git a/indra/newview/llgiveinventory.cpp b/indra/newview/llgiveinventory.cpp
index 7585df38c4..d4f4acaa8b 100644
--- a/indra/newview/llgiveinventory.cpp
+++ b/indra/newview/llgiveinventory.cpp
@@ -51,6 +51,7 @@
#include "rlvhandler.h"
#include "rlvui.h"
// [/RLVa:KB]
+#include "llworld.h" // Aurora Sim
// MAX ITEMS is based on (sizeof(uuid)+2) * count must be < MTUBYTES
// or 18 * count < 1200 => count < 1200/18 => 66. I've cut it down a
@@ -269,7 +270,10 @@ bool LLGiveInventory::doGiveInventoryCategory(const LLUUID& to_agent,
give_successful = false;
}
count = items.count() + cats.count();
- if (count > MAX_ITEMS)
+// Aurora Sim
+ //if (count > MAX_ITEMS)
+ if (count > LLWorld::getInstance()->getMaxInventoryItemsTransfer())
+// Aurora Sim
{
LLNotificationsUtil::add("TooManyItems");
give_successful = false;
@@ -552,7 +556,10 @@ bool LLGiveInventory::commitGiveInventoryCategory(const LLUUID& to_agent,
// MTUBYTES or 18 * count < 1200 => count < 1200/18 =>
// 66. I've cut it down a bit from there to give some pad.
S32 count = items.count() + cats.count();
- if (count > MAX_ITEMS)
+// Aurora Sim>
+ //if (count > MAX_ITEMS)
+ if (count > LLWorld::getInstance()->getMaxInventoryItemsTransfer())
+// Aurora Sim
{
LLNotificationsUtil::add("TooManyItems");
give_successful = false;
diff --git a/indra/newview/llglsandbox.cpp b/indra/newview/llglsandbox.cpp
index 982a047bb1..3f30734ab0 100644
--- a/indra/newview/llglsandbox.cpp
+++ b/indra/newview/llglsandbox.cpp
@@ -291,7 +291,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();
@@ -497,7 +500,10 @@ void LLViewerParcelMgr::renderOneSegment(F32 x1, F32 y1, F32 x2, F32 y2, F32 hei
{
// 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/llmanip.cpp b/indra/newview/llmanip.cpp
index b9e10db15f..26242c36cd 100644
--- a/indra/newview/llmanip.cpp
+++ b/indra/newview/llmanip.cpp
@@ -53,6 +53,7 @@
#include "llresmgr.h"
#include "pipeline.h"
#include "llglheaders.h"
+#include "llviewerregion.h" // Aurora Sim
// Local constants...
const S32 VERTICAL_OFFSET = 50;
@@ -414,7 +415,8 @@ 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 = LLWorld::getInstance()->getRegionWidthInMeters();
+ F32 region_size = object->getRegion()->getWidth();
const F32 LINE_ALPHA = 0.33f;
diff --git a/indra/newview/llmaniptranslate.cpp b/indra/newview/llmaniptranslate.cpp
index 6b2b7f985c..2ab817fc80 100644
--- a/indra/newview/llmaniptranslate.cpp
+++ b/indra/newview/llmaniptranslate.cpp
@@ -531,7 +531,10 @@ BOOL LLManipTranslate::handleHover(S32 x, S32 y, MASK mask)
// You can't move more than some distance from your original mousedown point.
if (gSavedSettings.getBOOL("LimitDragDistance"))
{
- F32 max_drag_distance = gSavedSettings.getF32("MaxDragDistance");
+// Aurora Sim
+ //F32 max_drag_distance = gSavedSettings.getF32("MaxDragDistance");
+ F32 max_drag_distance = LLWorld::getInstance()->getMaxDragDistance();
+// Aurora Sim
if (relative_move.magVecSquared() > max_drag_distance * max_drag_distance)
{
diff --git a/indra/newview/llnetmap.cpp b/indra/newview/llnetmap.cpp
index 10c64b06e3..a9b8114738 100644
--- a/indra/newview/llnetmap.cpp
+++ b/indra/newview/llnetmap.cpp
@@ -170,7 +170,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;
@@ -262,7 +265,10 @@ void LLNetMap::draw()
}
// figure out where agent is
- S32 region_width = llround(LLWorld::getInstance()->getRegionWidthInMeters());
+// 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)
@@ -277,8 +283,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
if (regionp == gAgent.getRegion())
{
@@ -539,13 +549,20 @@ void LLNetMap::draw()
static LLUICachedControl chat_ring("MiniMapChatRing", true);
if(chat_ring)
{
- drawRing(20.0, pos_map, map_chat_ring_color);
- drawRing(100.0, pos_map, map_shout_ring_color);
+// Aurora Sim
+ //drawRing(20.0, pos_map, map_chat_ring_color);
+ //drawRing(100.0, pos_map, map_shout_ring_color);
+ drawRing(LLWorld::getInstance()->getSayDistance(), pos_map, map_chat_ring_color);
+ drawRing(LLWorld::getInstance()->getShoutDistance(), pos_map, map_shout_ring_color);
+// Aurora Sim
}
}
// 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();
@@ -607,6 +624,9 @@ LLVector3 LLNetMap::globalPosToView(const LLVector3d& global_pos)
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
@@ -628,7 +648,10 @@ LLVector3 LLNetMap::globalPosToView(const LLVector3d& global_pos)
void LLNetMap::drawRing(const F32 radius, const LLVector3 pos_map, const LLUIColor& color)
{
- 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 radius_pixels = radius * meters_to_pixels;
glMatrixMode(GL_MODELVIEW);
@@ -680,7 +703,10 @@ LLVector3d LLNetMap::viewPosToGlobal( S32 x, S32 y )
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 );
@@ -1341,4 +1367,4 @@ void LLNetMap::performDoubleClickAction(LLVector3d pos_global)
break;
}
}
-// Synchronize double click handling throughout instances
\ No newline at end of file
+// Synchronize double click handling throughout instances
diff --git a/indra/newview/llpanelobject.cpp b/indra/newview/llpanelobject.cpp
index a38a1d0eac..2a75f122ea 100644
--- a/indra/newview/llpanelobject.cpp
+++ b/indra/newview/llpanelobject.cpp
@@ -334,6 +334,10 @@ BOOL LLPanelObject::postBuild()
// Start with everyone disabled
clearCtrls();
+// Aurora Sim
+ updateLimits();
+// Aurora Sim
+
return TRUE;
}
@@ -367,10 +371,16 @@ void LLPanelObject::updateLimits()
{
mLimitsNeedUpdate = false;
- mRegionMaxHeight = LLWorld::getInstance()->getRegionMaxHeight();
- mCtrlPosZ->setMaxValue(mRegionMaxHeight);
-
-
+// Aurora Sim
+ //mRegionMaxHeight = LLWorld::getInstance()->getRegionMaxHeight();
+ //mCtrlPosZ->setMaxValue(mRegionMaxHeight);
+ mCtrlPosX->setMinValue(LLWorld::getInstance()->getMinPrimXPos());
+ mCtrlPosX->setMaxValue(LLWorld::getInstance()->getMaxPrimXPos());
+ mCtrlPosY->setMinValue(LLWorld::getInstance()->getMinPrimYPos());
+ mCtrlPosY->setMaxValue(LLWorld::getInstance()->getMaxPrimYPos());
+ mCtrlPosZ->setMinValue(LLWorld::getInstance()->getMinPrimZPos());
+ mCtrlPosZ->setMaxValue(LLWorld::getInstance()->getMaxPrimZPos());
+// Aurora Sim
mMinScale = LLWorld::getInstance()->getRegionMinPrimScale();
mMaxScale = LLWorld::getInstance()->getRegionMaxPrimScale();
mCtrlScaleX->setMinValue(mMinScale);
@@ -386,6 +396,9 @@ void LLPanelObject::updateLimits()
mMinHoleSize = LLWorld::getInstance()->getRegionMinHoleSize();
mSpinScaleX->setMinValue(mMinHoleSize);
mSpinScaleY->setMinValue(mMinHoleSize);
+// Aurora Sim
+ mCheckPhysics->setEnabled(LLWorld::getInstance()->getAllowPhysicalPrims());
+// Aurora Sim
}
//
@@ -2400,8 +2413,12 @@ void LLPanelObject::onPastePos(const LLSD& data)
//clamp pos on non-attachments, just keep the prims on the sim
if (!mObject->isAttachment())
{
- mClipboardPos.mV[VX] = llclamp( mClipboardPos.mV[VX], 0.f, 256.f);
- mClipboardPos.mV[VY] = llclamp( mClipboardPos.mV[VY], 0.f, 256.f);
+// Aurora Sim
+ //mClipboardPos.mV[VX] = llclamp( mClipboardPos.mV[VX], 0.f, 256.f);
+ //mClipboardPos.mV[VY] = llclamp( mClipboardPos.mV[VY], 0.f, 256.f);
+ mClipboardPos.mV[VX] = llclamp( mClipboardPos.mV[VX], 0.f, gAgent.getRegion()->getWidth());
+ mClipboardPos.mV[VY] = llclamp( mClipboardPos.mV[VY], 0.f, gAgent.getRegion()->getWidth());
+// Aurora Sim
//height will get properly clammed by sendPosition
}
diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp
index 5fe08ff7e6..ccab2228dd 100644
--- a/indra/newview/llpanelpeople.cpp
+++ b/indra/newview/llpanelpeople.cpp
@@ -1018,7 +1018,10 @@ void LLPanelPeople::updateNearbyList()
if (lastRadarSweep.count(avId) == 0)
{
// chat alerts
- if (RadarReportChatRangeEnter && (avRange <= CHAT_NORMAL_RADIUS) && avRange > -1)
+// Aurora Sim
+ //if (RadarReportChatRangeEnter && (avRange <= CHAT_NORMAL_RADIUS) && avRange > -1)
+ if (RadarReportChatRangeEnter && (avRange <= LLWorld::getInstance()->getSayDistance()) && avRange > -1)
+// Aurora Sim
{
LLStringUtil::format_map_t args;
args["DISTANCE"] = llformat("%3.2f", avRange);
@@ -1070,14 +1073,20 @@ void LLPanelPeople::updateNearbyList()
rf = lastRadarSweep.find(avId)->second;
if (RadarReportChatRangeEnter || RadarReportChatRangeLeave )
{
- if (RadarReportChatRangeEnter && (avRange <= CHAT_NORMAL_RADIUS && avRange > -1) && (rf.lastDistance > CHAT_NORMAL_RADIUS || rf.lastDistance == -1))
+// Aurora Sim
+ //if (RadarReportChatRangeEnter && (avRange <= CHAT_NORMAL_RADIUS && avRange > -1) && (rf.lastDistance > CHAT_NORMAL_RADIUS || rf.lastDistance == -1))
+ if (RadarReportChatRangeEnter && (avRange <= LLWorld::getInstance()->getSayDistance() && avRange > -1) && (rf.lastDistance > LLWorld::getInstance()->getSayDistance() || rf.lastDistance == -1))
+// Aurora Sim
{
LLStringUtil::format_map_t args;
args["DISTANCE"] = llformat("%3.2f", avRange);
std::string message = getString("entering_chat_range", args);
LLAvatarNameCache::get(avId,boost::bind(&LLPanelPeople::radarAlertMsg, this, _1, _2, message));
}
- else if (RadarReportChatRangeLeave && (avRange > CHAT_NORMAL_RADIUS || avRange == -1) && (rf.lastDistance <= CHAT_NORMAL_RADIUS && rf.lastDistance > -1))
+// Aurora Sim
+ //else if (RadarReportChatRangeLeave && (avRange > CHAT_NORMAL_RADIUS || avRange == -1) && (rf.lastDistance <= CHAT_NORMAL_RADIUS && rf.lastDistance > -1))
+ else if (RadarReportChatRangeLeave && (avRange > LLWorld::getInstance()->getSayDistance() || avRange == -1) && (rf.lastDistance <= LLWorld::getInstance()->getSayDistance() && rf.lastDistance > -1))
+// Aurora Sim
LLAvatarNameCache::get(avId,boost::bind(&LLPanelPeople::radarAlertMsg, this, _1, _2, getString("leaving_chat_range")));
}
if ( RadarReportDrawRangeEnter || RadarReportDrawRangeLeave )
@@ -1125,14 +1134,20 @@ void LLPanelPeople::updateNearbyList()
if (RadarReportChatRangeEnter || RadarReportChatRangeLeave)
{
- if (RadarReportChatRangeEnter && (avRange <= CHAT_NORMAL_RADIUS && avRange > -1) && (rf.lastDistance > CHAT_NORMAL_RADIUS || rf.lastDistance == -1))
+// Aurora Sim
+ //if (RadarReportChatRangeEnter && (avRange <= CHAT_NORMAL_RADIUS && avRange > -1) && (rf.lastDistance > CHAT_NORMAL_RADIUS || rf.lastDistance == -1))
+ if (RadarReportChatRangeEnter && (avRange <= LLWorld::getInstance()->getSayDistance() && avRange > -1) && (rf.lastDistance > LLWorld::getInstance()->getSayDistance() || rf.lastDistance == -1))
+// Aurora Sim
{
LLStringUtil::format_map_t args;
args["DISTANCE"] = llformat("%3.2f", avRange);
std::string message = getString("entering_chat_range", args);
LLAvatarNameCache::get(avId,boost::bind(&LLPanelPeople::radarAlertMsg, this, _1, _2, message));
}
- else if (RadarReportChatRangeLeave && (avRange > CHAT_NORMAL_RADIUS || avRange == -1) && (rf.lastDistance <= CHAT_NORMAL_RADIUS && rf.lastDistance > -1))
+// Aurora Sim
+ //else if (RadarReportChatRangeLeave && (avRange > CHAT_NORMAL_RADIUS || avRange == -1) && (rf.lastDistance <= CHAT_NORMAL_RADIUS && rf.lastDistance > -1))
+ else if (RadarReportChatRangeLeave && (avRange > LLWorld::getInstance()->getSayDistance() || avRange == -1) && (rf.lastDistance <= LLWorld::getInstance()->getSayDistance() && rf.lastDistance > -1))
+// Aurora Sim
LLAvatarNameCache::get(avId,boost::bind(&LLPanelPeople::radarAlertMsg, this, _1, _2, getString("leaving_chat_range")));
}
if (RadarReportDrawRangeEnter || RadarReportDrawRangeLeave)
@@ -1357,7 +1372,10 @@ void LLPanelPeople::updateNearbyList()
if (!mNearbyList->contains(prevId))
{
radarFields rf = i->second;
- if (RadarReportChatRangeLeave && (rf.lastDistance <= CHAT_NORMAL_RADIUS) && rf.lastDistance > -1)
+// Aurora Sim
+ //if (RadarReportChatRangeLeave && (rf.lastDistance <= CHAT_NORMAL_RADIUS) && rf.lastDistance > -1)
+ if (RadarReportChatRangeLeave && (rf.lastDistance <= LLWorld::getInstance()->getSayDistance()) && rf.lastDistance > -1)
+// Aurora Sim
LLAvatarNameCache::get(prevId,boost::bind(&LLPanelPeople::radarAlertMsg, this, _1, _2, getString("leaving_chat_range")));
if (RadarReportDrawRangeLeave && (rf.lastDistance <= drawRadius) && rf.lastDistance > -1)
LLAvatarNameCache::get(prevId,boost::bind(&LLPanelPeople::radarAlertMsg, this, _1, _2, getString("leaving_draw_distance")));
diff --git a/indra/newview/llselectmgr.cpp b/indra/newview/llselectmgr.cpp
index 0f7f7be59b..8791a393ae 100644
--- a/indra/newview/llselectmgr.cpp
+++ b/indra/newview/llselectmgr.cpp
@@ -95,6 +95,10 @@
// [RLVa:KB] - Checked: 2011-05-22 (RLVa-1.3.1a)
#include "rlvhandler.h"
// [/RLVa:KB]
+// Aurora Sim
+#include "llviewernetwork.h"
+#include "llworld.h"
+// Aurora Sim
#include "llglheaders.h"
@@ -576,11 +580,19 @@ bool LLSelectMgr::linkObjects()
}
S32 object_count = LLSelectMgr::getInstance()->getSelection()->getObjectCount();
- if (object_count > MAX_CHILDREN_PER_TASK + 1)
+// Aurora Sim
+ //if (object_count > MAX_CHILDREN_PER_TASK + 1)
+ S32 object_max = LLWorld::getInstance()->getMaxLinkedPrims();
+
+ if (object_count > object_max + 1)
+// Aurora Sim
{
LLSD args;
args["COUNT"] = llformat("%d", object_count);
- int max = MAX_CHILDREN_PER_TASK+1;
+// Aurora Sim
+ //int max = MAX_CHILDREN_PER_TASK+1;
+ int max = object_max+1;
+// Aurora Sim
args["MAX"] = llformat("%d", max);
LLNotificationsUtil::add("UnableToLinkObjects", args);
return true;
diff --git a/indra/newview/llspeakers.cpp b/indra/newview/llspeakers.cpp
index 07d2f1ad6f..aa2f32fd26 100644
--- a/indra/newview/llspeakers.cpp
+++ b/indra/newview/llspeakers.cpp
@@ -920,7 +920,10 @@ void LLLocalSpeakerMgr::updateSpeakerList()
// pick up non-voice speakers in chat range
uuid_vec_t avatar_ids;
std::vector positions;
- LLWorld::getInstance()->getAvatars(&avatar_ids, &positions, gAgent.getPositionGlobal(), CHAT_NORMAL_RADIUS);
+// Aurora Sim
+ //LLWorld::getInstance()->getAvatars(&avatar_ids, &positions, gAgent.getPositionGlobal(), CHAT_NORMAL_RADIUS);
+ LLWorld::getInstance()->getAvatars(&avatar_ids, &positions, gAgent.getPositionGlobal(), LLWorld::getInstance()->getSayDistance());
+// Aurora Sim
for(U32 i=0; imStatus == LLSpeaker::STATUS_TEXT_ONLY)
{
LLVOAvatar* avatarp = (LLVOAvatar*)gObjectList.findObject(speaker_id);
- if (!avatarp || dist_vec_squared(avatarp->getPositionAgent(), gAgent.getPositionAgent()) > CHAT_NORMAL_RADIUS_SQUARED)
+// Aurora Sim
+ F32 say_distance_squared = (LLWorld::getInstance()->getSayDistance() * LLWorld::getInstance()->getSayDistance());
+ if (!avatarp || dist_vec_squared(avatarp->getPositionAgent(), gAgent.getPositionAgent()) > say_distance_squared)
+ //if (!avatarp || dist_vec_squared(avatarp->getPositionAgent(), gAgent.getPositionAgent()) > CHAT_NORMAL_RADIUS_SQUARED)
+// Aurora Sim
{
setSpeakerNotInChannel(speakerp);
}
diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp
index 6d62aa8fc4..47a622ff8e 100644
--- a/indra/newview/llstartup.cpp
+++ b/indra/newview/llstartup.cpp
@@ -301,7 +301,10 @@ LLSD transform_cert_args(LLPointer cert);
void general_cert_done(const LLSD& notification, const LLSD& response);
void trust_cert_done(const LLSD& notification, const LLSD& response);
void apply_udp_blacklist(const std::string& csv);
-bool process_login_success_response();
+// Aurora Sim
+//bool process_login_success_response();
+bool process_login_success_response(U32 &first_sim_size_x, U32 &first_sim_size_y);
+// Aurora Sim
void transition_back_to_login_panel(const std::string& emsg);
void cmdline_printchat(std::string message);
@@ -396,6 +399,10 @@ bool idle_startup()
static std::string auth_desc;
static std::string auth_message;
+// 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
@@ -1399,7 +1406,10 @@ bool idle_startup()
}
else if(LLLoginInstance::getInstance()->authSuccess())
{
- if(process_login_success_response())
+// Aurora Sim
+ //if(process_login_success_response())
+ if(process_login_success_response(first_sim_size_x,first_sim_size_y))
+// Aurora Sim
{
//
const std::string current_grid = LLGridManager::getInstance()->getGrid();
@@ -1500,7 +1510,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);
@@ -3461,7 +3474,10 @@ void apply_udp_blacklist(const std::string& csv)
}
-bool process_login_success_response()
+// Aurora Sim
+//bool process_login_success_response()
+bool process_login_success_response(U32 &first_sim_size_x, U32 &first_sim_size_y)
+// Aurora Sim
{
LLSD response = LLLoginInstance::getInstance()->getResponse();
@@ -3588,6 +3604,17 @@ bool process_login_success_response()
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 65393cc168..1c329bfd2b 100644
--- a/indra/newview/llsurface.cpp
+++ b/indra/newview/llsurface.cpp
@@ -170,6 +170,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);
@@ -288,13 +291,40 @@ void LLSurface::initTextures()
//
// Water texture
//
- if (gSavedSettings.getBOOL("RenderWater") )
+// Aurora Sim
+ //if (gSavedSettings.getBOOL("RenderWater") )
+ if (gSavedSettings.getBOOL("RenderWater") && LLWorld::getInstance()->getAllowRenderWater())
+// Aurora Sim
{
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(128.0, 128.0, DEFAULT_WATER_HEIGHT);
+// FS:CR> Aurora Sim
+ //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);
+ }
+}
+
+void LLSurface::rebuildWater()
+{
+ BOOL renderwater = gSavedSettings.getBOOL("RenderWater") && LLWorld::getInstance()->getAllowRenderWater();
+ 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);
}
}
@@ -324,8 +354,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);
@@ -363,15 +397,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]);
@@ -381,8 +452,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]);
@@ -390,18 +467,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]);
@@ -409,10 +499,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]);
@@ -422,19 +519,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);
@@ -443,10 +554,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]);
@@ -456,19 +574,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);
@@ -477,10 +609,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]);
@@ -490,20 +629,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);
@@ -512,10 +665,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]);
@@ -525,19 +685,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);
@@ -695,14 +869,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))
{
@@ -1224,7 +1413,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 8052fb0d18..6769e00159 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 5077c2c7e1..216026a0d5 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"
@@ -248,18 +249,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];
@@ -283,8 +299,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)
@@ -295,8 +314,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)
@@ -307,8 +329,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)
@@ -319,8 +344,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
}
}
}
@@ -329,19 +357,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;
@@ -476,6 +516,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);
@@ -489,6 +541,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);
@@ -500,6 +562,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);
@@ -528,7 +601,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
{
@@ -553,7 +629,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
{
@@ -570,8 +649,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
@@ -614,8 +710,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))
@@ -627,6 +727,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
{
@@ -638,7 +741,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
}
}
@@ -667,13 +774,12 @@ void LLSurfacePatch::updateNorthEdge()
}
// Update patchp's north edge ...
- for (i=0; i Aurora Sim
+ //F32 dist_near_chat = gAgent.getNearChatRadius();
+ //if (!avatarp || dist_vec_squared(avatarp->getPositionAgent(), gAgent.getPositionAgent()) > say_distance_squared)
+ F32 dist_near_chat = LLWorld::getInstance()->getSayDistance();
+// Aurora Sim
if (distance_squared > dist_near_chat * dist_near_chat)
{
// diminish far-off chat
@@ -210,7 +214,10 @@ void LLViewerChat::getChatColor(const LLChat& chat, std::string& r_color_name, F
{
LLVector3 pos_agent = gAgent.getPositionAgent();
F32 distance_squared = dist_vec_squared(pos_agent, chat.mPosAgent);
- F32 dist_near_chat = gAgent.getNearChatRadius();
+// Aurora som
+ //F32 dist_near_chat = gAgent.getNearChatRadius();
+ F32 dist_near_chat = LLWorld::getInstance()->getSayDistance();
+// Aurora sim
if (distance_squared > dist_near_chat * dist_near_chat)
{
// diminish far-off chat
diff --git a/indra/newview/llviewerdisplay.cpp b/indra/newview/llviewerdisplay.cpp
index 3473d3e723..672d9933cd 100644
--- a/indra/newview/llviewerdisplay.cpp
+++ b/indra/newview/llviewerdisplay.cpp
@@ -179,6 +179,13 @@ void display_update_camera()
{
final_far *= 0.5f;
}
+// Aurora sim
+ if(LLWorld::getInstance()->getLockedDrawDistance())
+ {
+ //Reset the draw distance and do not update with the new val
+ final_far = LLViewerCamera::getInstance()->getFar();
+ }
+// Aurora sim
LLViewerCamera::getInstance()->setFar(final_far);
gViewerWindow->setup3DRender();
@@ -348,7 +355,15 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot)
LLImageGL::updateStats(gFrameTimeSeconds);
- LLVOAvatar::sRenderName = gSavedSettings.getS32("AvatarNameTagMode");
+// Aurora sim
+ //LLVOAvatar::sRenderName = gSavedSettings.getS32("AvatarNameTagMode");
+ S32 RenderName = gSavedSettings.getS32("AvatarNameTagMode");
+
+ if(RenderName > LLWorld::getInstance()->getAllowRenderName())//The most restricted gets set here
+ RenderName = LLWorld::getInstance()->getAllowRenderName();
+ LLVOAvatar::sRenderName = RenderName;
+// Aurora sim
+
LLVOAvatar::sRenderGroupTitles = (gSavedSettings.getBOOL("NameTagShowGroupTitles") && gSavedSettings.getS32("AvatarNameTagMode"));
gPipeline.mBackfaceCull = TRUE;
diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp
index eb2c0b60b2..7ce587312e 100644
--- a/indra/newview/llviewermessage.cpp
+++ b/indra/newview/llviewermessage.cpp
@@ -4602,7 +4602,21 @@ 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);
-
+
+// 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);
@@ -4622,7 +4636,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
// Ansariel: Disable teleport beacon after teleport
if (gSavedSettings.getBOOL("FSDisableBeaconAfterTeleport"))
@@ -4946,9 +4963,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 ed9ffbf093..7379638188 100755
--- a/indra/newview/llviewerobject.cpp
+++ b/indra/newview/llviewerobject.cpp
@@ -947,7 +947,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 4540c9221d..c79f9bd4b9 100644
--- a/indra/newview/llviewerparcelmgr.cpp
+++ b/indra/newview/llviewerparcelmgr.cpp
@@ -134,7 +134,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);
@@ -157,9 +163,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()
{
@@ -439,9 +455,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;
@@ -1392,8 +1414,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
@@ -1456,6 +1481,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 2a11549426..6c591b641a 100644
--- a/indra/newview/llviewerparcelmgr.h
+++ b/indra/newview/llviewerparcelmgr.h
@@ -86,6 +86,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 017982e861..19812cda36 100644
--- a/indra/newview/llviewerparceloverlay.cpp
+++ b/indra/newview/llviewerparceloverlay.cpp
@@ -55,6 +55,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),
@@ -409,7 +412,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 7445d5bf1d..2c72d1f1d4 100644
--- a/indra/newview/llviewerparceloverlay.h
+++ b/indra/newview/llviewerparceloverlay.h
@@ -103,6 +103,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 6c6d175304..5e1d024aba 100644
--- a/indra/newview/llviewerregion.cpp
+++ b/indra/newview/llviewerregion.cpp
@@ -71,6 +71,8 @@
#include "llviewercontrol.h"
#include "llsdserialize.h"
+#include "llviewerparcelmgr.h" // Aurora Sim
+
#ifdef LL_WINDOWS
#pragma warning(disable:4355)
#endif
@@ -291,9 +293,12 @@ LLViewerRegion::LLViewerRegion(const U64 &handle,
mCacheLoaded(FALSE),
mCacheDirty(FALSE),
mReleaseNotesRequested(FALSE),
- mCapabilitiesReceived(false)
+ mCapabilitiesReceived(false),
+// Aurora Sim
+ mWidth(region_width_meters)
{
- mWidth = region_width_meters;
+ // Moved this up... -> mWidth = region_width_meters;
+//
mImpl->mOriginGlobal = from_region_handle(handle);
updateRenderMatrix();
@@ -303,7 +308,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
@@ -313,7 +321,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();
@@ -471,6 +483,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();
@@ -763,11 +782,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)
{
@@ -776,8 +804,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)
@@ -794,7 +826,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)
{
@@ -803,8 +838,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)
@@ -820,9 +859,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)
{
@@ -831,8 +876,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)
@@ -1182,7 +1231,6 @@ void LLViewerRegion::getInfo(LLSD& info)
void LLViewerRegion::getSimulatorFeatures(LLSD& sim_features)
{
sim_features = mSimulatorFeatures;
-
}
void LLViewerRegion::setSimulatorFeatures(const LLSD& sim_features)
diff --git a/indra/newview/llviewerregion.h b/indra/newview/llviewerregion.h
index 898c07d9b6..cf70256ed7 100644
--- a/indra/newview/llviewerregion.h
+++ b/indra/newview/llviewerregion.h
@@ -134,6 +134,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 ec932501e5..07002f6ea2 100644
--- a/indra/newview/llvlcomposition.cpp
+++ b/indra/newview/llvlcomposition.cpp
@@ -155,7 +155,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 d8de979f56..8b096cad11 100644
--- a/indra/newview/llvlmanager.cpp
+++ b/indra/newview/llvlmanager.cpp
@@ -50,18 +50,33 @@ LLVLManager::~LLVLManager()
void LLVLManager::addLayerData(LLVLData *vl_datap, const S32 mesg_size)
{
- if (LAND_LAYER_CODE == vl_datap->mType)
+// 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;
}
- else if (WIND_LAYER_CODE == vl_datap->mType)
+// 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;
}
- else if (CLOUD_LAYER_CODE == vl_datap->mType)
+// 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;
@@ -87,14 +102,28 @@ void LLVLManager::unpackData(const S32 num_packets)
{
datap->mRegionp->getLand().decompressDCTPatch(bit_pack, &goph, FALSE);
}
- else if (WIND_LAYER_CODE == datap->mType)
+// 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);
}
- else if (CLOUD_LAYER_CODE == datap->mType)
+// Aurora Sim
+ //else if (CLOUD_LAYER_CODE == datap->mType)
+ else if (CLOUD_LAYER_CODE == datap->mType || AURORA_CLOUD_LAYER_CODE == datap->mType)
{
+ }
+ else if (WATER_LAYER_CODE == datap->mType || AURORA_WATER_LAYER_CODE == datap->mType)
+ {
+// Aurora Sim
+
}
}
diff --git a/indra/newview/llvlmanager.h b/indra/newview/llvlmanager.h
index 74b4823a5c..aff077e21b 100644
--- a/indra/newview/llvlmanager.h
+++ b/indra/newview/llvlmanager.h
@@ -59,6 +59,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 942eff6171..702524d051 100644
--- a/indra/newview/llvowater.cpp
+++ b/indra/newview/llvowater.cpp
@@ -68,7 +68,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 4c39fb5b74..eb0ca23c7b 100644
--- a/indra/newview/llwind.cpp
+++ b/indra/newview/llwind.cpp
@@ -45,6 +45,11 @@
#include "v4color.h"
#include "llworld.h"
+// Aurora Sim
+#include "llviewerregion.h"
+#include "llagent.h"
+// Aurora Sim
+
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
@@ -99,12 +104,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);
@@ -210,7 +221,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 b778aaf525..d59092302c 100644
--- a/indra/newview/llworld.cpp
+++ b/indra/newview/llworld.cpp
@@ -56,6 +56,11 @@
#include "pipeline.h"
#include "llappviewer.h" // for do_disconnect()
+// Aurora Sim
+#include "llfloatertools.h"
+#include "llfloaterreg.h"
+// Aurora Sim
+
#include
#include
#include