From 4a683110f77060889a755fd77c814e79eeb80298 Mon Sep 17 00:00:00 2001 From: Armin Weatherwax Date: Thu, 8 Apr 2010 20:42:06 +0200 Subject: remove link limits: (take 2) depending on grid. Seems OSim creates several linksets though. --- linden/indra/llcommon/indra_constants.h | 1 - linden/indra/newview/hippoLimits.cpp | 5 ++++- linden/indra/newview/hippoLimits.h | 3 +++ linden/indra/newview/llfloatertools.cpp | 25 +++++++++++++++---------- linden/indra/newview/llviewermenu.cpp | 21 +++++++++++++-------- 5 files changed, 35 insertions(+), 20 deletions(-) (limited to 'linden/indra') diff --git a/linden/indra/llcommon/indra_constants.h b/linden/indra/llcommon/indra_constants.h index ae7863d..96c0a1f 100644 --- a/linden/indra/llcommon/indra_constants.h +++ b/linden/indra/llcommon/indra_constants.h @@ -102,7 +102,6 @@ const F32 DEFAULT_AGENT_HEIGHT = 1.9f; const F32 MAX_AGENT_HEIGHT = 2.65f - 2.0f * COLLISION_TOLERANCE; // For linked sets -const S32 MAX_CHILDREN_PER_TASK = 255; const S32 MAX_CHILDREN_PER_PHYSICAL_TASK = 32; const S32 MAX_JOINTS_PER_OBJECT = 1; // limiting to 1 until Havok 2.x diff --git a/linden/indra/newview/hippoLimits.cpp b/linden/indra/newview/hippoLimits.cpp index dae81a6..96b3bee 100644 --- a/linden/indra/newview/hippoLimits.cpp +++ b/linden/indra/newview/hippoLimits.cpp @@ -33,13 +33,15 @@ void HippoLimits::setOpenSimLimits() mMaxAgentGroups = 100; mMaxPrimScale = 256.0f; mMaxHeight = 10000.0f; + mMaxLinkedPrims = -1; + if (gHippoGridManager->getConnectedGrid()->isRenderCompat()) { llinfos << "Using rendering compatible OpenSim limits." << llendl; mMinHoleSize = 0.05f; mMaxHollow = 0.95f; } else { llinfos << "Using Hippo OpenSim limits." << llendl; - mMinHoleSize = 0.01f; + mMinHoleSize = 0.01f; mMaxHollow = 0.99f; } } @@ -52,5 +54,6 @@ void HippoLimits::setSecondLifeLimits() mMaxHeight = 4096.0f; mMinHoleSize = 0.05f; mMaxHollow = 0.95f; + mMaxLinkedPrims = 255; } diff --git a/linden/indra/newview/hippoLimits.h b/linden/indra/newview/hippoLimits.h index 900480b..7152bcc 100644 --- a/linden/indra/newview/hippoLimits.h +++ b/linden/indra/newview/hippoLimits.h @@ -12,15 +12,18 @@ public: float getMinHoleSize() const { return mMinHoleSize; } float getMaxHollow() const { return mMaxHollow; } float getMaxPrimScale() const { return mMaxPrimScale; } + S32 getMaxLinkedPrims() const { return mMaxLinkedPrims; } void setLimits(); private: int mMaxAgentGroups; + float mMaxHeight; float mMinHoleSize; float mMaxHollow; float mMaxPrimScale; + S32 mMaxLinkedPrims; void setOpenSimLimits(); void setSecondLifeLimits(); diff --git a/linden/indra/newview/llfloatertools.cpp b/linden/indra/newview/llfloatertools.cpp index 5a7fdff..260872f 100644 --- a/linden/indra/newview/llfloatertools.cpp +++ b/linden/indra/newview/llfloatertools.cpp @@ -84,6 +84,8 @@ #include "llvotree.h" #include "lluictrlfactory.h" +#include "hippoLimits.h" + // Globals LLFloaterTools *gFloaterTools = NULL; @@ -1146,18 +1148,21 @@ void LLFloaterTools::onClickLink(void* data) LLNotifications::instance().add("UnableToLinkWhileDownloading"); return; } - - S32 object_count = LLSelectMgr::getInstance()->getSelection()->getObjectCount(); - if (object_count > MAX_CHILDREN_PER_TASK + 1) + + S32 max_linked_prims = gHippoLimits->getMaxLinkedPrims(); + if (max_linked_prims > -1) { - LLSD args; - args["COUNT"] = llformat("%d", object_count); - int max = MAX_CHILDREN_PER_TASK+1; - args["MAX"] = llformat("%d", max); - LLNotifications::instance().add("UnableToLinkObjects", args); - return; + S32 object_count = LLSelectMgr::getInstance()->getSelection()->getObjectCount(); + if (object_count > max_linked_prims + 1) + { + LLSD args; + args["COUNT"] = llformat("%d", object_count); + args["MAX"] = llformat("%d", max_linked_prims +1); + LLNotifications::instance().add("UnableToLinkObjects", args); + return; + } } - + if(LLSelectMgr::getInstance()->getSelection()->getRootObjectCount() < 2) { LLNotifications::instance().add("CannotLinkIncompleteSet"); diff --git a/linden/indra/newview/llviewermenu.cpp b/linden/indra/newview/llviewermenu.cpp index 0aec752..2e72a2a 100644 --- a/linden/indra/newview/llviewermenu.cpp +++ b/linden/indra/newview/llviewermenu.cpp @@ -224,6 +224,8 @@ #include "jcfloater_animation_list.h" #include "llfloaterassetbrowser.h" +#include "hippoLimits.h" + using namespace LLVOAvatarDefines; void init_client_menu(LLMenuGL* menu); void init_server_menu(LLMenuGL* menu); @@ -4668,15 +4670,18 @@ class LLToolsLink : public view_listener_t return true; } - S32 object_count = LLSelectMgr::getInstance()->getSelection()->getObjectCount(); - if (object_count > MAX_CHILDREN_PER_TASK + 1) + S32 max_linked_prims = gHippoLimits->getMaxLinkedPrims(); + if (max_linked_prims > -1) { - LLSD args; - args["COUNT"] = llformat("%d", object_count); - int max = MAX_CHILDREN_PER_TASK+1; - args["MAX"] = llformat("%d", max); - LLNotifications::instance().add("UnableToLinkObjects", args); - return true; + S32 object_count = LLSelectMgr::getInstance()->getSelection()->getObjectCount(); + if (object_count > max_linked_prims + 1) + { + LLSD args; + args["COUNT"] = llformat("%d", object_count); + args["MAX"] = llformat("%d", max_linked_prims+1); + LLNotifications::instance().add("UnableToLinkObjects", args); + return true; + } } if(LLSelectMgr::getInstance()->getSelection()->getRootObjectCount() < 2) -- cgit v1.1