diff --git a/etc/message.xml b/etc/message.xml
index 04cdbc8f2..847f483aa 100644
--- a/etc/message.xml
+++ b/etc/message.xml
@@ -673,6 +673,9 @@
FetchInventoryDescendents
false
+ WebFetchInventoryDescendents
+ true
+
FetchInventory
true
diff --git a/indra/cmake/00-Common.cmake b/indra/cmake/00-Common.cmake
index af41d373a..bf3d3caa5 100644
--- a/indra/cmake/00-Common.cmake
+++ b/indra/cmake/00-Common.cmake
@@ -230,7 +230,7 @@ if (LINUX)
endif (${ARCH} STREQUAL "x86_64")
endif (VIEWER)
- set(CMAKE_CXX_FLAGS_DEBUG "-fno-inline ${CMAKE_CXX_FLAGS_DEBUG}")
+ set(CMAKE_CXX_FLAGS_DEBUG "-fno-inline ${CMAKE_CXX_FLAGS_DEBUG} -msse2")
set(CMAKE_CXX_FLAGS_RELEASE "-O3 ${CMAKE_CXX_FLAGS_RELEASE}")
set(CMAKE_C_FLAGS_RELEASE "-O3 ${CMAKE_C_FLAGS_RELEASE}")
set(CMAKE_CXX_FLAGS_RELEASESSE2 "-O3 ${CMAKE_CXX_FLAGS_RELEASESSE2}")
diff --git a/indra/llcommon/indra_constants.h b/indra/llcommon/indra_constants.h
index a95b6499d..478c746b0 100644
--- a/indra/llcommon/indra_constants.h
+++ b/indra/llcommon/indra_constants.h
@@ -153,6 +153,11 @@ const char LAND_LAYER_CODE = 'L';
const char WATER_LAYER_CODE = 'W';
const char WIND_LAYER_CODE = '7';
const char CLOUD_LAYER_CODE = '8';
+// Extended land layer for Aurora Sim
+const char AURORA_LAND_LAYER_CODE = 'M';
+const char AURORA_WATER_LAYER_CODE = 'X';
+const char AURORA_WIND_LAYER_CODE = '9';
+const char AURORA_CLOUD_LAYER_CODE = ':';
// keys
// Bit masks for various keyboard modifier keys.
diff --git a/indra/llcommon/llprocesslauncher.cpp b/indra/llcommon/llprocesslauncher.cpp
index 45bd98e20..b6d410da9 100644
--- a/indra/llcommon/llprocesslauncher.cpp
+++ b/indra/llcommon/llprocesslauncher.cpp
@@ -328,7 +328,11 @@ int LLProcessLauncher::launch(void)
apr_file_t* out;
AIAPRPool pool;
pool.create();
+#if(APR_VERSION_MAJOR==1 && APR_VERSION_MINOR>=3 || APR_VERSION_MAJOR>1)
apr_status_t status = apr_file_pipe_create_ex(&in, &out, APR_FULL_BLOCK, pool());
+#else
+ apr_status_t status = apr_file_pipe_create(&in, &out, pool());
+#endif
assert(status == APR_SUCCESS);
bool success = (status == APR_SUCCESS);
if (success)
diff --git a/indra/llinventory/llparcel.h b/indra/llinventory/llparcel.h
index eb9c44e53..881a6feb7 100644
--- a/indra/llinventory/llparcel.h
+++ b/indra/llinventory/llparcel.h
@@ -67,6 +67,7 @@ const F32 PARCEL_PASS_HOURS_DEFAULT = 1.f;
// Number of "chunks" in which parcel overlay data is sent
// Chunk 0 = southern rows, entire width
+// NOTE: NOT USABLE FOR VAR SIZED REGIONS!
const S32 PARCEL_OVERLAY_CHUNKS = 4;
// Bottom three bits are a color index for the land overlay
diff --git a/indra/llmessage/message_prehash.cpp b/indra/llmessage/message_prehash.cpp
index 892547cab..855d1cccf 100644
--- a/indra/llmessage/message_prehash.cpp
+++ b/indra/llmessage/message_prehash.cpp
@@ -588,6 +588,8 @@ char* _PREHASH_LastName = LLMessageStringTable::getInstance()->getString("LastNa
char* _PREHASH_From = LLMessageStringTable::getInstance()->getString("From");
char* _PREHASH_RoleChange = LLMessageStringTable::getInstance()->getString("RoleChange");
char* _PREHASH_Port = LLMessageStringTable::getInstance()->getString("Port");
+char* _PREHASH_RegionSizeX = LLMessageStringTable::getInstance()->getString("RegionSizeX");
+char* _PREHASH_RegionSizeY = LLMessageStringTable::getInstance()->getString("RegionSizeY");
char* _PREHASH_MemberTitle = LLMessageStringTable::getInstance()->getString("MemberTitle");
char* _PREHASH_LogParcelChanges = LLMessageStringTable::getInstance()->getString("LogParcelChanges");
char* _PREHASH_AgentCachedTextureResponse = LLMessageStringTable::getInstance()->getString("AgentCachedTextureResponse");
diff --git a/indra/llmessage/message_prehash.h b/indra/llmessage/message_prehash.h
index 4bf89e513..77cfe710a 100644
--- a/indra/llmessage/message_prehash.h
+++ b/indra/llmessage/message_prehash.h
@@ -588,6 +588,8 @@ extern char * _PREHASH_LastName;
extern char * _PREHASH_From;
extern char * _PREHASH_RoleChange;
extern char * _PREHASH_Port;
+extern char * _PREHASH_RegionSizeX;
+extern char * _PREHASH_RegionSizeY;
extern char * _PREHASH_MemberTitle;
extern char * _PREHASH_LogParcelChanges;
extern char * _PREHASH_AgentCachedTextureResponse;
diff --git a/indra/llmessage/patch_code.cpp b/indra/llmessage/patch_code.cpp
index 90fb23634..12ed19ea4 100644
--- a/indra/llmessage/patch_code.cpp
+++ b/indra/llmessage/patch_code.cpp
@@ -235,7 +235,7 @@ void decode_patch_group_header(LLBitPack &bitpack, LLGroupHeader *gopp)
gPatchSize = gopp->patch_size;
}
-void decode_patch_header(LLBitPack &bitpack, LLPatchHeader *ph)
+void decode_patch_header(LLBitPack &bitpack, LLPatchHeader *ph, BOOL b_large_patch)
{
U8 retvalu8;
@@ -274,15 +274,18 @@ void decode_patch_header(LLBitPack &bitpack, LLPatchHeader *ph)
#endif
ph->range = retvalu16;
- retvalu16 = 0;
+ retvalu32 = 0;
#ifdef LL_BIG_ENDIAN
ret = (U8 *)&retvalu16;
bitpack.bitUnpack(&(ret[1]), 8);
bitpack.bitUnpack(&(ret[0]), 2);
#else
- bitpack.bitUnpack((U8 *)&retvalu16, 10);
+ if (b_large_patch)
+ bitpack.bitUnpack((U8 *)&retvalu32, 32);
+ else
+ bitpack.bitUnpack((U8 *)&retvalu32, 10);
#endif
- ph->patchids = retvalu16;
+ ph->patchids = retvalu32;
gWordBits = (ph->quant_wbits & 0xf) + 2;
}
diff --git a/indra/llmessage/patch_code.h b/indra/llmessage/patch_code.h
index 82fa6bb62..dbfdf7059 100644
--- a/indra/llmessage/patch_code.h
+++ b/indra/llmessage/patch_code.h
@@ -46,7 +46,7 @@ void end_patch_coding(LLBitPack &bitpack);
void init_patch_decoding(LLBitPack &bitpack);
void decode_patch_group_header(LLBitPack &bitpack, LLGroupHeader *gopp);
-void decode_patch_header(LLBitPack &bitpack, LLPatchHeader *ph);
+void decode_patch_header(LLBitPack &bitpack, LLPatchHeader *ph, BOOL b_large_patch);
void decode_patch(LLBitPack &bitpack, S32 *patches);
#endif
diff --git a/indra/llmessage/patch_dct.h b/indra/llmessage/patch_dct.h
index 663e146a8..ba21be711 100644
--- a/indra/llmessage/patch_dct.h
+++ b/indra/llmessage/patch_dct.h
@@ -79,7 +79,7 @@ public:
F32 dc_offset; // 4 bytes
U16 range; // 2 = 7 ((S16) FP range (breaks if we need > 32K meters in 1 patch)
U8 quant_wbits; // 1 = 8 (upper 4 bits is quant - 2, lower 4 bits is word bits - 2)
- U16 patchids; // 2 = 10 (actually only uses 10 bits, 5 for each)
+ U32 patchids; // 2 = 10 (actually only uses 10 bits, 5 for each)
};
// Compression routines
diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt
index 89cd31abb..62d98582e 100644
--- a/indra/newview/CMakeLists.txt
+++ b/indra/newview/CMakeLists.txt
@@ -1224,6 +1224,7 @@ set_source_files_properties(${viewer_XUI_FILES}
list(APPEND viewer_SOURCE_FILES ${viewer_XUI_FILES})
set(viewer_APPSETTINGS_FILES
+ viewer_manifest.py
app_settings/anim.ini
app_settings/cmd_line.xml
app_settings/grass.xml
diff --git a/indra/newview/app_settings/settings_files.xml b/indra/newview/app_settings/settings_files.xml
index 6e52cfa24..ac304f759 100644
--- a/indra/newview/app_settings/settings_files.xml
+++ b/indra/newview/app_settings/settings_files.xml
@@ -81,7 +81,7 @@
PerAccount
diff --git a/indra/newview/llcloud.cpp b/indra/newview/llcloud.cpp
index ca35c3711..116d227cc 100644
--- a/indra/newview/llcloud.cpp
+++ b/indra/newview/llcloud.cpp
@@ -437,7 +437,7 @@ void LLCloudLayer::decompress(LLBitPack &bitpack, LLGroupHeader *group_headerp)
group_headerp->stride = group_headerp->patch_size; // offset required to step up one row
set_group_of_patch_header(group_headerp);
- decode_patch_header(bitpack, &patch_header);
+ decode_patch_header(bitpack, &patch_header, FALSE);
decode_patch(bitpack, gBuffer);
decompress_patch(mDensityp, gBuffer, &patch_header);
}
diff --git a/indra/newview/llfloaterregioninfo.cpp b/indra/newview/llfloaterregioninfo.cpp
index d91f4067b..8955eddb0 100644
--- a/indra/newview/llfloaterregioninfo.cpp
+++ b/indra/newview/llfloaterregioninfo.cpp
@@ -1089,10 +1089,11 @@ BOOL LLPanelRegionTextureInfo::sendUpdate()
llinfos << "LLPanelRegionTextureInfo::sendUpdate()" << llendl;
// Make sure user hasn't chosen wacky textures.
- if (!validateTextureSizes())
- {
- return FALSE;
- }
+ // -Revolution Allow 'wacky' things
+ //if (!validateTextureSizes())
+ //{
+ // return FALSE;
+ //}
LLTextureCtrl* texture_ctrl;
std::string buffer;
diff --git a/indra/newview/llglsandbox.cpp b/indra/newview/llglsandbox.cpp
index 092fdc6b5..5da3926b7 100644
--- a/indra/newview/llglsandbox.cpp
+++ b/indra/newview/llglsandbox.cpp
@@ -613,7 +613,7 @@ void LLViewerParcelMgr::renderOneSegment(F32 x1, F32 y1, F32 x2, F32 y2, F32 hei
return;
// HACK: At edge of last region of world, we need to make sure the region
// resolves correctly so we can get a height value.
- const F32 BORDER = REGION_WIDTH_METERS - 0.1f;
+ const F32 BORDER = regionp->getWidth() - 0.1f;
F32 clamped_x1 = x1;
F32 clamped_y1 = y1;
diff --git a/indra/newview/llinventorymodel.cpp b/indra/newview/llinventorymodel.cpp
index bba3cf30d..f7fccd298 100644
--- a/indra/newview/llinventorymodel.cpp
+++ b/indra/newview/llinventorymodel.cpp
@@ -1318,6 +1318,7 @@ void LLInventoryModel::mock(const LLUUID& root_id)
void LLInventoryModel::fetchInventoryResponder::result(const LLSD& content)
{
+ LL_DEBUGS("Inventory") << " fetch http got " << ll_pretty_print_sd(content) << LL_ENDL; // OGPX
start_new_inventory_observer();
/*LLUUID agent_id;
@@ -1435,6 +1436,7 @@ class fetchDescendentsResponder: public LLHTTPClient::Responder
// Note: this is the handler for WebFetchInventoryDescendents and agent/inventory caps
void fetchDescendentsResponder::result(const LLSD& content)
{
+ LL_DEBUGS("Inventory") << " fetch descendents got " << ll_pretty_print_sd(content) << LL_ENDL; // OGPX
if (content.has("folders"))
{
@@ -1656,7 +1658,11 @@ void LLInventoryModel::bulkFetch(std::string url)
folder_sd["fetch_items"] = (LLSD::Boolean)TRUE;
LL_DEBUGS("Inventory") << " fetching "<getUUID()<<" with cat owner "<getOwnerID()<<" and agent" << gAgent.getID() << LL_ENDL;
- if (ALEXANDRIA_LINDEN_ID == cat->getOwnerID())
+ //OGPX if (ALEXANDRIA_LINDEN_ID == cat->getOwnerID())
+ // for OGP it really doesnt make sense to have the decision about whether to fetch
+ // from the library or user cap be determined by a hard coded UUID.
+ // if it isnt an item that belongs to the agent, then fetch from the library
+ if (gAgent.getID() != cat->getOwnerID()) //if i am not the owner, it must be in the library
body_lib["folders"].append(folder_sd);
else
body["folders"].append(folder_sd);
@@ -1690,12 +1696,14 @@ void LLInventoryModel::bulkFetch(std::string url)
sBulkFetchCount++;
if (body["folders"].size())
{
+ LL_DEBUGS("Inventory") << " fetch descendents post to " << url << ": " << ll_pretty_print_sd(body) << LL_ENDL; // OGPX
LLHTTPClient::post(url, body, new fetchDescendentsResponder(body),300.0);
}
if (body_lib["folders"].size())
{
std::string url_lib;
url_lib = gAgent.getRegion()->getCapability("FetchLibDescendents");
+ LL_DEBUGS("Inventory") << " fetch descendents lib post: " << ll_pretty_print_sd(body_lib) << LL_ENDL; // OGPX
LLHTTPClient::post(url_lib, body_lib, new fetchDescendentsResponder(body_lib),300.0);
}
sFetchTimer.reset();
@@ -1796,20 +1804,20 @@ void LLInventoryModel::backgroundFetch(void*)
{
if (sBackgroundFetchActive && gAgent.getRegion())
{
- // If we'll be using the capability, we'll be sending batches and the background thing isn't as important.
- std::string url = gAgent.getRegion()->getCapability("FetchInventoryDescendents");
- if (false /*gSavedSettings.getBOOL("UseHTTPInventory")*/ && !url.empty())
+ std::string url = gAgent.getRegion()->getCapability("WebFetchInventoryDescendents");
+
+ if (!url.empty())
{
bulkFetch(url);
return;
}
-#if 1
+ // If there was no HTTP cap to fetch with, then do the UDP fetch
//DEPRECATED OLD CODE FOLLOWS.
// no more categories to fetch, stop fetch process
if (sFetchQueue.empty())
{
- llinfos << "Inventory fetch completed" << llendl;
+ LL_DEBUGS("Inventory") << "Inventory fetch completed" << LL_ENDL;
if (sFullFetchStarted)
{
sAllFoldersFetched = TRUE;
@@ -1825,7 +1833,7 @@ void LLInventoryModel::backgroundFetch(void*)
// double timeouts on failure
sMinTimeBetweenFetches = llmin(sMinTimeBetweenFetches * 2.f, 10.f);
sMaxTimeBetweenFetches = llmin(sMaxTimeBetweenFetches * 2.f, 120.f);
- llinfos << "Inventory fetch times grown to (" << sMinTimeBetweenFetches << ", " << sMaxTimeBetweenFetches << ")" << llendl;
+ LL_DEBUGS("Inventory") << "Inventory fetch times grown to (" << sMinTimeBetweenFetches << ", " << sMaxTimeBetweenFetches << ")" << LL_ENDL;
// fetch is no longer considered "timely" although we will wait for full time-out
sTimelyFetchPending = FALSE;
}
@@ -1920,11 +1928,6 @@ void LLInventoryModel::backgroundFetch(void*)
// not enough time has elapsed to do a new fetch
break;
}
-
- //
- // DEPRECATED OLD CODE
- //--------------------------------------------------------------------------------
-#endif
}
}
@@ -2204,53 +2207,57 @@ bool LLInventoryModel::loadSkeleton(
const LLSD& options,
const LLUUID& owner_id)
{
- lldebugs << "importing inventory skeleton for " << owner_id << llendl;
+ LL_INFOS("OGPX") << "importing inventory skeleton for " << owner_id << LL_ENDL;
+ LL_DEBUGS("Inventory") << " skeleton is " << ll_pretty_print_sd(options) << LL_ENDL;
typedef std::set, InventoryIDPtrLess> cat_set_t;
cat_set_t temp_cats;
+
+ update_map_t child_counts;
+
+ LLUUID id;
+ LLAssetType::EType preferred_type;
bool rv = true;
-
- for(LLSD::array_const_iterator it = options.beginArray(),
- end = options.endArray(); it != end; ++it)
+ for (LLSD::array_const_iterator it = options.beginArray(); it < options.endArray(); ++it)
{
- LLSD name = (*it)["name"];
- LLSD folder_id = (*it)["folder_id"];
- LLSD parent_id = (*it)["parent_id"];
- LLSD version = (*it)["version"];
- if(name.isDefined()
- && folder_id.isDefined()
- && parent_id.isDefined()
- && version.isDefined()
- && folder_id.asUUID().notNull() // if an id is null, it locks the viewer.
- )
+ LLPointer cat = new LLViewerInventoryCategory(owner_id);
+
+ LL_DEBUGS("Inventory") << "cat name, folder, parent, type " << (*it)["name"].asString() << " " << (*it)["folder_id"].asUUID() << " " << (*it)["parent_id"].asUUID() << " " << (*it)["type_default"].asString() << " " << LL_ENDL; // OGPX
+ if ((*it)["name"].asString().empty()) goto clean_cat;
+ cat->rename((*it)["name"].asString().c_str());
+ if ((*it)["folder_id"].asUUID().isNull()) goto clean_cat;
+ id = (*it)["folder_id"].asUUID();
+ // if an id is null, it locks the viewer.
+ if (id.isNull()) goto clean_cat;
+ cat->setUUID(id);
+ // OGPX : slight change in snowglobe non OGP handling of things with null parents vs OGP9 SVN branch
+ // OGPX : so commented this line out for OGPX as well. if((*it)["parent_id"].asUUID().isNull()) goto clean_cat;
+ id = (*it)["parent_id"].asUUID();
+ cat->setParent(id);
+ if ((*it)["type_default"].asString().empty())
{
- LLPointer cat = new LLViewerInventoryCategory(owner_id);
- cat->rename(name.asString());
- cat->setUUID(folder_id.asUUID());
- cat->setParent(parent_id.asUUID());
-
- LLAssetType::EType preferred_type = LLAssetType::AT_NONE;
- LLSD type_default = (*it)["type_default"];
- if(type_default.isDefined())
- {
- preferred_type = (LLAssetType::EType)type_default.asInteger();
- }
- cat->setPreferredType(preferred_type);
- cat->setVersion(version.asInteger());
- temp_cats.insert(cat);
+ preferred_type = LLAssetType::AT_NONE;
}
else
{
- llwarns << "Unable to import near " << name.asString() << llendl;
- rv = false;
+ S32 t = (*it)["type_default"].asInteger();
+ preferred_type = (LLAssetType::EType)t;
}
+ cat->setPreferredType(preferred_type);
+ if ((*it)["version"].asString().empty()) goto clean_cat;
+ cat->setVersion((*it)["version"].asInteger());
+ temp_cats.insert(cat);
+ continue;
+ clean_cat:
+ llwarns << "Unable to import near " << cat->getName() << llendl;
+ rv = false;
+ //delete cat; // automatic when cat is reasigned or destroyed
}
-
+
S32 cached_category_count = 0;
S32 cached_item_count = 0;
- if(!temp_cats.empty())
+ if (!temp_cats.empty())
{
- update_map_t child_counts;
cat_array_t categories;
item_array_t items;
cat_set_t invalid_categories; // Used to mark categories that weren't successfully loaded.
@@ -2320,9 +2327,9 @@ bool LLInventoryModel::loadSkeleton(
}
// go ahead and add the cats returned during the download
- std::set::const_iterator not_cached_id = cached_ids.end();
+ std::set::iterator not_cached_id = cached_ids.end();
cached_category_count = cached_ids.size();
- for(cat_set_t::iterator it = temp_cats.begin(); it != temp_cats.end(); ++it)
+ for (cat_set_t::iterator it = temp_cats.begin(); it != temp_cats.end(); ++it)
{
if (cached_ids.find((*it)->getUUID()) == not_cached_id)
{
@@ -2338,32 +2345,30 @@ bool LLInventoryModel::loadSkeleton(
// Add all the items loaded which are parented to a
// category with a correctly cached parent
+ count = items.count();
S32 bad_link_count = 0;
cat_map_t::iterator unparented = mCategoryMap.end();
- for(item_array_t::const_iterator item_iter = items.begin();
- item_iter != items.end();
- ++item_iter)
+ for (int i = 0; i < count; ++i)
{
- LLViewerInventoryItem *item = (*item_iter).get();
- const cat_map_t::iterator cit = mCategoryMap.find(item->getParentUUID());
+ cat_map_t::iterator cit = mCategoryMap.find(items[i]->getParentUUID());
- if(cit != unparented)
+ if (cit != unparented)
{
- const LLViewerInventoryCategory* cat = cit->second.get();
- if(cat->getVersion() != NO_VERSION)
+ LLViewerInventoryCategory* cat = cit->second;
+ if (cat->getVersion() != NO_VERSION)
{
// This can happen if the linked object's baseobj is removed from the cache but the linked object is still in the cache.
- if (item->getIsBrokenLink())
+ if (items[i]->getIsBrokenLink())
{
bad_link_count++;
lldebugs << "Attempted to add cached link item without baseobj present ( name: "
- << item->getName() << " itemID: " << item->getUUID()
- << " assetID: " << item->getAssetUUID()
+ << items[i]->getName() << " itemID: " << items[i]->getUUID()
+ << " assetID: " << items[i]->getAssetUUID()
<< " ). Ignoring and invalidating " << cat->getName() << " . " << llendl;
invalid_categories.insert(cit->second);
continue;
}
- addItem(item);
+ addItem(items[i]);
cached_item_count += 1;
++child_counts[cat->getUUID()];
}
@@ -2402,17 +2407,17 @@ bool LLInventoryModel::loadSkeleton(
// At this point, we need to set the known descendents for each
// category which successfully cached so that we do not
// needlessly fetch descendents for categories which we have.
- update_map_t::const_iterator no_child_counts = child_counts.end();
- for(cat_set_t::iterator it = temp_cats.begin(); it != temp_cats.end(); ++it)
+ update_map_t::iterator no_child_counts = child_counts.end();
+ update_map_t::iterator the_count;
+ for (cat_set_t::iterator it = temp_cats.begin(); it != temp_cats.end(); ++it)
{
- LLViewerInventoryCategory* cat = (*it).get();
- if(cat->getVersion() != NO_VERSION)
+ LLViewerInventoryCategory* cat = (*it);
+ if (cat->getVersion() != NO_VERSION)
{
- update_map_t::const_iterator the_count = child_counts.find(cat->getUUID());
- if(the_count != no_child_counts)
+ the_count = child_counts.find(cat->getUUID());
+ if (the_count != no_child_counts)
{
- const S32 num_descendents = (*the_count).second.mValue;
- cat->setDescendentCount(num_descendents);
+ cat->setDescendentCount((*the_count).second.mValue);
}
else
{
@@ -2435,30 +2440,341 @@ bool LLInventoryModel::loadSkeleton(
categories.clear(); // will unref and delete entries
}
- llinfos << "Successfully loaded " << cached_category_count
+ LL_DEBUGS("Inventory") << "Successfully loaded " << cached_category_count
<< " categories and " << cached_item_count << " items from cache."
- << llendl;
+ << LL_ENDL;
return rv;
}
-//OGPX crap. Since this function is actually functionally the same as its LLSD variant..
-// just convert options_t to LLSD and route to the LLSD version. Yuck.
bool LLInventoryModel::loadSkeleton(
const LLInventoryModel::options_t& options,
const LLUUID& owner_id)
{
- LLSD options_list;
+ lldebugs << "importing inventory skeleton for " << owner_id << llendl;
+
+ typedef std::set, InventoryIDPtrLess> cat_set_t;
+ cat_set_t temp_cats;
+
+ update_map_t child_counts;
+
+ LLUUID id;
+ LLAssetType::EType preferred_type;
+ bool rv = true;
for(options_t::const_iterator it = options.begin(); it < options.end(); ++it)
{
- LLSD entry;
- for(response_t::const_iterator it2 = it->begin(); it2 != it->end(); ++it2)
+ LLPointer cat = new LLViewerInventoryCategory(owner_id);
+ response_t::const_iterator no_response = (*it).end();
+ response_t::const_iterator skel;
+ skel = (*it).find("name");
+ if(skel == no_response) goto clean_cat;
+ cat->rename(std::string((*skel).second));
+ skel = (*it).find("folder_id");
+ if(skel == no_response) goto clean_cat;
+ id.set((*skel).second);
+ // if an id is null, it locks the viewer.
+ if(id.isNull()) goto clean_cat;
+ cat->setUUID(id);
+ skel = (*it).find("parent_id");
+ if(skel == no_response) goto clean_cat;
+ id.set((*skel).second);
+ cat->setParent(id);
+ skel = (*it).find("type_default");
+ if(skel == no_response)
{
- entry[it2->first]=it2->second;
+ preferred_type = LLAssetType::AT_NONE;
}
- options_list.append(entry);
+ else
+ {
+ S32 t = atoi((*skel).second.c_str());
+ preferred_type = (LLAssetType::EType)t;
+ }
+ cat->setPreferredType(preferred_type);
+ skel = (*it).find("version");
+ if(skel == no_response) goto clean_cat;
+ cat->setVersion(atoi((*skel).second.c_str()));
+ temp_cats.insert(cat);
+ continue;
+ clean_cat:
+ llwarns << "Unable to import near " << cat->getName() << llendl;
+ rv = false;
+ //delete cat; // automatic when cat is reasigned or destroyed
}
- return loadSkeleton(options_list,owner_id);
+
+ S32 cached_category_count = 0;
+ S32 cached_item_count = 0;
+ if(!temp_cats.empty())
+ {
+ cat_array_t categories;
+ item_array_t items;
+ cat_set_t invalid_categories; // Used to mark categories that weren't successfully loaded.
+ std::string owner_id_str;
+ owner_id.toString(owner_id_str);
+ std::string path(gDirUtilp->getExpandedFilename(LL_PATH_CACHE, owner_id_str));
+ std::string inventory_filename;
+ inventory_filename = llformat(CACHE_FORMAT_STRING, path.c_str());
+ const S32 NO_VERSION = LLViewerInventoryCategory::VERSION_UNKNOWN;
+ std::string gzip_filename(inventory_filename);
+ gzip_filename.append(".gz");
+ LLFILE* fp = LLFile::fopen(gzip_filename, "rb");
+ bool remove_inventory_file = false;
+ if(fp)
+ {
+ fclose(fp);
+ fp = NULL;
+ if(gunzip_file(gzip_filename, inventory_filename))
+ {
+ // we only want to remove the inventory file if it was
+ // gzipped before we loaded, and we successfully
+ // gunziped it.
+ remove_inventory_file = true;
+ }
+ else
+ {
+ llinfos << "Unable to gunzip " << gzip_filename << llendl;
+ }
+ }
+ bool is_cache_obsolete = false;
+ if (loadFromFile(inventory_filename, categories, items, is_cache_obsolete))
+ {
+ // We were able to find a cache of files. So, use what we
+ // found to generate a set of categories we should add. We
+ // will go through each category loaded and if the version
+ // does not match, invalidate the version.
+ S32 count = categories.count();
+ cat_set_t::iterator not_cached = temp_cats.end();
+ std::set cached_ids;
+ for(S32 i = 0; i < count; ++i)
+ {
+ LLViewerInventoryCategory* cat = categories[i];
+ cat_set_t::iterator cit = temp_cats.find(cat);
+ if (cit == temp_cats.end())
+ {
+ continue; // cache corruption?? not sure why this happens -SJB
+ }
+ LLViewerInventoryCategory* tcat = *cit;
+
+ // we can safely ignore anything loaded from file, but
+ // not sent down in the skeleton.
+ if(cit == not_cached)
+ {
+ continue;
+ }
+ if(cat->getVersion() != tcat->getVersion())
+ {
+ // if the cached version does not match the server version,
+ // throw away the version we have so we can fetch the
+ // correct contents the next time the viewer opens the folder.
+ tcat->setVersion(NO_VERSION);
+ }
+ else
+ {
+ cached_ids.insert(tcat->getUUID());
+ }
+ }
+
+ // go ahead and add the cats returned during the download
+ std::set::iterator not_cached_id = cached_ids.end();
+ cached_category_count = cached_ids.size();
+ for(cat_set_t::iterator it = temp_cats.begin(); it != temp_cats.end(); ++it)
+ {
+ if(cached_ids.find((*it)->getUUID()) == not_cached_id)
+ {
+ // this check is performed so that we do not
+ // mark new folders in the skeleton (and not in cache)
+ // as being cached.
+ LLViewerInventoryCategory *llvic = (*it);
+ llvic->setVersion(NO_VERSION);
+ }
+ addCategory(*it);
+ ++child_counts[(*it)->getParentUUID()];
+ }
+
+ // Add all the items loaded which are parented to a
+ // category with a correctly cached parent
+ count = items.count();
+ S32 bad_link_count = 0;
+ cat_map_t::iterator unparented = mCategoryMap.end();
+ for(int i = 0; i < count; ++i)
+ {
+ cat_map_t::iterator cit = mCategoryMap.find(items[i]->getParentUUID());
+
+ if(cit != unparented)
+ {
+ LLViewerInventoryCategory* cat = cit->second;
+ if(cat->getVersion() != NO_VERSION)
+ {
+ // This can happen if the linked object's baseobj is removed from the cache but the linked object is still in the cache.
+ if (items[i]->getIsBrokenLink())
+ {
+ bad_link_count++;
+ lldebugs << "Attempted to add cached link item without baseobj present ( name: "
+ << items[i]->getName() << " itemID: " << items[i]->getUUID()
+ << " assetID: " << items[i]->getAssetUUID()
+ << " ). Ignoring and invalidating " << cat->getName() << " . " << llendl;
+ invalid_categories.insert(cit->second);
+ continue;
+ }
+ addItem(items[i]);
+ cached_item_count += 1;
+ ++child_counts[cat->getUUID()];
+ }
+ }
+ }
+ if (bad_link_count > 0)
+ {
+ llinfos << "Attempted to add " << bad_link_count
+ << " cached link items without baseobj present. "
+ << "The corresponding categories were invalidated." << llendl;
+ }
+ }
+ else
+ {
+ // go ahead and add everything after stripping the version
+ // information.
+ for(cat_set_t::iterator it = temp_cats.begin(); it != temp_cats.end(); ++it)
+ {
+ LLViewerInventoryCategory *llvic = (*it);
+ llvic->setVersion(NO_VERSION);
+ addCategory(*it);
+ }
+ }
+
+ // Invalidate all categories that failed fetching descendents for whatever
+ // reason (e.g. one of the descendents was a broken link).
+ for (cat_set_t::iterator invalid_cat_it = invalid_categories.begin();
+ invalid_cat_it != invalid_categories.end();
+ invalid_cat_it++)
+ {
+ LLViewerInventoryCategory* cat = (*invalid_cat_it).get();
+ cat->setVersion(NO_VERSION);
+ llinfos << "Invalidating category name: " << cat->getName() << " UUID: " << cat->getUUID() << " due to invalid descendents cache" << llendl;
+ }
+
+ // At this point, we need to set the known descendents for each
+ // category which successfully cached so that we do not
+ // needlessly fetch descendents for categories which we have.
+ update_map_t::iterator no_child_counts = child_counts.end();
+ update_map_t::iterator the_count;
+ for(cat_set_t::iterator it = temp_cats.begin(); it != temp_cats.end(); ++it)
+ {
+ LLViewerInventoryCategory* cat = (*it);
+ if(cat->getVersion() != NO_VERSION)
+ {
+ the_count = child_counts.find(cat->getUUID());
+ if(the_count != no_child_counts)
+ {
+ cat->setDescendentCount((*the_count).second.mValue);
+ }
+ else
+ {
+ cat->setDescendentCount(0);
+ }
+ }
+ }
+
+ if(remove_inventory_file)
+ {
+ // clean up the gunzipped file.
+ LLFile::remove(inventory_filename);
+ }
+ if (is_cache_obsolete)
+ {
+ // If out of date, remove the gzipped file too.
+ llwarns << "Inv cache out of date, removing" << llendl;
+ LLFile::remove(gzip_filename);
+ }
+ categories.clear(); // will unref and delete entries
+ }
+
+ LL_DEBUGS("Inventory") << "Successfully loaded " << cached_category_count
+ << " categories and " << cached_item_count << " items from cache."
+ << LL_ENDL;
+
+ return rv;
+}
+
+bool LLInventoryModel::loadMeat(
+ const LLInventoryModel::options_t& options, const LLUUID& owner_id)
+{
+ llinfos << "importing inventory for " << owner_id << llendl;
+ LLPermissions default_perm;
+ default_perm.init(LLUUID::null, owner_id, LLUUID::null, LLUUID::null);
+ LLPointer item;
+ LLUUID id;
+ LLAssetType::EType type;
+ LLInventoryType::EType inv_type;
+ bool rv = true;
+ for(options_t::const_iterator it = options.begin(); it < options.end(); ++it)
+ {
+ item = new LLViewerInventoryItem;
+ response_t::const_iterator no_response = (*it).end();
+ response_t::const_iterator meat;
+ meat = (*it).find("name");
+ if(meat == no_response) goto clean_item;
+ item->rename(std::string((*meat).second));
+ meat = (*it).find("item_id");
+ if(meat == no_response) goto clean_item;
+ id.set((*meat).second);
+ item->setUUID(id);
+ meat = (*it).find("parent_id");
+ if(meat == no_response) goto clean_item;
+ id.set((*meat).second);
+ item->setParent(id);
+ meat = (*it).find("type");
+ if(meat == no_response) goto clean_item;
+ type = (LLAssetType::EType)atoi((*meat).second.c_str());
+ item->setType(type);
+ meat = (*it).find("inv_type");
+ if(meat != no_response)
+ {
+ inv_type = (LLInventoryType::EType)atoi((*meat).second.c_str());
+ item->setInventoryType(inv_type);
+ }
+ meat = (*it).find("data_id");
+ if(meat == no_response) goto clean_item;
+ id.set((*meat).second);
+ if(LLAssetType::AT_CALLINGCARD == type)
+ {
+ LLPermissions perm;
+ perm.init(id, owner_id, LLUUID::null, LLUUID::null);
+ item->setPermissions(perm);
+ }
+ else
+ {
+ meat = (*it).find("perm_mask");
+ if(meat != no_response)
+ {
+ PermissionMask perm_mask = atoi((*meat).second.c_str());
+ default_perm.initMasks(
+ perm_mask, perm_mask, perm_mask, perm_mask, perm_mask);
+ }
+ else
+ {
+ default_perm.initMasks(
+ PERM_NONE, PERM_NONE, PERM_NONE, PERM_NONE, PERM_NONE);
+ }
+ item->setPermissions(default_perm);
+ item->setAssetUUID(id);
+ }
+ meat = (*it).find("flags");
+ if(meat != no_response)
+ {
+ item->setFlags(strtoul((*meat).second.c_str(), NULL, 0));
+ }
+ meat = (*it).find("time");
+ if(meat != no_response)
+ {
+ item->setCreationDate(atoi((*meat).second.c_str()));
+ }
+ addItem(item);
+ continue;
+ clean_item:
+ llwarns << "Unable to import near " << item->getName() << llendl;
+ rv = false;
+ //delete item; // automatic when item is reassigned or destroyed
+ }
+ return rv;
}
// This is a brute force method to rebuild the entire parent-child
diff --git a/indra/newview/llinventorymodel.h b/indra/newview/llinventorymodel.h
index 697d1e29a..a6dc0f31a 100644
--- a/indra/newview/llinventorymodel.h
+++ b/indra/newview/llinventorymodel.h
@@ -386,9 +386,13 @@ public:
// during authentication. return true if everything parsed.
typedef std::map response_t;
typedef std::vector options_t;
-
- //OGPX really screwed with the login process. This is needed until it's all sorted out.
+ // OGPX : Two loadSkeleton(), one for the XML-RPC logins, one for LLSD
+ //... The concept of a skeleton being different from the cap that
+ //... we do inventory queries on should be examined, and the usage of
+ //... the skeleton in querying the wearables needs to be examined as well.
bool loadSkeleton(const options_t& options, const LLUUID& owner_id);
+ bool loadMeat(const options_t& options, const LLUUID& owner_id);
+
/** Mutators
** **
*******************************************************************************/
diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp
index f6f051fd1..bd69c300c 100644
--- a/indra/newview/llstartup.cpp
+++ b/indra/newview/llstartup.cpp
@@ -370,6 +370,8 @@ bool idle_startup()
static U64 first_sim_handle = 0;
static LLHost first_sim;
static std::string first_sim_seed_cap;
+ static U32 first_sim_size_x = 256;
+ static U32 first_sim_size_y = 256;
static LLVector3 initial_sun_direction(1.f, 0.f, 0.f);
static LLVector3 agent_start_position_region(10.f, 10.f, 10.f); // default for when no space server
@@ -1657,7 +1659,17 @@ bool idle_startup()
U32 region_y = strtoul(region_y_str.c_str(), NULL, 10);
first_sim_handle = to_region_handle(region_x, region_y);
}
-
+
+ text = LLUserAuth::getInstance()->getResponse("region_size_x");
+ if(!text.empty()) {
+ first_sim_size_x = strtoul(text.c_str(), NULL, 10);
+ LLViewerParcelMgr::getInstance()->init(first_sim_size_x);
+ }
+
+ //region Y size is currently unused, major refactoring required. - Patrick Sapinski (2/10/2011)
+ text = LLUserAuth::getInstance()->getResponse("region_size_y");
+ if(!text.empty()) first_sim_size_y = strtoul(text.c_str(), NULL, 10);
+
const std::string look_at_str = LLUserAuth::getInstance()->getResponse("look_at");
if (!look_at_str.empty())
{
@@ -1946,7 +1958,7 @@ bool idle_startup()
gAgent.initOriginGlobal(from_region_handle(first_sim_handle));
- LLWorld::getInstance()->addRegion(first_sim_handle, first_sim);
+ LLWorld::getInstance()->addRegion(first_sim_handle, first_sim, first_sim_size_x, first_sim_size_y);
LLViewerRegion *regionp = LLWorld::getInstance()->getRegionFromHandle(first_sim_handle);
LL_INFOS("AppInit") << "Adding initial simulator " << regionp->getOriginGlobal() << LL_ENDL;
diff --git a/indra/newview/llsurface.cpp b/indra/newview/llsurface.cpp
index 9d718e88c..7a46305e4 100644
--- a/indra/newview/llsurface.cpp
+++ b/indra/newview/llsurface.cpp
@@ -299,7 +299,7 @@ void LLSurface::initTextures()
mWaterObjp = (LLVOWater *)gObjectList.createObjectViewer(LLViewerObject::LL_VO_WATER, mRegionp);
gPipeline.createObject(mWaterObjp);
LLVector3d water_pos_global = from_region_handle(mRegionp->getHandle());
- water_pos_global += LLVector3d(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);
}
}
@@ -329,8 +329,8 @@ void LLSurface::setOriginGlobal(const LLVector3d &origin_global)
// Hack!
if (mWaterObjp.notNull() && mWaterObjp->mDrawable.notNull())
{
- const F64 x = origin_global.mdV[VX] + 128.0;
- const F64 y = origin_global.mdV[VY] + 128.0;
+ const F64 x = origin_global.mdV[VX] + (F64)mRegionp->getWidth()/2;
+ const F64 y = origin_global.mdV[VY] + (F64)mRegionp->getWidth()/2;
const F64 z = mWaterObjp->getPositionGlobal().mdV[VZ];
LLVector3d water_origin_global(x, y, z);
@@ -680,14 +680,22 @@ void LLSurface::decompressDCTPatch(LLBitPack &bitpack, LLGroupHeader *gopp, BOOL
while (1)
{
- decode_patch_header(bitpack, &ph);
+ decode_patch_header(bitpack, &ph, b_large_patch);
if (ph.quant_wbits == END_OF_PATCHES)
{
break;
}
- i = ph.patchids >> 5;
- j = ph.patchids & 0x1F;
+ if (b_large_patch)
+ {
+ i = ph.patchids >> 16; //x
+ j = ph.patchids & 0xFFFF; //y
+ }
+ else
+ {
+ i = ph.patchids >> 5; //x
+ j = ph.patchids & 0x1F; //y
+ }
if ((i >= mPatchesPerEdge) || (j >= mPatchesPerEdge))
{
diff --git a/indra/newview/llviewerinventory.cpp b/indra/newview/llviewerinventory.cpp
index 4e4d56df1..fae33f091 100644
--- a/indra/newview/llviewerinventory.cpp
+++ b/indra/newview/llviewerinventory.cpp
@@ -274,6 +274,7 @@ void LLViewerInventoryItem::setTransactionID(const LLTransactionID& transaction_
// virtual
void LLViewerInventoryItem::packMessage(LLMessageSystem* msg) const
{
+ LL_INFOS("Inventory") << " UDP Rez/UpdateObject of UUID " << mUUID << " parent = " << mParentUUID << " type= " << mType << " transaction= "<< mTransactionID << LL_ENDL; // OGPX
msg->addUUIDFast(_PREHASH_ItemID, mUUID);
msg->addUUIDFast(_PREHASH_FolderID, mParentUUID);
mPermissions.packMessage(msg);
@@ -503,28 +504,15 @@ bool LLViewerInventoryCategory::fetchDescendents()
// This comes from LLInventoryFilter from llfolderview.h
U32 sort_order = gSavedSettings.getU32("InventorySortOrder") & 0x1;
- // *NOTE: For bug EXT-2879, originally commented out
- // gAgent.getRegion()->getCapability in order to use the old
- // message-based system. This has been uncommented now that
- // AIS folks are aware of the issue and have a fix in process.
- // see ticket for details.
+ std::string url = gAgent.getRegion()->getCapability("WebFetchInventoryDescendents");
- std::string url;
- if (gAgent.getRegion())
- {
- url = gAgent.getRegion()->getCapability("FetchInventoryDescendents");
- }
- else
- {
- llwarns << "agent region is null" << llendl;
- }
if (!url.empty()) //Capability found. Build up LLSD and use it.
{
LLInventoryModel::startBackgroundFetch(mUUID);
}
else
{ //Deprecated, but if we don't have a capability, use the old system.
- llinfos << "FetchInventoryDescendents capability not found. Using deprecated UDP message." << llendl;
+ llinfos << "WebFetchInventoryDescendents or agent/inventory capability not found. Using deprecated UDP message." << llendl;
LLMessageSystem* msg = gMessageSystem;
msg->newMessage("FetchInventoryDescendents");
msg->nextBlock("AgentData");
diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp
index 5eb4096de..5c04026a2 100644
--- a/indra/newview/llviewermessage.cpp
+++ b/indra/newview/llviewermessage.cpp
@@ -3718,6 +3718,18 @@ void process_teleport_finish(LLMessageSystem* msg, void**)
U32 teleport_flags;
msg->getU32Fast(_PREHASH_Info, _PREHASH_TeleportFlags, teleport_flags);
+ U32 region_size_x = 256;
+ msg->getU32Fast(_PREHASH_Info, _PREHASH_RegionSizeX, region_size_x);
+
+ U32 region_size_y = 256;
+ msg->getU32Fast(_PREHASH_Info, _PREHASH_RegionSizeY, region_size_y);
+
+ //and a little hack for Second Life compatibility
+ if (region_size_y == 0 || region_size_x == 0)
+ {
+ region_size_x = 256;
+ region_size_y = 256;
+ }
std::string seedCap;
msg->getStringFast(_PREHASH_Info, _PREHASH_SeedCapability, seedCap);
@@ -3737,7 +3749,7 @@ void process_teleport_finish(LLMessageSystem* msg, void**)
// Viewer trusts the simulator.
gMessageSystem->enableCircuit(sim_host, TRUE);
- LLViewerRegion* regionp = LLWorld::getInstance()->addRegion(region_handle, sim_host);
+ LLViewerRegion* regionp = LLWorld::getInstance()->addRegion(region_handle, sim_host, region_size_x, region_size_y);
/*
// send camera update to new region
@@ -4043,9 +4055,22 @@ void process_crossed_region(LLMessageSystem* msg, void**)
std::string seedCap;
msg->getStringFast(_PREHASH_RegionData, _PREHASH_SeedCapability, seedCap);
+ U32 region_size_x = 256;
+ msg->getU32(_PREHASH_RegionData, _PREHASH_RegionSizeX, region_size_x);
+
+ U32 region_size_y = 256;
+ msg->getU32(_PREHASH_RegionData, _PREHASH_RegionSizeY, region_size_y);
+
+ //and a little hack for Second Life compatibility
+ if (region_size_y == 0 || region_size_x == 0)
+ {
+ region_size_x = 256;
+ region_size_y = 256;
+ }
+
send_complete_agent_movement(sim_host);
- LLViewerRegion* regionp = LLWorld::getInstance()->addRegion(region_handle, sim_host);
+ LLViewerRegion* regionp = LLWorld::getInstance()->addRegion(region_handle, sim_host, region_size_x, region_size_y);
regionp->setSeedCapability(seedCap);
}
diff --git a/indra/newview/llviewerparcelmgr.cpp b/indra/newview/llviewerparcelmgr.cpp
index 25edaa82a..b63c81bfc 100644
--- a/indra/newview/llviewerparcelmgr.cpp
+++ b/indra/newview/llviewerparcelmgr.cpp
@@ -137,7 +137,18 @@ LLViewerParcelMgr::LLViewerParcelMgr()
mAgentParcel = new LLParcel();
mHoverParcel = new LLParcel();
mCollisionParcel = new LLParcel();
+ mBlockedImage = LLViewerTextureManager::getFetchedTextureFromFile("noentrylines.j2c");
+ mPassImage = LLViewerTextureManager::getFetchedTextureFromFile("noentrypasslines.j2c");
+ init(256);
+
+}
+
+//moved this stuff out of the constructor and into a function that we can call again after we get the region size.
+//LLViewerParcelMgr needs to be changed so we either get an instance per region, or it handles various region sizes
+//on a single grid properly - Patrick Sapinski (2/10/2011)
+void LLViewerParcelMgr::init(F32 region_size)
+{
mParcelsPerEdge = S32( REGION_WIDTH_METERS / PARCEL_GRID_STEP_METERS );
mHighlightSegments = new U8[(mParcelsPerEdge+1)*(mParcelsPerEdge+1)];
resetSegments(mHighlightSegments);
@@ -145,13 +156,8 @@ LLViewerParcelMgr::LLViewerParcelMgr()
mCollisionSegments = new U8[(mParcelsPerEdge+1)*(mParcelsPerEdge+1)];
resetSegments(mCollisionSegments);
- // JC: Resolved a merge conflict here, eliminated
- // mBlockedImage->setAddressMode(LLTexUnit::TAM_WRAP);
- // because it is done in llviewertexturelist.cpp
- mBlockedImage = LLViewerTextureManager::getFetchedTextureFromFile("noentrylines.j2c");
- mPassImage = LLViewerTextureManager::getFetchedTextureFromFile("noentrypasslines.j2c");
-
- S32 overlay_size = mParcelsPerEdge * mParcelsPerEdge / PARCEL_OVERLAY_CHUNKS;
+ S32 mParcelOverLayChunks = region_size * region_size / (128 * 128);
+ S32 overlay_size = mParcelsPerEdge * mParcelsPerEdge / mParcelOverLayChunks;
sPackedOverlay = new U8[overlay_size];
mAgentParcelOverlay = new U8[mParcelsPerEdge * mParcelsPerEdge];
@@ -1343,8 +1349,8 @@ 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;
+ //S32 parcels_per_edge = LLViewerParcelMgr::getInstance()->mParcelsPerEdge;
+ S32 expected_size = 1024;
if (packed_overlay_size != expected_size)
{
llwarns << "Got parcel overlay size " << packed_overlay_size
diff --git a/indra/newview/llviewerparcelmgr.h b/indra/newview/llviewerparcelmgr.h
index 236dbcbec..43e79125c 100644
--- a/indra/newview/llviewerparcelmgr.h
+++ b/indra/newview/llviewerparcelmgr.h
@@ -82,6 +82,8 @@ public:
LLViewerParcelMgr();
~LLViewerParcelMgr();
+ void init(F32 region_size);
+
static void cleanupGlobals();
BOOL selectionEmpty() const;
diff --git a/indra/newview/llviewerparceloverlay.cpp b/indra/newview/llviewerparceloverlay.cpp
index 46051f98e..a40884e0f 100644
--- a/indra/newview/llviewerparceloverlay.cpp
+++ b/indra/newview/llviewerparceloverlay.cpp
@@ -58,6 +58,7 @@ const U8 OVERLAY_IMG_COMPONENTS = 4;
LLViewerParcelOverlay::LLViewerParcelOverlay(LLViewerRegion* region, F32 region_width_meters)
: mRegion( region ),
mParcelGridsPerEdge( S32( region_width_meters / PARCEL_GRID_STEP_METERS ) ),
+ mRegionSize(S32(region_width_meters)),
mDirty( FALSE ),
mTimeSinceLastUpdate(),
mOverlayTextureIdx(-1),
@@ -298,7 +299,8 @@ void LLViewerParcelOverlay::uncompressLandOverlay(S32 chunk, U8 *packed_overlay)
{
// Unpack the message data into the ownership array
S32 size = mParcelGridsPerEdge * mParcelGridsPerEdge;
- S32 chunk_size = size / PARCEL_OVERLAY_CHUNKS;
+ S32 mParcelOverLayChunks = mRegionSize * mRegionSize / (128 * 128);
+ S32 chunk_size = size / mParcelOverLayChunks;
memcpy(mOwnership + chunk*chunk_size, packed_overlay, chunk_size); /*Flawfinder: ignore*/
diff --git a/indra/newview/llviewerparceloverlay.h b/indra/newview/llviewerparceloverlay.h
index 161b7a386..97f2ec2b8 100644
--- a/indra/newview/llviewerparceloverlay.h
+++ b/indra/newview/llviewerparceloverlay.h
@@ -100,6 +100,7 @@ private:
LLViewerRegion* mRegion;
S32 mParcelGridsPerEdge;
+ S32 mRegionSize;
LLPointer mTexture;
LLPointer mImageRaw;
diff --git a/indra/newview/llviewerregion.cpp b/indra/newview/llviewerregion.cpp
index 9319db137..1de40ed2c 100644
--- a/indra/newview/llviewerregion.cpp
+++ b/indra/newview/llviewerregion.cpp
@@ -66,6 +66,7 @@
#include "llvoclouds.h"
#include "llworld.h"
#include "llspatialpartition.h"
+#include "llviewerparcelmgr.h"
// Viewer object cache version, change if object update
// format changes. JC
@@ -199,6 +200,8 @@ LLViewerRegion::LLViewerRegion(const U64 &handle,
if (!gNoRender)
{
mParcelOverlay = new LLViewerParcelOverlay(this, region_width_meters);
+ //Re-init the parcel mgr for this sim
+ LLViewerParcelMgr::getInstance()->init(region_width_meters);
}
else
{
@@ -1453,13 +1456,9 @@ void LLViewerRegion::setSeedCapability(const std::string& url)
capabilityNames.append("DispatchRegionInfo");
capabilityNames.append("EstateChangeInfo");
capabilityNames.append("EventQueueGet");
- if (false)//gSavedSettings.getBOOL("UseHTTPInventory")) //Caps suffixed with 2 by LL. Don't update until rest of fetch system is updated first.
- {
- capabilityNames.append("FetchLib");
- capabilityNames.append("FetchLibDescendents");
- capabilityNames.append("FetchInventory");
- capabilityNames.append("FetchInventoryDescendents");
- }
+ capabilityNames.append("FetchInventory");
+ capabilityNames.append("FetchLib");
+ capabilityNames.append("FetchLibDescendents");
capabilityNames.append("GetTexture");
capabilityNames.append("GroupProposalBallot");
capabilityNames.append("GetDisplayNames");
@@ -1496,6 +1495,10 @@ void LLViewerRegion::setSeedCapability(const std::string& url)
capabilityNames.append("UploadBakedTexture");
capabilityNames.append("ViewerStartAuction");
capabilityNames.append("ViewerStats");
+ capabilityNames.append("WebFetchInventoryDescendents"); // OGPX : since this is asking the region
+ // leave the old naming in place, on agent domain
+ // it is now called agent/inventory. Both
+ // caps have the same LLSD returned.
// Please add new capabilities alphabetically to reduce
// merge conflicts.
diff --git a/indra/newview/llvlmanager.cpp b/indra/newview/llvlmanager.cpp
index 07ef26266..19ebe05fa 100644
--- a/indra/newview/llvlmanager.cpp
+++ b/indra/newview/llvlmanager.cpp
@@ -56,18 +56,26 @@ LLVLManager::~LLVLManager()
void LLVLManager::addLayerData(LLVLData *vl_datap, const S32 mesg_size)
{
- if (LAND_LAYER_CODE == vl_datap->mType)
+ if (LAND_LAYER_CODE == vl_datap->mType ||
+ AURORA_LAND_LAYER_CODE == vl_datap->mType)
{
mLandBits += mesg_size * 8;
}
- else if (WIND_LAYER_CODE == vl_datap->mType)
+ else if (WIND_LAYER_CODE == vl_datap->mType ||
+ AURORA_WIND_LAYER_CODE == vl_datap->mType)
{
mWindBits += mesg_size * 8;
}
- else if (CLOUD_LAYER_CODE == vl_datap->mType)
+ else if (CLOUD_LAYER_CODE == vl_datap->mType ||
+ AURORA_CLOUD_LAYER_CODE == vl_datap->mType)
{
mCloudBits += mesg_size * 8;
}
+ else if (WATER_LAYER_CODE == vl_datap->mType ||
+ AURORA_CLOUD_LAYER_CODE == vl_datap->mType)
+ {
+ mWaterBits += mesg_size * 8;
+ }
else
{
llerrs << "Unknown layer type!" << (S32)vl_datap->mType << llendl;
@@ -93,15 +101,25 @@ void LLVLManager::unpackData(const S32 num_packets)
{
datap->mRegionp->getLand().decompressDCTPatch(bit_pack, &goph, FALSE);
}
- else if (WIND_LAYER_CODE == datap->mType)
+ else if (AURORA_LAND_LAYER_CODE == datap->mType)
+ {
+ datap->mRegionp->getLand().decompressDCTPatch(bit_pack, &goph, TRUE);
+ }
+ else if (WIND_LAYER_CODE == datap->mType ||
+ AURORA_WIND_LAYER_CODE == datap->mType)
{
datap->mRegionp->mWind.decompress(bit_pack, &goph);
}
- else if (CLOUD_LAYER_CODE == datap->mType)
+ else if (CLOUD_LAYER_CODE == datap->mType ||
+ AURORA_CLOUD_LAYER_CODE == datap->mType)
{
datap->mRegionp->mCloudLayer.decompress(bit_pack, &goph);
}
+ else if (WATER_LAYER_CODE == datap->mType ||
+ AURORA_WATER_LAYER_CODE == datap->mType)
+ {
+ }
}
for (i = 0; i < mPacketData.count(); i++)
diff --git a/indra/newview/llvlmanager.h b/indra/newview/llvlmanager.h
index 9d64d6f24..4d7137fac 100644
--- a/indra/newview/llvlmanager.h
+++ b/indra/newview/llvlmanager.h
@@ -65,6 +65,7 @@ protected:
U32 mLandBits;
U32 mWindBits;
U32 mCloudBits;
+ U32 mWaterBits;
};
class LLVLData
diff --git a/indra/newview/llvowater.cpp b/indra/newview/llvowater.cpp
index 347eb21b3..c223d8dfb 100644
--- a/indra/newview/llvowater.cpp
+++ b/indra/newview/llvowater.cpp
@@ -74,7 +74,7 @@ LLVOWater::LLVOWater(const LLUUID &id,
{
// Terrain must draw during selection passes so it can block objects behind it.
mbCanSelect = FALSE;
- setScale(LLVector3(256.f, 256.f, 0.f)); // Hack for setting scale for bounding boxes/visibility.
+ setScale(LLVector3(mRegionp->getWidth(), mRegionp->getWidth(), 0.f)); // Hack for setting scale for bounding boxes/visibility.
mUseTexture = TRUE;
mIsEdgePatch = FALSE;
diff --git a/indra/newview/llwind.cpp b/indra/newview/llwind.cpp
index 2b0f0d969..0a2afd428 100644
--- a/indra/newview/llwind.cpp
+++ b/indra/newview/llwind.cpp
@@ -121,12 +121,12 @@ void LLWind::decompress(LLBitPack &bitpack, LLGroupHeader *group_headerp)
set_group_of_patch_header(group_headerp);
// X component
- decode_patch_header(bitpack, &patch_header);
+ decode_patch_header(bitpack, &patch_header, FALSE);
decode_patch(bitpack, buffer);
decompress_patch(mVelX, buffer, &patch_header);
// Y component
- decode_patch_header(bitpack, &patch_header);
+ decode_patch_header(bitpack, &patch_header, FALSE);
decode_patch(bitpack, buffer);
decompress_patch(mVelY, buffer, &patch_header);
diff --git a/indra/newview/llworld.cpp b/indra/newview/llworld.cpp
index 0c445b65f..022aa04d0 100644
--- a/indra/newview/llworld.cpp
+++ b/indra/newview/llworld.cpp
@@ -77,12 +77,12 @@ const S32 WORLD_PATCH_SIZE = 16;
extern LLColor4U MAX_WATER_COLOR;
-const U32 LLWorld::mWidth = 256;
+U32 LLWorld::mWidth = 256;
// meters/point, therefore mWidth * mScale = meters per edge
const F32 LLWorld::mScale = 1.f;
-const F32 LLWorld::mWidthInMeters = mWidth * mScale;
+F32 LLWorld::mWidthInMeters = mWidth * mScale;
//
// Functions
@@ -133,7 +133,7 @@ void LLWorld::destroyClass()
}
-LLViewerRegion* LLWorld::addRegion(const U64 ®ion_handle, const LLHost &host)
+LLViewerRegion* LLWorld::addRegion(const U64 ®ion_handle, const LLHost &host, const U32 ®ion_size_x, const U32 ®ion_size_y)
{
LLMemType mt(LLMemType::MTYPE_REGIONS);
llinfos << "Add region with handle: " << region_handle << " on host " << host << llendl;
@@ -166,9 +166,11 @@ LLViewerRegion* LLWorld::addRegion(const U64 ®ion_handle, const LLHost &host)
U32 iindex = 0;
U32 jindex = 0;
+ mWidth = region_size_x;
+ mWidthInMeters = mWidth * mScale;
from_region_handle(region_handle, &iindex, &jindex);
- S32 x = (S32)(iindex/mWidth);
- S32 y = (S32)(jindex/mWidth);
+ S32 x = (S32)(iindex/256);
+ S32 y = (S32)(jindex/256);
llinfos << "Adding new region (" << x << ":" << y << ")" << llendl;
llinfos << "Host: " << host << llendl;
@@ -813,7 +815,7 @@ F32 LLWorld::getLandFarClip() const
void LLWorld::setLandFarClip(const F32 far_clip)
{
- static S32 const rwidth = (S32)REGION_WIDTH_U32;
+ static S32 const rwidth = (S32)getRegionWidthInMeters();
S32 const n1 = (llceil(mLandFarClip) - 1) / rwidth;
S32 const n2 = (llceil(far_clip) - 1) / rwidth;
bool need_water_objects_update = n1 != n2;
@@ -1243,9 +1245,21 @@ void process_enable_simulator(LLMessageSystem *msg, void **user_data)
// which simulator should we modify?
LLHost sim(ip_u32, port);
+ U32 region_size_x = 256;
+ msg->getU32Fast(_PREHASH_SimulatorInfo, _PREHASH_RegionSizeX, region_size_x);
+
+ U32 region_size_y = 256;
+ msg->getU32Fast(_PREHASH_SimulatorInfo, _PREHASH_RegionSizeY, region_size_y);
+
+ if (region_size_y == 0 || region_size_x == 0)
+ {
+ region_size_x = 256;
+ region_size_y = 256;
+ }
+
// Viewer trusts the simulator.
msg->enableCircuit(sim, TRUE);
- LLWorld::getInstance()->addRegion(handle, sim);
+ LLWorld::getInstance()->addRegion(handle, sim, region_size_x, region_size_y);
// give the simulator a message it can use to get ip and port
llinfos << "simulator_enable() Enabling " << sim << " with code " << msg->getOurCircuitCode() << llendl;
diff --git a/indra/newview/llworld.h b/indra/newview/llworld.h
index ec6e45b23..b3bd661cf 100644
--- a/indra/newview/llworld.h
+++ b/indra/newview/llworld.h
@@ -71,7 +71,7 @@ public:
LLWorld();
void destroyClass();
- LLViewerRegion* addRegion(const U64 ®ion_handle, const LLHost &host);
+ LLViewerRegion* addRegion(const U64 ®ion_handle, const LLHost &host, const U32 ®ion_size_x, const U32 ®ion_size_y);
// safe to call if already present, does the "right thing" if
// hosts are same, or if hosts are different, etc...
void removeRegion(const LLHost &host);
@@ -170,12 +170,12 @@ private:
region_list_t mCulledRegionList;
// Number of points on edge
- static const U32 mWidth;
+ static U32 mWidth;
// meters/point, therefore mWidth * mScale = meters per edge
static const F32 mScale;
- static const F32 mWidthInMeters;
+ static F32 mWidthInMeters;
F32 mLandFarClip; // Far clip distance for land.
LLPatchVertexArray mLandPatch;