From e50aa5ab8804b5c100f36e89a62d435936c8a5d3 Mon Sep 17 00:00:00 2001 From: Shyotl Date: Tue, 3 May 2011 18:24:42 -0500 Subject: [PATCH 01/19] Disabled general spam blocking until exception is added for delayed instant messages. --- indra/newview/app_settings/settings_sh.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/app_settings/settings_sh.xml b/indra/newview/app_settings/settings_sh.xml index 95e494f46..6165c069d 100644 --- a/indra/newview/app_settings/settings_sh.xml +++ b/indra/newview/app_settings/settings_sh.xml @@ -89,7 +89,7 @@ Type Boolean Value - 1 + 0 SGBlockCardSpam From 8cc6092a1c7d477600b8409933aea02198eb2854 Mon Sep 17 00:00:00 2001 From: Shyotl Date: Wed, 4 May 2011 19:54:03 -0500 Subject: [PATCH 02/19] A few variables were uninitialized. Removed an unused variable. Phys controller that should be female-only... wasn't. Pre increment iterators when possible. protected->private upgrades. --- indra/llvfs/llpidlock.cpp | 8 ++- indra/llvfs/llvfile.h | 4 +- indra/newview/character/avatar_lad.xml | 1 + indra/newview/llphysicsmotion.cpp | 83 ++++++++++++++++++++++- indra/newview/llphysicsmotion.h | 3 + indra/newview/llviewerjointattachment.cpp | 8 +-- indra/newview/llviewerjointattachment.h | 4 +- indra/newview/shcommandhandler.cpp | 23 +++++++ 8 files changed, 120 insertions(+), 14 deletions(-) diff --git a/indra/llvfs/llpidlock.cpp b/indra/llvfs/llpidlock.cpp index cb6442816..93f1af52b 100755 --- a/indra/llvfs/llpidlock.cpp +++ b/indra/llvfs/llpidlock.cpp @@ -60,8 +60,12 @@ class LLPidLockFile { public: LLPidLockFile( ) : - mSaving(FALSE), mWaiting(FALSE), - mClean(TRUE), mPID(LLApp::getPid()) + mAutosave(false), + mSaving(false), + mWaiting(false), + mPID(LLApp::getPid()), + mNameTable(NULL), + mClean(true) { mLockName = gDirUtilp->getTempDir() + "/savelock"; } diff --git a/indra/llvfs/llvfile.h b/indra/llvfs/llvfile.h index 8db45d30b..c3bca8c73 100644 --- a/indra/llvfs/llvfile.h +++ b/indra/llvfs/llvfile.h @@ -80,16 +80,14 @@ public: static const S32 READ_WRITE; static const S32 APPEND; +protected: LLAssetType::EType mFileType; LLUUID mFileID; - -protected: S32 mPosition; S32 mMode; LLVFS *mVFS; F32 mPriority; - BOOL mOnReadQueue; S32 mBytesRead; LLVFSThread::handle_t mHandle; diff --git a/indra/newview/character/avatar_lad.xml b/indra/newview/character/avatar_lad.xml index 2f92d6212..47433ae01 100755 --- a/indra/newview/character/avatar_lad.xml +++ b/indra/newview/character/avatar_lad.xml @@ -11390,6 +11390,7 @@ getVisualParamWeight(param_name.c_str()); + return mCharacter->getVisualParamWeight((*entry).second.c_str()); } void setParamValue(LLViewerVisualParam *param, const F32 new_value_local, @@ -194,6 +197,80 @@ BOOL LLPhysicsMotion::initialize() return TRUE; } +std::string LLPhysicsMotionController::getString() +{ + std::ostringstream oss; + oss << "{" << std::endl << + "Active: " << mActive << std::endl << + "IsDefault: " << mIsDefault << std::endl << + "Stopped: " << isStopped() << std::endl << + "Name: " << getName() << std::endl << + "ID: " << getID().asString() << std::endl; + + for (motion_vec_t::iterator iter = mMotions.begin();iter != mMotions.end();++iter) + { + (*iter)->getString(oss); + } + oss << "}" << std::endl; + return oss.str(); +} +void getParamString(U32 depth, LLViewerVisualParam *param, std::ostringstream &oss) +{ + std::string indent; + indent.resize(depth,' '); + + oss << + indent << "getID: " << param->getID() << std::endl << + indent << "getName: " << param->getName() << std::endl << + indent << "getDisplayName: " << param->getDisplayName() << std::endl << + indent << "getGroup: " << param->getGroup() << std::endl << + indent << "getSex: " << param->getSex() << std::endl << + indent << "getMinWeight: " << param->getMinWeight() << std::endl << + indent << "getMaxWeight: " << param->getMaxWeight() << std::endl << + indent << "getDefaultWeight: " << param->getDefaultWeight() << std::endl << + indent << "getWeight: " << param->getWeight() << std::endl << + indent << "getCurrentWeight: " << param->getCurrentWeight() << std::endl << + indent << "getLastWeight: " << param->getLastWeight() << std::endl << + indent << "isAnimating: " << param->isAnimating() << std::endl << + indent << "isTweakable: " << param->isTweakable() << std::endl; +} +void LLPhysicsMotion::getString(std::ostringstream &oss) +{ + oss << + " mParamDriverName: " << mParamDriverName << std::endl << + " mParamControllerName: " << mParamControllerName << std::endl << + " mMotionDirectionVec: " << mMotionDirectionVec << std::endl << + " mJointName: " << mJointName << std::endl << + " mPosition_local: " << mPosition_local << std::endl << + " mVelocityJoint_local: " << mVelocityJoint_local << std::endl << + " mAccelerationJoint_local: " << mAccelerationJoint_local << std::endl << + " mPositionLastUpdate_local: " << mPositionLastUpdate_local << std::endl << + " mPosition_world: " << mPosition_world << std::endl << + " mVelocity_local: " << mVelocity_local << std::endl; + if(mParamDriver) + { + oss << " " << std::endl; + getParamString(2,mParamDriver,oss); + LLDriverParam *driver_param = dynamic_cast(mParamDriver); + if(driver_param) + { + for (LLDriverParam::entry_list_t::iterator iter = driver_param->mDriven.begin(); + iter != driver_param->mDriven.end();++iter) + { + oss << " " << std::endl; + getParamString(3,iter->mParam,oss); + } + } + } + else + oss << " mParamDriver: (NULL)" << std::endl; + oss << " Controllers:" << std::endl; + for(controller_map_t::const_iterator it = mParamControllers.begin(); it!= mParamControllers.end(); ++it) + { + oss << " mParamControllers[\"" << it->first << "\"] = \"" << it->second << "\" =" << getParamValue(it->first) << std::endl; + } +} + LLPhysicsMotionController::LLPhysicsMotionController(const LLUUID &id) : LLMotion(id), mCharacter(NULL), diff --git a/indra/newview/llphysicsmotion.h b/indra/newview/llphysicsmotion.h index 3ee44f8d5..7e6bddd17 100644 --- a/indra/newview/llphysicsmotion.h +++ b/indra/newview/llphysicsmotion.h @@ -51,6 +51,9 @@ class LLPhysicsMotionController : public LLMotion { public: + + std::string getString(); + // Constructor LLPhysicsMotionController(const LLUUID &id); diff --git a/indra/newview/llviewerjointattachment.cpp b/indra/newview/llviewerjointattachment.cpp index b89e1eeaa..8e8dcef98 100644 --- a/indra/newview/llviewerjointattachment.cpp +++ b/indra/newview/llviewerjointattachment.cpp @@ -139,7 +139,7 @@ void LLViewerJointAttachment::setupDrawable(LLViewerObject *object) LLViewerObject::const_child_list_t& child_list = object->getChildren(); for (LLViewerObject::child_list_t::const_iterator iter = child_list.begin(); - iter != child_list.end(); iter++) + iter != child_list.end(); ++iter) { LLViewerObject* childp = *iter; if (childp && childp->mDrawable.notNull()) @@ -197,7 +197,7 @@ BOOL LLViewerJointAttachment::addObject(LLViewerObject* object) } LLViewerObject::const_child_list_t& child_list = object->getChildren(); for (LLViewerObject::child_list_t::const_iterator iter = child_list.begin(); - iter != child_list.end(); iter++) + iter != child_list.end(); ++iter) { LLViewerObject* childp = *iter; if (childp && childp->mText.notNull()) @@ -266,7 +266,7 @@ void LLViewerJointAttachment::removeObject(LLViewerObject *object) LLViewerObject::const_child_list_t& child_list = object->getChildren(); for (LLViewerObject::child_list_t::const_iterator iter = child_list.begin(); - iter != child_list.end(); iter++) + iter != child_list.end(); ++iter) { LLViewerObject* childp = *iter; if (childp && childp->mDrawable.notNull()) @@ -291,7 +291,7 @@ void LLViewerJointAttachment::removeObject(LLViewerObject *object) } LLViewerObject::const_child_list_t& child_list = object->getChildren(); for (LLViewerObject::child_list_t::const_iterator iter = child_list.begin(); - iter != child_list.end(); iter++) + iter != child_list.end(); ++iter) { LLViewerObject* childp = *iter; if (childp->mText.notNull()) diff --git a/indra/newview/llviewerjointattachment.h b/indra/newview/llviewerjointattachment.h index 7037db039..269f7158b 100644 --- a/indra/newview/llviewerjointattachment.h +++ b/indra/newview/llviewerjointattachment.h @@ -114,8 +114,8 @@ public: protected: void calcLOD(); void setupDrawable(LLViewerObject *object); - -protected: + +private: BOOL mVisibleInFirst; LLVector3 mOriginalPos; S32 mGroup; diff --git a/indra/newview/shcommandhandler.cpp b/indra/newview/shcommandhandler.cpp index da2cc1aa1..a0c5eb9dd 100644 --- a/indra/newview/shcommandhandler.cpp +++ b/indra/newview/shcommandhandler.cpp @@ -175,4 +175,27 @@ CMD_SCRIPT(gettext) } } +#include "llphysicsmotion.h" + +void cmdline_printchat(std::string message); +CMD_CHAT(physparams) +{ + //args[1] = avatar name + for (std::vector::iterator iter = LLCharacter::sInstances.begin();iter != LLCharacter::sInstances.end(); ++iter) + { + LLVOAvatar* inst = (LLVOAvatar*) *iter; + if(!inst)continue; + if(inst->getFullname().find(args[1].asString())!=std::string::npos) + { + LLPhysicsMotionController *motion = (LLPhysicsMotionController*)(inst->findMotion(LLUUID("7360e029-3cb8-ebc4-863e-212df440d987"))); + cmdline_printchat(std::string("Phys param info for ")+inst->getFullname()+":\n"); + if(motion) + { + cmdline_printchat(motion->getString()); + } + else + cmdline_printchat("Unable to find physics motion controller\n"); + } + } +} #endif //shy_mod From 96f400eb4cdf8fccc7e7bc3c9c0f7cfda2e05e54 Mon Sep 17 00:00:00 2001 From: Shyotl Date: Wed, 4 May 2011 19:55:17 -0500 Subject: [PATCH 03/19] LLViewerObjectList::mDeadObjects has no reason to be a std::map any longer. Converted to std::set as per v2. --- indra/newview/llviewerobjectlist.cpp | 11 ++++++----- indra/newview/llviewerobjectlist.h | 3 +-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/indra/newview/llviewerobjectlist.cpp b/indra/newview/llviewerobjectlist.cpp index 0d61f4886..9fc072b59 100644 --- a/indra/newview/llviewerobjectlist.cpp +++ b/indra/newview/llviewerobjectlist.cpp @@ -827,13 +827,14 @@ void LLViewerObjectList::clearDebugText() void LLViewerObjectList::cleanupReferences(LLViewerObject *objectp) { LLMemType mt(LLMemType::MTYPE_OBJECT); - if (mDeadObjects.count(objectp->mID)) + if (mDeadObjects.find(objectp->mID) != mDeadObjects.end()) { - llinfos << "Object " << objectp->mID << " already on dead list, ignoring cleanup!" << llendl; - return; + llinfos << "Object " << objectp->mID << " already on dead list!" << llendl; + } + else + { + mDeadObjects.insert(objectp->mID); } - - mDeadObjects.insert(std::pair >(objectp->mID, objectp)); // Cleanup any references we have to this object // Remove from object map so noone can look it up. diff --git a/indra/newview/llviewerobjectlist.h b/indra/newview/llviewerobjectlist.h index 868e0ba8b..43d25229e 100644 --- a/indra/newview/llviewerobjectlist.h +++ b/indra/newview/llviewerobjectlist.h @@ -202,8 +202,7 @@ protected: vobj_list_t mMapObjects; - typedef std::map > vo_map; - vo_map mDeadObjects; // Need to keep multiple entries per UUID + std::set mDeadObjects; std::map > mUUIDObjectMap; std::map > mUUIDAvatarMap; From 5b36f29b7651d6e8f941e866643207ac4e09e6c9 Mon Sep 17 00:00:00 2001 From: Shyotl Date: Wed, 4 May 2011 19:56:55 -0500 Subject: [PATCH 04/19] LLViewerObject::setPosition already calls updateDrawable. Removing extra updateDrawablecalls. Referring to cam axis byref. --- indra/newview/lldrawable.cpp | 4 ++-- indra/newview/llviewerobject.cpp | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/indra/newview/lldrawable.cpp b/indra/newview/lldrawable.cpp index 3b62fabb4..e8d6daca4 100644 --- a/indra/newview/lldrawable.cpp +++ b/indra/newview/lldrawable.cpp @@ -704,8 +704,8 @@ void LLDrawable::updateDistance(LLCamera& camera, bool force_update) { LLVector3 box = (facep->mExtents[1] - facep->mExtents[0]) * 0.25f; LLVector3 v = (facep->mCenterLocal-camera.getOrigin()); - LLVector3 at = camera.getAtAxis(); - for (U32 j = 0; j < 3; j++) + const LLVector3& at = camera.getAtAxis(); + for (U32 j = 0; j < 3; j++) { v.mV[j] -= box.mV[j] * at.mV[j]; } diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp index 264948fb4..74a84cd00 100644 --- a/indra/newview/llviewerobject.cpp +++ b/indra/newview/llviewerobject.cpp @@ -3421,8 +3421,8 @@ void LLViewerObject::setPositionParent(const LLVector3 &pos_parent, BOOL damped) // Set position relative to parent, if no parent, relative to region if (!isRoot()) { - LLViewerObject::setPosition(pos_parent); - updateDrawable(damped); + LLViewerObject::setPosition(pos_parent, damped); + //updateDrawable(damped); } else { @@ -3463,6 +3463,7 @@ void LLViewerObject::setPositionEdit(const LLVector3 &pos_edit, BOOL damped) LLVector3 position_offset = getPosition() * getParent()->getRotation(); ((LLViewerObject *)getParent())->setPositionEdit(pos_edit - position_offset); + updateDrawable(damped); } else if (isJointChild()) { @@ -3471,15 +3472,14 @@ void LLViewerObject::setPositionEdit(const LLVector3 &pos_edit, BOOL damped) LLQuaternion inv_parent_rot = parent->getRotation(); inv_parent_rot.transQuat(); LLVector3 pos_parent = (pos_edit - parent->getPositionRegion()) * inv_parent_rot; - LLViewerObject::setPosition(pos_parent); + LLViewerObject::setPosition(pos_parent, damped); } else { - LLViewerObject::setPosition(pos_edit); + LLViewerObject::setPosition(pos_edit, damped); mPositionRegion = pos_edit; mPositionAgent = mRegionp->getPosAgentFromRegion(mPositionRegion); - } - updateDrawable(damped); + } } From f052915f5472347b2269bb2604c7b5cbfcf73942 Mon Sep 17 00:00:00 2001 From: Siana Gearz Date: Fri, 6 May 2011 04:34:32 +0200 Subject: [PATCH 05/19] Fix name in grant/ungrant edit right. Issue 33 --- indra/newview/skins/default/xui/en-us/notifications.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/indra/newview/skins/default/xui/en-us/notifications.xml b/indra/newview/skins/default/xui/en-us/notifications.xml index 066eeee85..18a378707 100644 --- a/indra/newview/skins/default/xui/en-us/notifications.xml +++ b/indra/newview/skins/default/xui/en-us/notifications.xml @@ -2579,14 +2579,14 @@ Please choose the male or female avatar. You can change your mind later. icon="alertmodal.tga" name="GrantedModifyRights" type="alertmodal"> -You have been granted the privilege to modify [FIRST_NAME] [LAST_NAME]'s objects. +You have been granted the privilege to modify [NAME]'s objects. -Your privilege to modify [FIRST_NAME] [LAST_NAME]'s objects has been revoked +Your privilege to modify [NAME]'s objects has been revoked Date: Fri, 6 May 2011 00:20:41 -0500 Subject: [PATCH 06/19] General cleanup. Potential line-width inconsistency tweak. Wearable creation cleanup. --- indra/newview/llagent.cpp | 6 ++++ indra/newview/lldrawable.h | 3 +- indra/newview/llhudrender.cpp | 3 +- indra/newview/llviewerpartsim.cpp | 10 +++--- indra/newview/llvoavatar.cpp | 29 ++++++++--------- indra/newview/llwearablelist.cpp | 53 ++++++++++++------------------- indra/newview/llwearablelist.h | 13 ++++---- 7 files changed, 56 insertions(+), 61 deletions(-) diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp index 39da9489f..eb965d161 100644 --- a/indra/newview/llagent.cpp +++ b/indra/newview/llagent.cpp @@ -7733,6 +7733,7 @@ void LLAgent::sendAgentSetAppearance() } + const bool wearing_physics = !!getWearable(WT_PHYSICS); S32 transmitted_params = 0; for (LLViewerVisualParam* param = (LLViewerVisualParam*)mAvatarObject->getFirstVisualParam(); param; @@ -7746,6 +7747,11 @@ void LLAgent::sendAgentSetAppearance() const F32 param_value = param->getWeight(); const U8 new_weight = F32_to_U8(param_value, param->getMinWeight(), param->getMaxWeight()); msg->addU8Fast(_PREHASH_ParamValue, new_weight ); + //A hack to prevent ruthing on older viewers when phys wearables aren't being worn. + if(!wearing_physics && param->getID() >= 10000) + { + break; + } transmitted_params++; } } diff --git a/indra/newview/lldrawable.h b/indra/newview/lldrawable.h index bd233f856..7202f3476 100644 --- a/indra/newview/lldrawable.h +++ b/indra/newview/lldrawable.h @@ -44,9 +44,7 @@ #include "llquaternion.h" #include "xform.h" #include "llmemtype.h" -#include "llprimitive.h" #include "lldarray.h" -#include "llstat.h" #include "llviewerobject.h" #include "llrect.h" #include "llappviewer.h" // for gFrameTimeSeconds @@ -55,6 +53,7 @@ class LLCamera; class LLDrawPool; class LLDrawable; class LLFace; +class LLFacePool; class LLSpatialGroup; class LLSpatialBridge; class LLSpatialPartition; diff --git a/indra/newview/llhudrender.cpp b/indra/newview/llhudrender.cpp index 2f1a653f5..62ac19671 100644 --- a/indra/newview/llhudrender.cpp +++ b/indra/newview/llhudrender.cpp @@ -113,7 +113,7 @@ void hud_render_text(const LLWString &wstr, const LLVector3 &pos_agent, glMatrixMode(GL_PROJECTION); glPushMatrix(); glMatrixMode(GL_MODELVIEW); - + gGL.pushMatrix(); LLUI::pushMatrix(); gViewerWindow->setup2DRender(); @@ -126,6 +126,7 @@ void hud_render_text(const LLWString &wstr, const LLVector3 &pos_agent, font.render(wstr, 0, 0, 0, color, LLFontGL::LEFT, LLFontGL::BASELINE, style, wstr.length(), 1000, &right_x); LLUI::popMatrix(); + gGL.popMatrix(); glMatrixMode(GL_PROJECTION); glPopMatrix(); diff --git a/indra/newview/llviewerpartsim.cpp b/indra/newview/llviewerpartsim.cpp index 0ef6894ef..216adc892 100644 --- a/indra/newview/llviewerpartsim.cpp +++ b/indra/newview/llviewerpartsim.cpp @@ -71,9 +71,9 @@ const F32 LLViewerPartSim::PART_ADAPT_RATE_MULT_RECIP = 1.0f/PART_ADAPT_RATE_MUL U32 LLViewerPart::sNextPartID = 1; -F32 calc_desired_size(LLVector3 pos, LLVector2 scale) +F32 calc_desired_size(LLViewerCamera* camera, LLVector3 pos, LLVector2 scale) { - F32 desired_size = (pos-LLViewerCamera::getInstance()->getOrigin()).magVec(); + F32 desired_size = (pos - camera->getOrigin()).magVec(); desired_size /= 4; return llclamp(desired_size, scale.magVec()*0.5f, PART_SIM_BOX_SIDE*2); } @@ -274,6 +274,7 @@ void LLViewerPartGroup::updateParticles(const F32 lastdt) LLViewerPartSim::checkParticleCount(mParticles.size()); + LLViewerCamera* camera = LLViewerCamera::getInstance(); LLViewerRegion *regionp = getRegion(); S32 end = (S32) mParticles.size(); for (S32 i = 0 ; i < (S32)mParticles.size();) @@ -395,7 +396,7 @@ void LLViewerPartGroup::updateParticles(const F32 lastdt) } else { - F32 desired_size = calc_desired_size(part->mPosAgent, part->mScale); + F32 desired_size = calc_desired_size(camera, part->mPosAgent, part->mScale); if (!posInGroup(part->mPosAgent, desired_size)) { // Transfer particles between groups @@ -558,7 +559,8 @@ LLViewerPartGroup *LLViewerPartSim::put(LLViewerPart* part) } else { - F32 desired_size = calc_desired_size(part->mPosAgent, part->mScale); + LLViewerCamera* camera = LLViewerCamera::getInstance(); + F32 desired_size = calc_desired_size(camera, part->mPosAgent, part->mScale); S32 count = (S32) mViewerPartGroups.size(); for (S32 i = 0; i < count; i++) diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 9624a2151..85d0e5f4c 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -219,8 +219,10 @@ struct LLAvatarTexData struct LLTextureMaskData { - LLTextureMaskData( const LLUUID& id ) - : mAvatarID(id), mLastDiscardLevel(S32_MAX) {} + LLTextureMaskData( const LLUUID& id ) : + mAvatarID(id), + mLastDiscardLevel(S32_MAX) + {} LLUUID mAvatarID; S32 mLastDiscardLevel; }; @@ -247,10 +249,9 @@ public: } BOOL parseXml(LLXmlTreeNode* node); - BOOL mIsJoint; - private: std::string mName; + BOOL mIsJoint; LLVector3 mPos; LLVector3 mRot; LLVector3 mScale; @@ -770,16 +771,16 @@ LLVOAvatar::LLVOAvatar(const LLUUID& id, mAppearanceAnimating(FALSE), mNameString(), mTitle(), - mRenderedName(), - mUsedNameSystem(), - mClientName(), mNameAway(FALSE), mNameBusy(FALSE), mNameMute(FALSE), + mNameAppearance(FALSE), + mRenderedName(), + mUsedNameSystem(), + mClientName(), mRenderGroupTitles(sRenderGroupTitles), mNameFromChatOverride(false), mNameFromChatChanged(false), - mNameAppearance(FALSE), mRenderTag(FALSE), mLastRegionHandle(0), mRegionCrossingCount(0), @@ -9388,11 +9389,11 @@ void LLVOAvatar::processAvatarAppearance( LLMessageSystem* mesgsys ) for( S32 i = 0; i < num_blocks; i++ ) { - while( param && (!param->isTweakable()) ) + while( param && (param->getGroup() != VISUAL_PARAM_GROUP_TWEAKABLE) ) // should not be any of group VISUAL_PARAM_GROUP_TWEAKABLE_NO_TRANSMIT { param = getNextVisualParam(); } - + if( !param ) { llwarns << "Number of params in AvatarAppearance msg does not match number of params in avatar xml file for " << getFullname() << " (Too many)." << llendl; @@ -9407,7 +9408,7 @@ void LLVOAvatar::processAvatarAppearance( LLMessageSystem* mesgsys ) { mSupportsPhysics = true; } - if(param->getID() == 507 && newWeight != getActualBoobGrav()) + else if(param->getID() == 507 && newWeight != getActualBoobGrav()) { llwarns << "Boob Grav SET to " << newWeight << " for " << getFullname() << llendl; setActualBoobGrav(newWeight); @@ -9443,15 +9444,13 @@ void LLVOAvatar::processAvatarAppearance( LLMessageSystem* mesgsys ) } } - while( param && (!param->isTweakable()) ) + while( param && (param->getGroup() != VISUAL_PARAM_GROUP_TWEAKABLE) ) { param = getNextVisualParam(); } if( param ) { - if (param->getName() == "tattoo_red") - llinfos << getFullname() << " does not have tattoo tinting." << llendl; - else if(param->getName() == "breast_physics_leftright_spring") + if(param->getName() == "breast_physics_mass") llinfos << getFullname() << " does not have avatar physics." << llendl; else llwarns << "Number of params in AvatarAppearance msg does not match number of params in avatar xml file for " << getFullname() << " (Prematurely reached end of list at " << param->getName() << ")." << llendl; diff --git a/indra/newview/llwearablelist.cpp b/indra/newview/llwearablelist.cpp index 512c03fa4..0ab91c58e 100644 --- a/indra/newview/llwearablelist.cpp +++ b/indra/newview/llwearablelist.cpp @@ -219,11 +219,7 @@ LLWearable* LLWearableList::createWearableMatchedToInventoryItem( LLWearable* ol { lldebugs << "LLWearableList::createWearableMatchedToInventoryItem()" << llendl; - LLTransactionID tid; - LLAssetID new_asset_id; - new_asset_id = tid.makeAssetID(gAgent.getSecureSessionID()); - - LLWearable* wearable = new LLWearable( tid ); + LLWearable* wearable = generateNewWearable(); wearable->copyDataFrom( old_wearable ); wearable->setName( item->getName() ); @@ -231,8 +227,6 @@ LLWearable* LLWearableList::createWearableMatchedToInventoryItem( LLWearable* ol wearable->setPermissions( item->getPermissions() ); wearable->setSaleInfo( item->getSaleInfo() ); - mList[ new_asset_id ] = wearable; - // Send to the dataserver wearable->saveNewAsset(); @@ -242,22 +236,15 @@ LLWearable* LLWearableList::createWearableMatchedToInventoryItem( LLWearable* ol LLWearable* LLWearableList::createCopyFromAvatar( LLWearable* old_wearable, const std::string& new_name ) { lldebugs << "LLWearableList::createCopyFromAvatar()" << llendl; - - LLTransactionID tid; - LLAssetID new_asset_id; - tid.generate(); - new_asset_id = tid.makeAssetID(gAgent.getSecureSessionID()); - LLWearable* wearable = new LLWearable( tid ); + LLWearable* wearable = generateNewWearable(); wearable->copyDataFrom( old_wearable ); LLPermissions perm(old_wearable->getPermissions()); perm.setOwnerAndGroup(LLUUID::null, gAgent.getID(), LLUUID::null, true); wearable->setPermissions(perm); wearable->readFromAvatar(); // update from the avatar - - if (!new_name.empty()) wearable->setName(new_name); - mList[ new_asset_id ] = wearable; + if (!new_name.empty()) wearable->setName(new_name); // Send to the dataserver wearable->saveNewAsset(); @@ -270,17 +257,13 @@ LLWearable* LLWearableList::createCopy( LLWearable* old_wearable ) { lldebugs << "LLWearableList::createCopy()" << llendl; - LLTransactionID tid; - LLAssetID new_asset_id; - tid.generate(); - new_asset_id = tid.makeAssetID(gAgent.getSecureSessionID()); - - LLWearable* wearable = new LLWearable( tid ); - wearable->copyDataFrom( old_wearable ); + LLWearable *wearable = generateNewWearable(); + wearable->copyDataFrom(old_wearable); + LLPermissions perm(old_wearable->getPermissions()); perm.setOwnerAndGroup(LLUUID::null, gAgent.getID(), LLUUID::null, true); wearable->setPermissions(perm); - mList[ new_asset_id ] = wearable; + // Send to the dataserver wearable->saveNewAsset(); @@ -292,12 +275,7 @@ LLWearable* LLWearableList::createNewWearable( EWearableType type ) { lldebugs << "LLWearableList::createNewWearable()" << llendl; - LLTransactionID tid; - LLAssetID new_asset_id; - tid.generate(); - new_asset_id = tid.makeAssetID(gAgent.getSecureSessionID()); - - LLWearable* wearable = new LLWearable( tid ); + LLWearable *wearable = generateNewWearable(); wearable->setType( type ); std::string name = "New "; @@ -310,14 +288,23 @@ LLWearable* LLWearableList::createNewWearable( EWearableType type ) wearable->setPermissions(perm); // Description and sale info have default values. - wearable->setParamsToDefaults(); wearable->setTexturesToDefaults(); - mList[ new_asset_id ] = wearable; - // Send to the dataserver wearable->saveNewAsset(); + + return wearable; +} + +LLWearable *LLWearableList::generateNewWearable() +{ + LLTransactionID tid; + tid.generate(); + LLAssetID new_asset_id = tid.makeAssetID(gAgent.getSecureSessionID()); + + LLWearable* wearable = new LLWearable(tid); + mList[new_asset_id] = wearable; return wearable; } diff --git a/indra/newview/llwearablelist.h b/indra/newview/llwearablelist.h index cda0cb11f..8edba5b25 100644 --- a/indra/newview/llwearablelist.h +++ b/indra/newview/llwearablelist.h @@ -45,12 +45,11 @@ public: S32 getLength() { return mList.size(); } - void getAsset( - const LLAssetID& assetID, - const std::string& wearable_name, - LLAssetType::EType asset_type, - void(*asset_arrived_callback)(LLWearable*, void* userdata), - void* userdata ); + void getAsset(const LLAssetID& assetID, + const std::string& wearable_name, + LLAssetType::EType asset_type, + void(*asset_arrived_callback)(LLWearable*, void* userdata), + void* userdata); LLWearable* createWearableMatchedToInventoryItem( LLWearable* old_wearable, LLViewerInventoryItem* item ); LLWearable* createCopyFromAvatar( LLWearable* old_wearable, const std::string& new_name = std::string() ); @@ -61,6 +60,8 @@ public: static void processGetAssetReply(const char* filename, const LLAssetID& assetID, void* user_data, S32 status, LLExtStat ext_status); protected: + LLWearable* generateNewWearable(); // used for the create... functions +private: std::map< LLUUID, LLWearable* > mList; }; From e3f9b4dbbe244ec6bc6d8d8cc6785a199bfe6215 Mon Sep 17 00:00:00 2001 From: Siana Gearz Date: Sat, 7 May 2011 05:47:13 +0200 Subject: [PATCH 07/19] Help me keep track of VBOs --- indra/llrender/llvertexbuffer.cpp | 23 +++++++++++++++++++---- indra/llrender/llvertexbuffer.h | 14 ++------------ indra/newview/llviewerdisplay.cpp | 1 + 3 files changed, 22 insertions(+), 16 deletions(-) diff --git a/indra/llrender/llvertexbuffer.cpp b/indra/llrender/llvertexbuffer.cpp index 1c227eb30..8108eeee8 100644 --- a/indra/llrender/llvertexbuffer.cpp +++ b/indra/llrender/llvertexbuffer.cpp @@ -70,6 +70,22 @@ BOOL LLVertexBuffer::sOmitBlank = FALSE; std::vector LLVertexBuffer::sDeleteList; + +GLuint LLVBOPool::allocateName() +{ + GLuint name; + glGenBuffersARB(1, &name); + LLVertexBuffer::sGLCount++; + return name; +} + +void LLVBOPool::releaseName(GLuint name) +{ + glDeleteBuffersARB(1, &name); + LLVertexBuffer::sGLCount--; +} + + S32 LLVertexBuffer::sTypeOffsets[LLVertexBuffer::TYPE_MAX] = { sizeof(LLVector3), // TYPE_VERTEX, @@ -342,6 +358,7 @@ void LLVertexBuffer::clientCopy(F64 max_time) if (!sDeleteList.empty()) { glDeleteBuffersARB(sDeleteList.size(), (GLuint*) &(sDeleteList[0])); + sGLCount -= sDeleteList.size(); sDeleteList.clear(); } } @@ -432,8 +449,8 @@ void LLVertexBuffer::genBuffer() { BOOST_STATIC_ASSERT(sizeof(mGLBuffer) == sizeof(GLuint)); glGenBuffersARB(1, (GLuint*)&mGLBuffer); + sGLCount++; } - sGLCount++; } void LLVertexBuffer::genIndices() @@ -450,8 +467,8 @@ void LLVertexBuffer::genIndices() { BOOST_STATIC_ASSERT(sizeof(mGLBuffer) == sizeof(GLuint)); glGenBuffersARB(1, (GLuint*)&mGLIndices); + sGLCount++; } - sGLCount++; } void LLVertexBuffer::releaseBuffer() @@ -468,7 +485,6 @@ void LLVertexBuffer::releaseBuffer() { sDeleteList.push_back(mGLBuffer); } - sGLCount--; } void LLVertexBuffer::releaseIndices() @@ -485,7 +501,6 @@ void LLVertexBuffer::releaseIndices() { sDeleteList.push_back(mGLIndices); } - sGLCount--; } void LLVertexBuffer::createGLBuffer() diff --git a/indra/llrender/llvertexbuffer.h b/indra/llrender/llvertexbuffer.h index c7984e615..99c016f29 100644 --- a/indra/llrender/llvertexbuffer.h +++ b/indra/llrender/llvertexbuffer.h @@ -60,20 +60,10 @@ class LLVBOPool : public LLGLNamePool { protected: - virtual GLuint allocateName() - { - GLuint name; - glGenBuffersARB(1, &name); - return name; - } - - virtual void releaseName(GLuint name) - { - glDeleteBuffersARB(1, &name); - } + virtual GLuint allocateName(); + virtual void releaseName(GLuint name); }; - //============================================================================ // base class diff --git a/indra/newview/llviewerdisplay.cpp b/indra/newview/llviewerdisplay.cpp index bd65bd999..ab8dc18f8 100644 --- a/indra/newview/llviewerdisplay.cpp +++ b/indra/newview/llviewerdisplay.cpp @@ -212,6 +212,7 @@ void display_stats() { F32 fps = gRecentFrameCount / fps_log_freq; llinfos << llformat("FPS: %.02f", fps) << llendl; + llinfos << llformat("VBO: %d glVBO: %d", LLVertexBuffer::sCount, LLVertexBuffer::sGLCount) << llendl; gRecentFrameCount = 0; gRecentFPSTime.reset(); } From 7e16e0624ad92c9a1da5bd4975b8f6baf142213e Mon Sep 17 00:00:00 2001 From: Shyotl Date: Sat, 7 May 2011 01:41:28 -0500 Subject: [PATCH 08/19] Scare everyone with a big-arsed warning. Horray! --- indra/newview/app_settings/settings.xml | 11 ++++ indra/newview/llagent.cpp | 51 ++++++++++++++++--- indra/newview/llappviewer.cpp | 1 + .../skins/default/xui/en-us/notifications.xml | 23 +++++++++ 4 files changed, 78 insertions(+), 8 deletions(-) diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 038090663..b821681a3 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -13707,6 +13707,17 @@ Value 1 + WarnFirstPhysicsWearable + + Comment + Enables Physics Wearable warning dialog + Persist + 1 + Type + Boolean + Value + 1 + WatchdogEnabled Comment diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp index eb965d161..49dee2357 100644 --- a/indra/newview/llagent.cpp +++ b/indra/newview/llagent.cpp @@ -7733,7 +7733,8 @@ void LLAgent::sendAgentSetAppearance() } - const bool wearing_physics = !!getWearable(WT_PHYSICS); + static bool send_physics_params = false; + send_physics_params |= !!getWearable(WT_PHYSICS); S32 transmitted_params = 0; for (LLViewerVisualParam* param = (LLViewerVisualParam*)mAvatarObject->getFirstVisualParam(); param; @@ -7741,17 +7742,17 @@ void LLAgent::sendAgentSetAppearance() { if (param->getGroup() == VISUAL_PARAM_GROUP_TWEAKABLE) // do not transmit params of group VISUAL_PARAM_GROUP_TWEAKABLE_NO_TRANSMIT { - msg->nextBlockFast(_PREHASH_VisualParam ); - - // We don't send the param ids. Instead, we assume that the receiver has the same params in the same sequence. - const F32 param_value = param->getWeight(); - const U8 new_weight = F32_to_U8(param_value, param->getMinWeight(), param->getMaxWeight()); - msg->addU8Fast(_PREHASH_ParamValue, new_weight ); //A hack to prevent ruthing on older viewers when phys wearables aren't being worn. - if(!wearing_physics && param->getID() >= 10000) + if(!send_physics_params && param->getID() >= 10000) { break; } + msg->nextBlockFast(_PREHASH_VisualParam ); + // We don't send the param ids. Instead, we assume that the receiver has the same params in the same sequence. + const F32 param_value = param->getWeight(); + const U8 new_weight = F32_to_U8(param_value, param->getMinWeight(), param->getMaxWeight()); + + msg->addU8Fast(_PREHASH_ParamValue, new_weight ); transmitted_params++; } } @@ -7892,6 +7893,30 @@ struct LLSetWearableData LLWearable* mNewWearable; }; +static bool isFirstPhysicsWearable(EWearableType type, LLInventoryItem *new_item, LLWearable *new_wearable) +{ + if (type == WT_PHYSICS && gSavedSettings.getWarning("FirstPhysicsWearable")) + { + class WearableDelayedCallback + { + public: + static void setDelayedWearable( const LLSD& notification, const LLSD& response, LLUUID item_id, LLWearable *wearable ) + { + if(LLNotification::getSelectedOption(notification, response) == 0) //User selected wear + { + gSavedSettings.setWarning("FirstPhysicsWearable",FALSE); + LLInventoryItem *item = gInventory.getItem(item_id); + if(item) + gAgent.setWearable(item,wearable); //re-enter. + } + } + }; + LLNotifications::instance().add("FirstPhysicsWearable",LLSD(),LLSD(),boost::bind(WearableDelayedCallback::setDelayedWearable, _1, _2, new_item->getUUID(),new_wearable)); + return true; + } + return false; +} + BOOL LLAgent::needsReplacement(EWearableType wearableType, S32 remove) { return TRUE; @@ -7961,6 +7986,11 @@ void LLAgent::setWearableOutfit( } } + if (isFirstPhysicsWearable(type, new_item, new_wearable)) + { + return; + } + mWearableEntry[ type ].mItemID = new_item->getUUID(); mWearableEntry[ type ].mWearable = new_wearable; } @@ -8025,6 +8055,11 @@ void LLAgent::setWearable( LLInventoryItem* new_item, LLWearable* new_wearable ) } // [/RLVa:KB] + if (isFirstPhysicsWearable(type, new_item, new_wearable)) + { + return; + } + if( old_wearable ) { const LLUUID& old_item_id = mWearableEntry[ type ].mItemID; diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 38ae9202e..d9b80c9dc 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -1791,6 +1791,7 @@ bool LLAppViewer::initConfiguration() LLFirstUse::addConfigVariable("FirstSculptedPrim"); LLFirstUse::addConfigVariable("FirstVoice"); LLFirstUse::addConfigVariable("FirstMedia"); + LLFirstUse::addConfigVariable("FirstPhysicsWearable"); // [RLVa:KB] - Checked: RLVa-1.0.3a (2009-09-10) | Added: RLVa-1.0.3a //LLFirstUse::addConfigVariable(RLV_SETTING_FIRSTUSE_DETACH); diff --git a/indra/newview/skins/default/xui/en-us/notifications.xml b/indra/newview/skins/default/xui/en-us/notifications.xml index 066eeee85..a6f57bbf3 100644 --- a/indra/newview/skins/default/xui/en-us/notifications.xml +++ b/indra/newview/skins/default/xui/en-us/notifications.xml @@ -6940,5 +6940,28 @@ No Blocked chat-spam from avatar [FULL_NAME] ([SOURCE]) Blocked chat-spam from objects owned by [OWNER] ([SOURCE]) + +By wearing a Physics Wearable certain server behavior will be enabled that many older viewers are incompatable with. On such viewers you may display incorrectly (often as 'Ruth'). + +If you wish to keep compatability with old viewers then you must not wear a Physics Wearable during your session. If you have already worn one during this session remove it and reconnect. + +Click 'Wear' to attach the Physics Wearable, or click 'Cancel' if you wish to maintain compatability with legacy clients. + +
+