From 5ac51f73e29ffa561b0dae87a06b6d5c1bd0e32e Mon Sep 17 00:00:00 2001 From: Armin Weatherwax Date: Mon, 29 Mar 2010 14:11:34 +0200 Subject: Use Hippogridmanager for OpenSim detection. --- linden/indra/newview/app_settings/settings.xml | 11 ---------- linden/indra/newview/llappviewer.cpp | 4 +++- linden/indra/newview/llmanipscale.cpp | 30 +++++++++----------------- linden/indra/newview/llmanipscale.h | 3 --- linden/indra/newview/llpanellogin.cpp | 5 ++++- linden/indra/newview/llpanelobject.cpp | 8 +++---- linden/indra/newview/llstartup.cpp | 16 ++++++++------ linden/indra/newview/llviewermessage.cpp | 12 +++-------- linden/indra/newview/llvoavatar.cpp | 5 ++--- 9 files changed, 35 insertions(+), 59 deletions(-) (limited to 'linden/indra/newview') diff --git a/linden/indra/newview/app_settings/settings.xml b/linden/indra/newview/app_settings/settings.xml index a7592c7..852369f 100644 --- a/linden/indra/newview/app_settings/settings.xml +++ b/linden/indra/newview/app_settings/settings.xml @@ -5909,17 +5909,6 @@ Value 0 - LoggedIntoOpenSim - - Comment - Check whether or not we're in an OpenSimulator (default 0) - Persist - 1 - Type - Boolean - Value - 0 - LoginAsGod Comment diff --git a/linden/indra/newview/llappviewer.cpp b/linden/indra/newview/llappviewer.cpp index e4cd3af..7aa3a05 100644 --- a/linden/indra/newview/llappviewer.cpp +++ b/linden/indra/newview/llappviewer.cpp @@ -1899,7 +1899,9 @@ bool LLAppViewer::initConfiguration() gHippoGridManager = new HippoGridManager(); gHippoGridManager->init(); } - + if (!gHippoLimits) { + gHippoLimits = new HippoLimits(); + } //initGridChoice(); diff --git a/linden/indra/newview/llmanipscale.cpp b/linden/indra/newview/llmanipscale.cpp index 65f99ef..969ee43 100644 --- a/linden/indra/newview/llmanipscale.cpp +++ b/linden/indra/newview/llmanipscale.cpp @@ -63,6 +63,8 @@ #include "v2math.h" #include "llvoavatar.h" +#include "hippoLimits.h" + const F32 MAX_MANIP_SELECT_DISTANCE_SQUARED = 11.f * 11.f; const F32 SNAP_GUIDE_SCREEN_OFFSET = 0.05f; @@ -70,8 +72,6 @@ const F32 SNAP_GUIDE_SCREEN_LENGTH = 0.7f; const F32 SELECTED_MANIPULATOR_SCALE = 1.2f; const F32 MANIPULATOR_SCALE_HALF_LIFE = 0.07f; const S32 NUM_MANIPULATORS = 14; -const F32 DEFAULT_LL_MAX_PRIM_SCALE = 10.f; -const F32 DEFAULT_OPENSIM_MAX_PRIM_SCALE = 128.f; const LLManip::EManipPart MANIPULATOR_IDS[NUM_MANIPULATORS] = { @@ -176,7 +176,6 @@ LLManipScale::LLManipScale( LLToolComposite* composite ) mScaledBoxHandleSize( 1.f ), mLastMouseX( -1 ), mLastMouseY( -1 ), - mMaxPrimSize(0.f), mSendUpdateOnMouseUp( FALSE ), mLastUpdateFlags( 0 ), mScaleSnapUnit1(1.f), @@ -205,7 +204,6 @@ void LLManipScale::render() LLGLDepthTest gls_depth(GL_TRUE); LLGLEnable gl_blend(GL_BLEND); LLGLEnable gls_alpha_test(GL_ALPHA_TEST); - mMaxPrimSize = gSavedSettings.getBOOL("LoggedIntoOpenSim") ? DEFAULT_OPENSIM_MAX_PRIM_SCALE : DEFAULT_LL_MAX_PRIM_SCALE; if( canAffectSelection() ) { @@ -957,8 +955,9 @@ void LLManipScale::dragCorner( S32 x, S32 y ) mInSnapRegime = FALSE; } - F32 max_scale_factor = mMaxPrimSize / MIN_PRIM_SCALE; - F32 min_scale_factor = MIN_PRIM_SCALE / mMaxPrimSize; + F32 maxScale = gHippoLimits->getMaxPrimScale(); + F32 max_scale_factor = maxScale / MIN_PRIM_SCALE; + F32 min_scale_factor = MIN_PRIM_SCALE / maxScale; // find max and min scale factors that will make biggest object hit max absolute scale and smallest object hit min absolute scale for (LLObjectSelection::iterator iter = mObjectSelection->begin(); @@ -970,7 +969,7 @@ void LLManipScale::dragCorner( S32 x, S32 y ) { const LLVector3& scale = selectNode->mSavedScale; - F32 cur_max_scale_factor = llmin( mMaxPrimSize / scale.mV[VX], mMaxPrimSize / scale.mV[VY], mMaxPrimSize / scale.mV[VZ] ); + F32 cur_max_scale_factor = llmin( maxScale / scale.mV[VX], maxScale / scale.mV[VY], maxScale / scale.mV[VZ] ); max_scale_factor = llmin( max_scale_factor, cur_max_scale_factor ); F32 cur_min_scale_factor = llmax( MIN_PRIM_SCALE / scale.mV[VX], MIN_PRIM_SCALE / scale.mV[VY], MIN_PRIM_SCALE / scale.mV[VZ] ); @@ -1267,7 +1266,8 @@ void LLManipScale::stretchFace( const LLVector3& drag_start_agent, const LLVecto F32 denom = axis * dir_local; F32 desired_delta_size = is_approx_zero(denom) ? 0.f : (delta_local_mag / denom); // in meters - F32 desired_scale = llclamp(selectNode->mSavedScale.mV[axis_index] + desired_delta_size, MIN_PRIM_SCALE, mMaxPrimSize); + F32 desired_scale = llclamp(selectNode->mSavedScale.mV[axis_index] + desired_delta_size, MIN_PRIM_SCALE, + gHippoLimits->getMaxPrimScale()); // propagate scale constraint back to position offset desired_delta_size = desired_scale - selectNode->mSavedScale.mV[axis_index]; // propagate constraint back to position @@ -1967,7 +1967,7 @@ F32 LLManipScale::partToMaxScale( S32 part, const LLBBox &bbox ) const max_extent = bbox_extents.mV[i]; } } - max_scale_factor = bbox_extents.magVec() * mMaxPrimSize / max_extent; + max_scale_factor = bbox_extents.magVec() * gHippoLimits->getMaxPrimScale() / max_extent; if (getUniform()) { @@ -1982,7 +1982,7 @@ F32 LLManipScale::partToMinScale( S32 part, const LLBBox &bbox ) const { LLVector3 bbox_extents = unitVectorToLocalBBoxExtent( partToUnitVector( part ), bbox ); bbox_extents.abs(); - F32 min_extent = mMaxPrimSize; + F32 min_extent = gHippoLimits->getMaxPrimScale(); for (U32 i = VX; i <= VZ; i++) { if (bbox_extents.mV[i] > 0.f && bbox_extents.mV[i] < min_extent) @@ -2057,13 +2057,3 @@ BOOL LLManipScale::canAffectSelection() } return can_scale; } - -//static -F32 LLManipScale::getMaxPrimSize() -{ - if (gSavedSettings.getBOOL("LoggedIntoOpenSim")) - { - return DEFAULT_OPENSIM_MAX_PRIM_SCALE; - } - return DEFAULT_LL_MAX_PRIM_SCALE; -} diff --git a/linden/indra/newview/llmanipscale.h b/linden/indra/newview/llmanipscale.h index c6545fd..1de0459 100644 --- a/linden/indra/newview/llmanipscale.h +++ b/linden/indra/newview/llmanipscale.h @@ -89,8 +89,6 @@ public: static void setShowAxes( BOOL b ); static BOOL getShowAxes(); - static F32 getMaxPrimSize(); - private: void renderCorners( const LLBBox& local_bbox ); void renderFaces( const LLBBox& local_bbox ); @@ -168,7 +166,6 @@ private: F32 mScaleSnapValue; BOOL mInSnapRegime; F32* mManipulatorScales; - F32 mMaxPrimSize; }; #endif // LL_MANIPSCALE_H diff --git a/linden/indra/newview/llpanellogin.cpp b/linden/indra/newview/llpanellogin.cpp index 64a8a1f..49b9761 100644 --- a/linden/indra/newview/llpanellogin.cpp +++ b/linden/indra/newview/llpanellogin.cpp @@ -37,6 +37,8 @@ #include "llpanelgeneral.h" #include "hippoGridManager.h" +#include "hippoLimits.h" + #include "floaterlogin.h" #include "indra_constants.h" // for key and mask constants @@ -1099,7 +1101,8 @@ void LLPanelLogin::onSelectServer(LLUICtrl* ctrl, void*) // //childSetText("gridname", gridInfo->getGridName()); // LLPanelLogin::setFields( gridInfo->getFirstName(), gridInfo->getLastName(), gridInfo->getAvatarPassword(), 1 ); // } - + if (mCurGrid == gHippoGridManager->getConnectedGrid()->getGridNick()) + gHippoLimits->setLimits(); llwarns << "current grid = " << mCurGrid << llendl; diff --git a/linden/indra/newview/llpanelobject.cpp b/linden/indra/newview/llpanelobject.cpp index 40dc211..bcbd076 100644 --- a/linden/indra/newview/llpanelobject.cpp +++ b/linden/indra/newview/llpanelobject.cpp @@ -79,7 +79,7 @@ // [RLVa:KB] - Checked: 2009-07-10 (RLVa-1.0.0g) #include "llvoavatar.h" // [/RLVa:KB] - +#include "hippoLimits.h" // // Constants // @@ -632,9 +632,9 @@ void LLPanelObject::getState( ) } else { - mCtrlScaleX->setMaxValue(LLManipScale::getMaxPrimSize()); - mCtrlScaleY->setMaxValue(LLManipScale::getMaxPrimSize()); - mCtrlScaleZ->setMaxValue(LLManipScale::getMaxPrimSize()); + mCtrlScaleX->setMaxValue(gHippoLimits->getMaxPrimScale()); + mCtrlScaleY->setMaxValue(gHippoLimits->getMaxPrimScale()); + mCtrlScaleZ->setMaxValue(gHippoLimits->getMaxPrimScale()); // Only allowed to change these parameters for objects // that you have permissions on AND are not attachments. diff --git a/linden/indra/newview/llstartup.cpp b/linden/indra/newview/llstartup.cpp index 993e6e2..3698ecb 100644 --- a/linden/indra/newview/llstartup.cpp +++ b/linden/indra/newview/llstartup.cpp @@ -885,6 +885,7 @@ bool idle_startup() } gHippoGridManager->setCurrentGridAsConnected(); + gHippoLimits->setLimits(); // create necessary directories // *FIX: these mkdir's should error check gDirUtilp->setLindenUserDir(gHippoGridManager->getCurrentGridNick(), firstname, lastname); @@ -1650,13 +1651,14 @@ bool idle_startup() if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setPasswordUrl(tmp); tmp = LLUserAuth::getInstance()->getResponse("search"); if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setSearchUrl(tmp); - tmp = LLUserAuth::getInstance()->getResponse("currency"); - if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setCurrencySymbol(tmp); - tmp = LLUserAuth::getInstance()->getResponse("real_currency"); - if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setRealCurrencySymbol(tmp); - tmp = LLUserAuth::getInstance()->getResponse("directory_fee"); - if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setDirectoryFee(atoi(tmp.c_str())); - gHippoGridManager->saveFile(); + tmp = LLUserAuth::getInstance()->getResponse("currency"); + if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setCurrencySymbol(tmp); + tmp = LLUserAuth::getInstance()->getResponse("real_currency"); + if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setRealCurrencySymbol(tmp); + tmp = LLUserAuth::getInstance()->getResponse("directory_fee"); + if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setDirectoryFee(atoi(tmp.c_str())); + gHippoGridManager->saveFile(); + gHippoLimits->setLimits(); // JC: gesture loading done below, when we have an asset system // in place. Don't delete/clear user_credentials until then. diff --git a/linden/indra/newview/llviewermessage.cpp b/linden/indra/newview/llviewermessage.cpp index 8bdbc30..67dc082 100644 --- a/linden/indra/newview/llviewermessage.cpp +++ b/linden/indra/newview/llviewermessage.cpp @@ -138,6 +138,8 @@ #include "llviewerdisplay.h" #include "llkeythrottle.h" +#include "hippoLimits.h" + #include #if LL_WINDOWS // For Windows specific error handler @@ -3167,15 +3169,7 @@ void process_agent_movement_complete(LLMessageSystem* msg, void**) LLSD payload; payload["message"] = version_channel; LLNotifications::instance().add("ServerVersionChanged", LLSD(), payload); - } - - if (version_channel.find("OpenSim") != std::string::npos) - { - gSavedSettings.setBOOL("LoggedIntoOpenSim", TRUE); - } - else - { - gSavedSettings.setBOOL("LoggedIntoOpenSim", FALSE); + gHippoLimits->setLimits(); } gLastVersionChannel = version_channel; diff --git a/linden/indra/newview/llvoavatar.cpp b/linden/indra/newview/llvoavatar.cpp index 10e2ec7..3055c92 100644 --- a/linden/indra/newview/llvoavatar.cpp +++ b/linden/indra/newview/llvoavatar.cpp @@ -54,7 +54,6 @@ #include "llkeyframefallmotion.h" #include "llkeyframestandmotion.h" #include "llkeyframewalkmotion.h" -#include "llmanipscale.h" // getMaxPrimSize() #include "llmutelist.h" #include "llnotify.h" #include "llquantize.h" @@ -96,7 +95,7 @@ // [RLVa:KB] #include "llstartup.h" // [/RLVa:KB] - +#include "hippoLimits.h"// getMaxPrimScale using namespace LLVOAvatarDefines; //----------------------------------------------------------------------------- @@ -1535,7 +1534,7 @@ void LLVOAvatar::getSpatialExtents(LLVector3& newMin, LLVector3& newMax) LLVector3 pos = getRenderPosition(); newMin = pos - buffer; newMax = pos + buffer; - float max_attachment_span = LLManipScale::getMaxPrimSize() * 5.0f; + float max_attachment_span = gHippoLimits->getMaxPrimScale() * 5.0f; //stretch bounding box by joint positions for (polymesh_map_t::iterator i = mMeshes.begin(); i != mMeshes.end(); ++i) -- cgit v1.1