From 7e3007b63521c4b0c5bbad1c3964a557fc526ce2 Mon Sep 17 00:00:00 2001 From: Jacek Antonelli Date: Fri, 15 Aug 2008 23:45:57 -0500 Subject: Second Life viewer sources 1.20.11 --- linden/doc/contributions.txt | 3 + linden/indra/llcharacter/llcharacter.cpp | 47 ++- linden/indra/llcharacter/llcharacter.h | 13 +- linden/indra/llcharacter/llkeyframemotion.cpp | 10 +- linden/indra/llcharacter/llkeyframemotionparam.cpp | 53 +-- linden/indra/llcharacter/llkeyframemotionparam.h | 15 +- linden/indra/llcharacter/llmotion.cpp | 17 +- linden/indra/llcharacter/llmotion.h | 25 +- linden/indra/llcharacter/llmotioncontroller.cpp | 461 ++++++++++++--------- linden/indra/llcharacter/llmotioncontroller.h | 58 +-- linden/indra/llcommon/llversionviewer.h | 2 +- linden/indra/llcrashlogger/llcrashlogger.cpp | 10 +- linden/indra/llimage/llimage.cpp | 4 +- linden/indra/llrender/llimagegl.cpp | 8 +- linden/indra/llrender/llimagegl.h | 3 - linden/indra/llwindow/llgl.cpp | 6 + linden/indra/llwindow/llwindowwin32.cpp | 3 - linden/indra/newview/app_settings/settings.xml | 2 +- linden/indra/newview/gpu_table.txt | 2 + linden/indra/newview/llagent.cpp | 9 +- linden/indra/newview/llappviewer.cpp | 16 +- linden/indra/newview/llappviewer.h | 2 +- linden/indra/newview/lldrawable.cpp | 10 +- linden/indra/newview/lldrawpoolalpha.cpp | 1 - linden/indra/newview/lldrawpoolavatar.cpp | 2 +- linden/indra/newview/lldrawpoolbump.cpp | 9 - linden/indra/newview/lldriverparam.cpp | 1 + linden/indra/newview/lldriverparam.h | 3 +- linden/indra/newview/llface.cpp | 4 - linden/indra/newview/llface.h | 3 - linden/indra/newview/llfloateranimpreview.cpp | 191 ++++----- linden/indra/newview/llfloateranimpreview.h | 1 - linden/indra/newview/llfloateravatarinfo.cpp | 8 - linden/indra/newview/llfloatercustomize.h | 1 - linden/indra/newview/llfloatergroups.cpp | 3 +- linden/indra/newview/llhudeffectlookat.cpp | 6 +- linden/indra/newview/llhudeffectpointat.cpp | 6 +- linden/indra/newview/llinventoryactions.cpp | 1 + linden/indra/newview/llinventorybridge.cpp | 1 + linden/indra/newview/llmemoryview.cpp | 23 +- linden/indra/newview/llmutelist.cpp | 28 +- linden/indra/newview/llmutelist.h | 5 +- linden/indra/newview/llpreviewanim.cpp | 1 + linden/indra/newview/llselectmgr.cpp | 9 - linden/indra/newview/llstartup.cpp | 16 +- linden/indra/newview/lltexlayer.h | 1 - linden/indra/newview/llviewerimagelist.cpp | 7 +- linden/indra/newview/llviewerjoint.cpp | 304 +++++++------- linden/indra/newview/llviewerjoint.h | 14 +- linden/indra/newview/llviewerjointattachment.cpp | 1 - linden/indra/newview/llviewerjointattachment.h | 2 - linden/indra/newview/llviewerjointmesh.cpp | 2 +- linden/indra/newview/llviewerjointmesh.h | 2 +- linden/indra/newview/llviewernetwork.cpp | 11 +- linden/indra/newview/llviewerobjectlist.cpp | 1 - linden/indra/newview/llviewerstats.cpp | 1 + linden/indra/newview/llviewerwindow.cpp | 1 - linden/indra/newview/llvoavatar.cpp | 142 +++---- linden/indra/newview/llvoavatar.h | 7 +- linden/indra/newview/llvoiceclient.h | 2 - linden/indra/newview/llwebbrowserctrl.cpp | 2 +- .../newview/macview.xcodeproj/project.pbxproj | 1 + linden/indra/newview/pipeline.cpp | 13 +- linden/indra/newview/releasenotes.txt | 56 ++- .../newview/skins/xui/de/teleport_strings.xml | 2 +- .../newview/skins/xui/en-us/floater_buy_land.xml | 8 - .../newview/skins/xui/en-us/floater_directory.xml | 7 +- .../indra/newview/skins/xui/en-us/floater_hud.xml | 2 +- .../newview/skins/xui/en-us/floater_url_entry.xml | 2 - .../newview/skins/xui/en-us/teleport_strings.xml | 2 +- linden/indra/newview/skins/xui/ja/menu_viewer.xml | 2 +- .../newview/skins/xui/ja/teleport_strings.xml | 2 +- .../newview/skins/xui/ko/teleport_strings.xml | 2 +- 73 files changed, 899 insertions(+), 802 deletions(-) (limited to 'linden') diff --git a/linden/doc/contributions.txt b/linden/doc/contributions.txt index 7c5b54c..d688df6 100644 --- a/linden/doc/contributions.txt +++ b/linden/doc/contributions.txt @@ -53,6 +53,7 @@ Alissa Sabre VWR-7153 VWR-7168 VWR-7087 + VWR-7086 Angus Boyd VWR-592 Argent Stonecutter @@ -361,6 +362,8 @@ Tharax Ferraris Thraxis Epsilon SVC-371 VWR-383 +Wilton Lundquist + VWR-7682 Whoops Babii VWR-631 VWR-1640 diff --git a/linden/indra/llcharacter/llcharacter.cpp b/linden/indra/llcharacter/llcharacter.cpp index ad648f8..83487bc 100644 --- a/linden/indra/llcharacter/llcharacter.cpp +++ b/linden/indra/llcharacter/llcharacter.cpp @@ -103,11 +103,11 @@ LLJoint *LLCharacter::getJoint( const std::string &name ) } //----------------------------------------------------------------------------- -// addMotion() +// registerMotion() //----------------------------------------------------------------------------- -BOOL LLCharacter::addMotion( const LLUUID& id, LLMotionConstructor create ) +BOOL LLCharacter::registerMotion( const LLUUID& id, LLMotionConstructor create ) { - return mMotionController.addMotion(id, create); + return mMotionController.registerMotion(id, create); } //----------------------------------------------------------------------------- @@ -119,7 +119,16 @@ void LLCharacter::removeMotion( const LLUUID& id ) } //----------------------------------------------------------------------------- -// getMotion() +// findMotion() +//----------------------------------------------------------------------------- +LLMotion* LLCharacter::findMotion( const LLUUID &id ) +{ + return mMotionController.findMotion( id ); +} + +//----------------------------------------------------------------------------- +// createMotion() +// NOTE: Always assign the result to a LLPointer! //----------------------------------------------------------------------------- LLMotion* LLCharacter::createMotion( const LLUUID &id ) { @@ -168,26 +177,24 @@ void LLCharacter::requestStopMotion( LLMotion* motion) //----------------------------------------------------------------------------- -// updateMotion() +// updateMotions() //----------------------------------------------------------------------------- -void LLCharacter::updateMotion(BOOL force_update) +void LLCharacter::updateMotions(e_update_t update_type) { - // unpause if we're forcing an update or - // number of outstanding pause requests has dropped - // to the initial one - if (mMotionController.isPaused() && - (force_update || mPauseRequest->getNumRefs() == 1)) + LLFastTimer t(LLFastTimer::FTM_UPDATE_ANIMATION); + if (update_type == HIDDEN_UPDATE) { - mMotionController.unpause(); + mMotionController.updateMotionsMinimal(); } - - mMotionController.updateMotion(); - - // pause once again, after forced update, if there are outstanding - // pause requests - if (force_update && mPauseRequest->getNumRefs() > 1) + else { - mMotionController.pause(); + // unpause if the number of outstanding pause requests has dropped to the initial one + if (mMotionController.isPaused() && mPauseRequest->getNumRefs() == 1) + { + mMotionController.unpauseAllMotions(); + } + bool force_update = (update_type == FORCE_UPDATE); + mMotionController.updateMotions(force_update); } } @@ -499,7 +506,7 @@ void LLCharacter::updateVisualParams() LLAnimPauseRequest LLCharacter::requestPause() { - mMotionController.pause(); + mMotionController.pauseAllMotions(); return mPauseRequest; } diff --git a/linden/indra/llcharacter/llcharacter.h b/linden/indra/llcharacter/llcharacter.h index 7a841ef..ba807bc 100644 --- a/linden/indra/llcharacter/llcharacter.h +++ b/linden/indra/llcharacter/llcharacter.h @@ -137,13 +137,16 @@ public: //------------------------------------------------------------------------- // registers a motion with the character // returns true if successfull - BOOL addMotion( const LLUUID& id, LLMotionConstructor create ); + BOOL registerMotion( const LLUUID& id, LLMotionConstructor create ); void removeMotion( const LLUUID& id ); - // returns an instance of a registered motion + // returns an instance of a registered motion, creating one if necessary LLMotion* createMotion( const LLUUID &id ); + // returns an existing instance of a registered motion + LLMotion* findMotion( const LLUUID &id ); + // start a motion // returns true if successful, false if an error occurred virtual BOOL startMotion( const LLUUID& id, F32 start_offset = 0.f); @@ -161,12 +164,16 @@ public: virtual void requestStopMotion( LLMotion* motion ); // periodic update function, steps the motion controller - void updateMotion(BOOL force_update = FALSE); + enum e_update_t { NORMAL_UPDATE, HIDDEN_UPDATE, FORCE_UPDATE }; + void updateMotions(e_update_t update_type); LLAnimPauseRequest requestPause(); BOOL areAnimationsPaused() { return mMotionController.isPaused(); } void setAnimTimeFactor(F32 factor) { mMotionController.setTimeFactor(factor); } void setTimeStep(F32 time_step) { mMotionController.setTimeStep(time_step); } + + LLMotionController& getMotionController() { return mMotionController; } + // Releases all motion instances which should result in // no cached references to character joint data. This is // useful if a character wants to rebuild it's skeleton. diff --git a/linden/indra/llcharacter/llkeyframemotion.cpp b/linden/indra/llcharacter/llkeyframemotion.cpp index 0138860..34decd6 100644 --- a/linden/indra/llcharacter/llkeyframemotion.cpp +++ b/linden/indra/llcharacter/llkeyframemotion.cpp @@ -1977,9 +1977,8 @@ void LLKeyframeMotion::onLoadComplete(LLVFS *vfs, LLCharacter* character = *char_iter; - // create an instance of this motion (it may or may not already exist) - LLKeyframeMotion* motionp = (LLKeyframeMotion*) character->createMotion(asset_uuid); - + // look for an existing instance of this motion + LLKeyframeMotion* motionp = (LLKeyframeMotion*) character->findMotion(asset_uuid); if (motionp) { if (0 == status) @@ -2008,7 +2007,7 @@ void LLKeyframeMotion::onLoadComplete(LLVFS *vfs, motionp->mAssetStatus = ASSET_FETCH_FAILED; } - delete []buffer; + delete[] buffer; } else { @@ -2018,8 +2017,7 @@ void LLKeyframeMotion::onLoadComplete(LLVFS *vfs, } else { - // motionp is NULL - llwarns << "Failed to createMotion() for asset UUID " << asset_uuid << llendl; + llwarns << "No existing motion for asset data. UUID: " << asset_uuid << llendl; } } diff --git a/linden/indra/llcharacter/llkeyframemotionparam.cpp b/linden/indra/llcharacter/llkeyframemotionparam.cpp index 106c02c..0e7388c 100644 --- a/linden/indra/llcharacter/llkeyframemotionparam.cpp +++ b/linden/indra/llcharacter/llkeyframemotionparam.cpp @@ -76,7 +76,7 @@ LLKeyframeMotionParam::~LLKeyframeMotionParam() for (motion_list_t::iterator iter2 = motionList.begin(); iter2 != motionList.end(); ++iter2) { const ParameterizedMotion& paramMotion = *iter2; - delete paramMotion.first; // note - deletes the structure; ParameterizedMotion pair remains intact + delete paramMotion.mMotion; } motionList.clear(); } @@ -102,32 +102,32 @@ LLMotion::LLMotionInitStatus LLKeyframeMotionParam::onInitialize(LLCharacter *ch for (motion_list_t::iterator iter2 = motionList.begin(); iter2 != motionList.end(); ++iter2) { const ParameterizedMotion& paramMotion = *iter2; + LLMotion* motion = paramMotion.mMotion; + motion->onInitialize(character); - paramMotion.first->onInitialize(character); - - if (paramMotion.first->getDuration() > mEaseInDuration) + if (motion->getDuration() > mEaseInDuration) { - mEaseInDuration = paramMotion.first->getEaseInDuration(); + mEaseInDuration = motion->getEaseInDuration(); } - if (paramMotion.first->getEaseOutDuration() > mEaseOutDuration) + if (motion->getEaseOutDuration() > mEaseOutDuration) { - mEaseOutDuration = paramMotion.first->getEaseOutDuration(); + mEaseOutDuration = motion->getEaseOutDuration(); } - if (paramMotion.first->getDuration() > mDuration) + if (motion->getDuration() > mDuration) { - mDuration = paramMotion.first->getDuration(); + mDuration = motion->getDuration(); } - if (paramMotion.first->getPriority() > mPriority) + if (motion->getPriority() > mPriority) { - mPriority = paramMotion.first->getPriority(); + mPriority = motion->getPriority(); } - LLPose *pose = paramMotion.first->getPose(); + LLPose *pose = motion->getPose(); - mPoseBlender.addMotion(paramMotion.first); + mPoseBlender.addMotion(motion); for (LLJointState *jsp = pose->getFirstJointState(); jsp; jsp = pose->getNextJointState()) { LLPose *blendedPose = mPoseBlender.getBlendedPose(); @@ -151,7 +151,7 @@ BOOL LLKeyframeMotionParam::onActivate() for (motion_list_t::iterator iter2 = motionList.begin(); iter2 != motionList.end(); ++iter2) { const ParameterizedMotion& paramMotion = *iter2; - paramMotion.first->activate(); + paramMotion.mMotion->activate(mActivationTimestamp); } } return TRUE; @@ -173,8 +173,8 @@ BOOL LLKeyframeMotionParam::onUpdate(F32 time, U8* joint_mask) for (motion_list_t::iterator iter2 = motionList.begin(); iter2 != motionList.end(); ++iter2) { const ParameterizedMotion& paramMotion = *iter2; -// llinfos << "Weight for pose " << paramMotion.first->getName() << " is " << paramMotion.first->getPose()->getWeight() << llendl; - paramMotion.first->getPose()->setWeight(0.f); +// llinfos << "Weight for pose " << paramMotion.mMotion->getName() << " is " << paramMotion.mMotion->getPose()->getWeight() << llendl; + paramMotion.mMotion->getPose()->setWeight(0.f); } } @@ -190,6 +190,7 @@ BOOL LLKeyframeMotionParam::onUpdate(F32 time, U8* joint_mask) continue; } + // DANGER! Do not modify mParameterizedMotions while using these pointers! const ParameterizedMotion* firstMotion = NULL; const ParameterizedMotion* secondMotion = NULL; @@ -197,9 +198,9 @@ BOOL LLKeyframeMotionParam::onUpdate(F32 time, U8* joint_mask) for (motion_list_t::iterator iter2 = motionList.begin(); iter2 != motionList.end(); ++iter2) { const ParameterizedMotion& paramMotion = *iter2; - paramMotion.first->onUpdate(time, joint_mask); + paramMotion.mMotion->onUpdate(time, joint_mask); - F32 distToParam = paramMotion.second - *paramValue; + F32 distToParam = paramMotion.mParam - *paramValue; if ( distToParam <= 0.f) { @@ -227,12 +228,12 @@ BOOL LLKeyframeMotionParam::onUpdate(F32 time, U8* joint_mask) LLPose *secondPose; if (firstMotion) - firstPose = firstMotion->first->getPose(); + firstPose = firstMotion->mMotion->getPose(); else firstPose = NULL; if (secondMotion) - secondPose = secondMotion->first->getPose(); + secondPose = secondMotion->mMotion->getPose(); else secondPose = NULL; @@ -243,7 +244,7 @@ BOOL LLKeyframeMotionParam::onUpdate(F32 time, U8* joint_mask) { firstPose->setWeight(weightFactor); } - else if (firstMotion->second == secondMotion->second) + else if (firstMotion->mParam == secondMotion->mParam) { firstPose->setWeight(0.5f * weightFactor); secondPose->setWeight(0.5f * weightFactor); @@ -251,8 +252,8 @@ BOOL LLKeyframeMotionParam::onUpdate(F32 time, U8* joint_mask) else { F32 first_weight = 1.f - - ((llclamp(*paramValue - firstMotion->second, 0.f, (secondMotion->second - firstMotion->second))) / - (secondMotion->second - firstMotion->second)); + ((llclamp(*paramValue - firstMotion->mParam, 0.f, (secondMotion->mParam - firstMotion->mParam))) / + (secondMotion->mParam - firstMotion->mParam)); first_weight = llclamp(first_weight, 0.f, 1.f); F32 second_weight = 1.f - first_weight; @@ -290,7 +291,7 @@ void LLKeyframeMotionParam::onDeactivate() for (motion_list_t::iterator iter2 = motionList.begin(); iter2 != motionList.end(); ++iter2) { const ParameterizedMotion& paramMotion = *iter2; - paramMotion.first->onDeactivate(); + paramMotion.mMotion->onDeactivate(); } } } @@ -328,9 +329,9 @@ void LLKeyframeMotionParam::setDefaultKeyframeMotion(char *name) for (motion_list_t::iterator iter2 = motionList.begin(); iter2 != motionList.end(); ++iter2) { const ParameterizedMotion& paramMotion = *iter2; - if (paramMotion.first->getName() == name) + if (paramMotion.mMotion->getName() == name) { - mDefaultKeyframeMotion = paramMotion.first; + mDefaultKeyframeMotion = paramMotion.mMotion; } } } diff --git a/linden/indra/llcharacter/llkeyframemotionparam.h b/linden/indra/llcharacter/llkeyframemotionparam.h index f509e6a..0d17141 100644 --- a/linden/indra/llcharacter/llkeyframemotionparam.h +++ b/linden/indra/llcharacter/llkeyframemotionparam.h @@ -126,7 +126,12 @@ protected: //------------------------------------------------------------------------- // new functions defined by this subclass //------------------------------------------------------------------------- - typedef std::pair ParameterizedMotion; + struct ParameterizedMotion + { + ParameterizedMotion(LLMotion* motion, F32 param) : mMotion(motion), mParam(param) {} + LLMotion* mMotion; + F32 mParam; + }; // add a motion and associated parameter triplet BOOL addKeyframeMotion(char *name, const LLUUID &id, char *param, F32 value); @@ -134,8 +139,6 @@ protected: // set default motion for LOD and retrieving blend constants void setDefaultKeyframeMotion(char *); - static BOOL sortFunc(ParameterizedMotion *new_motion, ParameterizedMotion *tested_motion); - BOOL loadMotions(); protected: @@ -147,10 +150,10 @@ protected: { bool operator() (const ParameterizedMotion& a, const ParameterizedMotion& b) const { - if (a.second != b.second) - return (a.second < b.second); + if (a.mParam != b.mParam) + return (a.mParam < b.mParam); else - return a.first < b.first; + return a.mMotion < b.mMotion; } }; diff --git a/linden/indra/llcharacter/llmotion.cpp b/linden/indra/llcharacter/llmotion.cpp index f7b8f1f..54fcaa5 100644 --- a/linden/indra/llcharacter/llmotion.cpp +++ b/linden/indra/llcharacter/llmotion.cpp @@ -127,6 +127,13 @@ void LLMotion::setDeactivateCallback( void (*cb)(void *), void* userdata ) mDeactivateCallbackUserData = userdata; } +//virtual +void LLMotion::setStopTime(F32 time) +{ + mStopTimestamp = time; + mStopped = TRUE; +} + BOOL LLMotion::isBlending() { return mPose.getWeight() < 1.f; @@ -135,8 +142,9 @@ BOOL LLMotion::isBlending() //----------------------------------------------------------------------------- // activate() //----------------------------------------------------------------------------- -void LLMotion::activate() +void LLMotion::activate(F32 time) { + mActivationTimestamp = time; mStopped = FALSE; mActive = TRUE; onActivate(); @@ -150,7 +158,12 @@ void LLMotion::deactivate() mActive = FALSE; mPose.setWeight(0.f); - if (mDeactivateCallback) (*mDeactivateCallback)(mDeactivateCallbackUserData); + if (mDeactivateCallback) + { + (*mDeactivateCallback)(mDeactivateCallbackUserData); + mDeactivateCallback = NULL; // only call callback once + mDeactivateCallbackUserData = NULL; + } onDeactivate(); } diff --git a/linden/indra/llcharacter/llmotion.h b/linden/indra/llcharacter/llmotion.h index c7bb55d..5a622a8 100644 --- a/linden/indra/llcharacter/llmotion.h +++ b/linden/indra/llcharacter/llmotion.h @@ -48,6 +48,8 @@ class LLCharacter; //----------------------------------------------------------------------------- class LLMotion { + friend class LLMotionController; + public: typedef enum LLMotionBlendType { @@ -73,10 +75,6 @@ public: // functions to support MotionController and MotionRegistry //------------------------------------------------------------------------- - // static constructor - // all subclasses must implement such a function and register it - static LLMotion *create(const LLUUID &id) { return NULL; } - // get the name of this instance const std::string &getName() const { return mName; } @@ -96,7 +94,7 @@ public: F32 getStopTime() const { return mStopTimestamp; } - virtual void setStopTime(F32 time) { mStopTimestamp = time; mStopped = TRUE; } + virtual void setStopTime(F32 time); BOOL isStopped() const { return mStopped; } @@ -104,12 +102,18 @@ public: BOOL isBlending(); - void activate(); - + // Activation functions. + // It is OK for other classes to activate a motion, + // but only the controller can deactivate it. + // Thus, if mActive == TRUE, the motion *may* be on the controllers active list, + // but if mActive == FALSE, the motion is gauranteed not to be on the active list. +protected: + // Used by LLMotionController only void deactivate(); - BOOL isActive() { return mActive; } - +public: + void activate(F32 time); + public: //------------------------------------------------------------------------- // animation callbacks to be implemented by subclasses @@ -170,14 +174,13 @@ protected: BOOL mStopped; // motion has been stopped; BOOL mActive; // motion is on active list (can be stopped or not stopped) -public: //------------------------------------------------------------------------- // these are set implicitly by the motion controller and // may be referenced (read only) in the above handlers. //------------------------------------------------------------------------- std::string mName; // instance name assigned by motion controller LLUUID mID; - + F32 mActivationTimestamp; // time when motion was activated F32 mStopTimestamp; // time when motion was told to stop F32 mSendStopTimestamp; // time when simulator should be told to stop this motion diff --git a/linden/indra/llcharacter/llmotioncontroller.cpp b/linden/indra/llcharacter/llmotioncontroller.cpp index 028cf22..90a3d74 100644 --- a/linden/indra/llcharacter/llmotioncontroller.cpp +++ b/linden/indra/llcharacter/llmotioncontroller.cpp @@ -34,6 +34,8 @@ //----------------------------------------------------------------------------- #include "linden_common.h" +#include "llmemtype.h" + #include "llmotioncontroller.h" #include "llkeyframemotion.h" #include "llmath.h" @@ -50,32 +52,6 @@ const U32 MAX_MOTION_INSTANCES = 32; LLMotionRegistry LLMotionController::sRegistry; //----------------------------------------------------------------------------- -// LLMotionTableEntry() -//----------------------------------------------------------------------------- -LLMotionTableEntry::LLMotionTableEntry() -{ - mConstructor = NULL; - mID.setNull(); -} - -LLMotionTableEntry::LLMotionTableEntry(LLMotionConstructor constructor, const LLUUID& id) - : mConstructor(constructor), mID(id) -{ - -} - -//----------------------------------------------------------------------------- -// create() -//----------------------------------------------------------------------------- -LLMotion* LLMotionTableEntry::create(const LLUUID &id) -{ - LLMotion* motionp = mConstructor(id); - - return motionp; -} - - -//----------------------------------------------------------------------------- //----------------------------------------------------------------------------- // LLMotionRegistry class //----------------------------------------------------------------------------- @@ -85,7 +61,7 @@ LLMotion* LLMotionTableEntry::create(const LLUUID &id) // LLMotionRegistry() // Class Constructor //----------------------------------------------------------------------------- -LLMotionRegistry::LLMotionRegistry() : mMotionTable(LLMotionTableEntry::uuidEq, LLMotionTableEntry()) +LLMotionRegistry::LLMotionRegistry() { } @@ -97,19 +73,19 @@ LLMotionRegistry::LLMotionRegistry() : mMotionTable(LLMotionTableEntry::uuidEq, //----------------------------------------------------------------------------- LLMotionRegistry::~LLMotionRegistry() { - mMotionTable.removeAll(); + mMotionTable.clear(); } //----------------------------------------------------------------------------- // addMotion() //----------------------------------------------------------------------------- -BOOL LLMotionRegistry::addMotion( const LLUUID& id, LLMotionConstructor constructor ) +BOOL LLMotionRegistry::registerMotion( const LLUUID& id, LLMotionConstructor constructor ) { -// llinfos << "Registering motion: " << name << llendl; - if (!mMotionTable.check(id)) + // llinfos << "Registering motion: " << name << llendl; + if (!is_in_map(mMotionTable, id)) { - mMotionTable.set(id, LLMotionTableEntry(constructor, id)); + mMotionTable[id] = constructor; return TRUE; } @@ -121,7 +97,7 @@ BOOL LLMotionRegistry::addMotion( const LLUUID& id, LLMotionConstructor construc //----------------------------------------------------------------------------- void LLMotionRegistry::markBad( const LLUUID& id ) { - mMotionTable.set(id, LLMotionTableEntry()); + mMotionTable[id] = LLMotionConstructor(NULL); } //----------------------------------------------------------------------------- @@ -129,17 +105,17 @@ void LLMotionRegistry::markBad( const LLUUID& id ) //----------------------------------------------------------------------------- LLMotion *LLMotionRegistry::createMotion( const LLUUID &id ) { - LLMotionTableEntry motion_entry = mMotionTable.get(id); + LLMotionConstructor constructor = get_if_there(mMotionTable, id, LLMotionConstructor(NULL)); LLMotion* motion = NULL; - if ( motion_entry.getID().isNull() ) + if ( constructor == NULL ) { // *FIX: need to replace with a better default scheme. RN motion = LLKeyframeMotion::create(id); } else { - motion = motion_entry.create(id); + motion = constructor(id); } return motion; @@ -155,18 +131,19 @@ LLMotion *LLMotionRegistry::createMotion( const LLUUID &id ) // LLMotionController() // Class Constructor //----------------------------------------------------------------------------- -LLMotionController::LLMotionController( ) +LLMotionController::LLMotionController() + : mTimeFactor(1.f), + mCharacter(NULL), + mAnimTime(0.f), + mPrevTimerElapsed(0.f), + mLastTime(0.0f), + mHasRunOnce(FALSE), + mPaused(FALSE), + mPauseTime(0.f), + mTimeStep(0.f), + mTimeStepCount(0), + mLastInterp(0.f) { - mTime = 0.f; - mTimeOffset = 0.f; - mLastTime = 0.0f; - mHasRunOnce = FALSE; - mPaused = FALSE; - mPauseTime = 0.f; - mTimeStep = 0.f; - mTimeStepCount = 0; - mLastInterp = 0.f; - mTimeFactor = 1.f; } @@ -179,6 +156,15 @@ LLMotionController::~LLMotionController() deleteAllMotions(); } +void LLMotionController::incMotionCounts(S32& num_motions, S32& num_loading_motions, S32& num_loaded_motions, S32& num_active_motions, S32& num_deprecated_motions) +{ + num_motions += mAllMotions.size(); + num_loading_motions += mLoadingMotions.size(); + num_loaded_motions += mLoadedMotions.size(); + num_active_motions += mActiveMotions.size(); + num_deprecated_motions += mDeprecatedMotions.size(); +} + //----------------------------------------------------------------------------- // deleteAllMotions() //----------------------------------------------------------------------------- @@ -193,24 +179,38 @@ void LLMotionController::deleteAllMotions() } //----------------------------------------------------------------------------- -// addLoadedMotion() +// purgeExcessMotion() //----------------------------------------------------------------------------- -void LLMotionController::addLoadedMotion(LLMotion* motionp) +void LLMotionController::purgeExcessMotions() { - std::set motions_to_kill; + if (mLoadedMotions.size() > MAX_MOTION_INSTANCES) + { + // clean up deprecated motions + for (motion_set_t::iterator deprecated_motion_it = mDeprecatedMotions.begin(); + deprecated_motion_it != mDeprecatedMotions.end(); ) + { + motion_set_t::iterator cur_iter = deprecated_motion_it++; + LLMotion* cur_motionp = *cur_iter; + if (!isMotionActive(cur_motionp)) + { + // Motion is deprecated so we know it's not cannonical, + // we can safely remove the instance + removeMotionInstance(cur_motionp); // modifies mDeprecatedMotions + mDeprecatedMotions.erase(cur_iter); + } + } + } - // gather all inactive, loaded motions + std::set motions_to_kill; if (mLoadedMotions.size() > MAX_MOTION_INSTANCES) { // too many motions active this frame, kill all blenders mPoseBlender.clearBlenders(); - - for (motion_list_t::iterator loaded_motion_it = mLoadedMotions.begin(); - loaded_motion_it != mLoadedMotions.end(); - ++loaded_motion_it) + for (motion_set_t::iterator loaded_motion_it = mLoadedMotions.begin(); + loaded_motion_it != mLoadedMotions.end(); + ++loaded_motion_it) { LLMotion* cur_motionp = *loaded_motion_it; - // motion isn't playing, delete it if (!isMotionActive(cur_motionp)) { @@ -218,7 +218,7 @@ void LLMotionController::addLoadedMotion(LLMotion* motionp) } } } - + // clean up all inactive, loaded motions for (std::set::iterator motion_it = motions_to_kill.begin(); motion_it != motions_to_kill.end(); @@ -234,8 +234,28 @@ void LLMotionController::addLoadedMotion(LLMotion* motionp) } } - // add new motion to loaded list - mLoadedMotions.push_back(motionp); + if (mLoadedMotions.size() > 2*MAX_MOTION_INSTANCES) + { + LL_WARNS_ONCE("Animation") << "> " << 2*MAX_MOTION_INSTANCES << " Loaded Motions" << llendl; + } +} + +//----------------------------------------------------------------------------- +// deactivateStoppedMotions() +//----------------------------------------------------------------------------- +void LLMotionController::deactivateStoppedMotions() +{ + // Since we're hidden, deactivate any stopped motions. + for (motion_list_t::iterator iter = mActiveMotions.begin(); + iter != mActiveMotions.end(); ) + { + motion_list_t::iterator curiter = iter++; + LLMotion* motionp = *curiter; + if (motionp->isStopped()) + { + deactivateMotionInstance(motionp); + } + } } //----------------------------------------------------------------------------- @@ -252,9 +272,10 @@ void LLMotionController::setTimeStep(F32 step) iter != mActiveMotions.end(); ++iter) { LLMotion* motionp = *iter; - motionp->mActivationTimestamp = (F32)llfloor(motionp->mActivationTimestamp / step) * step; + F32 activation_time = motionp->mActivationTimestamp; + motionp->mActivationTimestamp = (F32)(llfloor(activation_time / step)) * step; BOOL stopped = motionp->isStopped(); - motionp->setStopTime((F32)llfloor(motionp->getStopTime() / step) * step); + motionp->setStopTime((F32)(llfloor(motionp->getStopTime() / step)) * step); motionp->setStopped(stopped); motionp->mSendStopTimestamp = (F32)llfloor(motionp->mSendStopTimestamp / step) * step; } @@ -266,7 +287,6 @@ void LLMotionController::setTimeStep(F32 step) //----------------------------------------------------------------------------- void LLMotionController::setTimeFactor(F32 time_factor) { - mTimeOffset += mTimer.getElapsedTimeAndResetF32() * mTimeFactor; mTimeFactor = time_factor; } @@ -280,11 +300,11 @@ void LLMotionController::setCharacter(LLCharacter *character) //----------------------------------------------------------------------------- -// addMotion() +// registerMotion() //----------------------------------------------------------------------------- -BOOL LLMotionController::addMotion( const LLUUID& id, LLMotionConstructor constructor ) +BOOL LLMotionController::registerMotion( const LLUUID& id, LLMotionConstructor constructor ) { - return sRegistry.addMotion(id, constructor); + return sRegistry.registerMotion(id, constructor); } //----------------------------------------------------------------------------- @@ -293,10 +313,8 @@ BOOL LLMotionController::addMotion( const LLUUID& id, LLMotionConstructor constr void LLMotionController::removeMotion( const LLUUID& id) { LLMotion* motionp = findMotion(id); - - removeMotionInstance(motionp); - mAllMotions.erase(id); + removeMotionInstance(motionp); } // removes instance of a motion from all runtime structures, but does @@ -306,10 +324,11 @@ void LLMotionController::removeMotionInstance(LLMotion* motionp) { if (motionp) { - stopMotionInstance(motionp, TRUE); - + llassert(findMotion(motionp->getID()) != motionp); + if (motionp->isActive()) + motionp->deactivate(); mLoadingMotions.erase(motionp); - mLoadedMotions.remove(motionp); + mLoadedMotions.erase(motionp); mActiveMotions.remove(motionp); delete motionp; } @@ -320,6 +339,7 @@ void LLMotionController::removeMotionInstance(LLMotion* motionp) //----------------------------------------------------------------------------- LLMotion* LLMotionController::createMotion( const LLUUID &id ) { + LLMemType mt(LLMemType::MTYPE_ANIMATION); // do we have an instance of this motion for this character? LLMotion *motion = findMotion(id); @@ -353,8 +373,8 @@ LLMotion* LLMotionController::createMotion( const LLUUID &id ) mLoadingMotions.insert(motion); break; case LLMotion::STATUS_SUCCESS: - // add motion to our list - addLoadedMotion(motion); + // add motion to our list + mLoadedMotions.insert(motion); break; default: llerrs << "Invalid initialization status" << llendl; @@ -377,6 +397,7 @@ BOOL LLMotionController::startMotion(const LLUUID &id, F32 start_offset) // motion that is stopping will be allowed to stop but // replaced by a new instance of that motion if (motion + && !mPaused && motion->canDeprecate() && motion->getFadeWeight() > 0.01f // not LOD-ed out && (motion->isBlending() || motion->getStopTime() != 0.f)) @@ -403,7 +424,7 @@ BOOL LLMotionController::startMotion(const LLUUID &id, F32 start_offset) } // llinfos << "Starting motion " << name << llendl; - return activateMotionInstance(motion, mTime - start_offset); + return activateMotionInstance(motion, mAnimTime - start_offset); } @@ -414,7 +435,6 @@ BOOL LLMotionController::stopMotionLocally(const LLUUID &id, BOOL stop_immediate { // if already inactive, return false LLMotion *motion = findMotion(id); - return stopMotionInstance(motion, stop_immediate); } @@ -428,12 +448,7 @@ BOOL LLMotionController::stopMotionInstance(LLMotion* motion, BOOL stop_immediat // If on active list, stop it if (isMotionActive(motion) && !motion->isStopped()) { - // when using timesteps, set stop time to last frame's time, otherwise grab current timer value - // *FIX: should investigate this inconsistency...hints of obscure bugs - - F32 stop_time = (mTimeStep != 0.f || mPaused) ? (mTime) : mTimeOffset + (mTimer.getElapsedTimeF32() * mTimeFactor); - motion->setStopTime(stop_time); - + motion->setStopTime(mAnimTime); if (stop_immediate) { deactivateMotionInstance(motion); @@ -449,7 +464,6 @@ BOOL LLMotionController::stopMotionInstance(LLMotion* motion, BOOL stop_immediat return FALSE; } - //----------------------------------------------------------------------------- // updateRegularMotions() //----------------------------------------------------------------------------- @@ -476,6 +490,59 @@ void LLMotionController::resetJointSignatures() } //----------------------------------------------------------------------------- +// updateIdleMotion() +// minimal updates for active motions +//----------------------------------------------------------------------------- +void LLMotionController::updateIdleMotion(LLMotion* motionp) +{ + if (motionp->isStopped() && mAnimTime > motionp->getStopTime() + motionp->getEaseOutDuration()) + { + deactivateMotionInstance(motionp); + } + else if (motionp->isStopped() && mAnimTime > motionp->getStopTime()) + { + // is this the first iteration in the ease out phase? + if (mLastTime <= motionp->getStopTime()) + { + // store residual weight for this motion + motionp->mResidualWeight = motionp->getPose()->getWeight(); + } + } + else if (mAnimTime > motionp->mSendStopTimestamp) + { + // notify character of timed stop event on first iteration past sendstoptimestamp + // this will only be called when an animation stops itself (runs out of time) + if (mLastTime <= motionp->mSendStopTimestamp) + { + mCharacter->requestStopMotion( motionp ); + stopMotionInstance(motionp, FALSE); + } + } + else if (mAnimTime >= motionp->mActivationTimestamp) + { + if (mLastTime < motionp->mActivationTimestamp) + { + motionp->mResidualWeight = motionp->getPose()->getWeight(); + } + } +} + +//----------------------------------------------------------------------------- +// updateIdleActiveMotions() +// Call this instead of updateMotionsByType for hidden avatars +//----------------------------------------------------------------------------- +void LLMotionController::updateIdleActiveMotions() +{ + for (motion_list_t::iterator iter = mActiveMotions.begin(); + iter != mActiveMotions.end(); ) + { + motion_list_t::iterator curiter = iter++; + LLMotion* motionp = *curiter; + updateIdleMotion(motionp); + } +} + +//----------------------------------------------------------------------------- // updateMotionsByType() //----------------------------------------------------------------------------- void LLMotionController::updateMotionsByType(LLMotion::LLMotionBlendType anim_type) @@ -530,36 +597,7 @@ void LLMotionController::updateMotionsByType(LLMotion::LLMotionBlendType anim_ty if (!update_motion) { - if (motionp->isStopped() && mTime > motionp->getStopTime() + motionp->getEaseOutDuration()) - { - deactivateMotionInstance(motionp); - } - else if (motionp->isStopped() && mTime > motionp->getStopTime()) - { - // is this the first iteration in the ease out phase? - if (mLastTime <= motionp->getStopTime()) - { - // store residual weight for this motion - motionp->mResidualWeight = motionp->getPose()->getWeight(); - } - } - else if (mTime > motionp->mSendStopTimestamp) - { - // notify character of timed stop event on first iteration past sendstoptimestamp - // this will only be called when an animation stops itself (runs out of time) - if (mLastTime <= motionp->mSendStopTimestamp) - { - mCharacter->requestStopMotion( motionp ); - stopMotionInstance(motionp, FALSE); - } - } - else if (mTime >= motionp->mActivationTimestamp) - { - if (mLastTime < motionp->mActivationTimestamp) - { - motionp->mResidualWeight = motionp->getPose()->getWeight(); - } - } + updateIdleMotion(motionp); continue; } @@ -571,7 +609,7 @@ void LLMotionController::updateMotionsByType(LLMotion::LLMotionBlendType anim_ty motionp->fadeOut(); //should we notify the simulator that this motion should be stopped (check even if skipped by LOD logic) - if (mTime > motionp->mSendStopTimestamp) + if (mAnimTime > motionp->mSendStopTimestamp) { // notify character of timed stop event on first iteration past sendstoptimestamp // this will only be called when an animation stops itself (runs out of time) @@ -584,7 +622,7 @@ void LLMotionController::updateMotionsByType(LLMotion::LLMotionBlendType anim_ty if (motionp->getFadeWeight() < 0.01f) { - if (motionp->isStopped() && mTime > motionp->getStopTime() + motionp->getEaseOutDuration()) + if (motionp->isStopped() && mAnimTime > motionp->getStopTime() + motionp->getEaseOutDuration()) { posep->setWeight(0.f); deactivateMotionInstance(motionp); @@ -600,7 +638,7 @@ void LLMotionController::updateMotionsByType(LLMotion::LLMotionBlendType anim_ty //********************** // MOTION INACTIVE //********************** - if (motionp->isStopped() && mTime > motionp->getStopTime() + motionp->getEaseOutDuration()) + if (motionp->isStopped() && mAnimTime > motionp->getStopTime() + motionp->getEaseOutDuration()) { // this motion has gone on too long, deactivate it // did we have a chance to stop it? @@ -622,7 +660,7 @@ void LLMotionController::updateMotionsByType(LLMotion::LLMotionBlendType anim_ty //********************** // MOTION EASE OUT //********************** - else if (motionp->isStopped() && mTime > motionp->getStopTime()) + else if (motionp->isStopped() && mAnimTime > motionp->getStopTime()) { // is this the first iteration in the ease out phase? if (mLastTime <= motionp->getStopTime()) @@ -637,22 +675,22 @@ void LLMotionController::updateMotionsByType(LLMotion::LLMotionBlendType anim_ty } else { - posep->setWeight(motionp->getFadeWeight() * motionp->mResidualWeight * cubic_step(1.f - ((mTime - motionp->getStopTime()) / motionp->getEaseOutDuration()))); + posep->setWeight(motionp->getFadeWeight() * motionp->mResidualWeight * cubic_step(1.f - ((mAnimTime - motionp->getStopTime()) / motionp->getEaseOutDuration()))); } // perform motion update - update_result = motionp->onUpdate(mTime - motionp->mActivationTimestamp, last_joint_signature); + update_result = motionp->onUpdate(mAnimTime - motionp->mActivationTimestamp, last_joint_signature); } //********************** // MOTION ACTIVE //********************** - else if (mTime > motionp->mActivationTimestamp + motionp->getEaseInDuration()) + else if (mAnimTime > motionp->mActivationTimestamp + motionp->getEaseInDuration()) { posep->setWeight(motionp->getFadeWeight()); //should we notify the simulator that this motion should be stopped? - if (mTime > motionp->mSendStopTimestamp) + if (mAnimTime > motionp->mSendStopTimestamp) { // notify character of timed stop event on first iteration past sendstoptimestamp // this will only be called when an animation stops itself (runs out of time) @@ -664,13 +702,13 @@ void LLMotionController::updateMotionsByType(LLMotion::LLMotionBlendType anim_ty } // perform motion update - update_result = motionp->onUpdate(mTime - motionp->mActivationTimestamp, last_joint_signature); + update_result = motionp->onUpdate(mAnimTime - motionp->mActivationTimestamp, last_joint_signature); } //********************** // MOTION EASE IN //********************** - else if (mTime >= motionp->mActivationTimestamp) + else if (mAnimTime >= motionp->mActivationTimestamp) { if (mLastTime < motionp->mActivationTimestamp) { @@ -683,10 +721,10 @@ void LLMotionController::updateMotionsByType(LLMotion::LLMotionBlendType anim_ty else { // perform motion update - posep->setWeight(motionp->getFadeWeight() * motionp->mResidualWeight + (1.f - motionp->mResidualWeight) * cubic_step((mTime - motionp->mActivationTimestamp) / motionp->getEaseInDuration())); + posep->setWeight(motionp->getFadeWeight() * motionp->mResidualWeight + (1.f - motionp->mResidualWeight) * cubic_step((mAnimTime - motionp->mActivationTimestamp) / motionp->getEaseInDuration())); } // perform motion update - update_result = motionp->onUpdate(mTime - motionp->mActivationTimestamp, last_joint_signature); + update_result = motionp->onUpdate(mAnimTime - motionp->mActivationTimestamp, last_joint_signature); } else { @@ -697,7 +735,7 @@ void LLMotionController::updateMotionsByType(LLMotion::LLMotionBlendType anim_ty // allow motions to deactivate themselves if (!update_result) { - if (!motionp->isStopped() || motionp->getStopTime() > mTime) + if (!motionp->isStopped() || motionp->getStopTime() > mAnimTime) { // animation has stopped itself due to internal logic // propagate this to the network @@ -713,18 +751,68 @@ void LLMotionController::updateMotionsByType(LLMotion::LLMotionBlendType anim_ty } } +//----------------------------------------------------------------------------- +// updateLoadingMotions() +//----------------------------------------------------------------------------- +void LLMotionController::updateLoadingMotions() +{ + // query pending motions for completion + for (motion_set_t::iterator iter = mLoadingMotions.begin(); + iter != mLoadingMotions.end(); ) + { + motion_set_t::iterator curiter = iter++; + LLMotion* motionp = *curiter; + if( !motionp) + { + continue; // maybe shouldn't happen but i've seen it -MG + } + LLMotion::LLMotionInitStatus status = motionp->onInitialize(mCharacter); + if (status == LLMotion::STATUS_SUCCESS) + { + mLoadingMotions.erase(curiter); + // add motion to our loaded motion list + mLoadedMotions.insert(motionp); + // this motion should be playing + if (!motionp->isStopped()) + { + activateMotionInstance(motionp, mAnimTime); + } + } + else if (status == LLMotion::STATUS_FAILURE) + { + llinfos << "Motion " << motionp->getID() << " init failed." << llendl; + sRegistry.markBad(motionp->getID()); + mLoadingMotions.erase(curiter); + mAllMotions.erase(motionp->getID()); + delete motionp; + } + } +} + +//----------------------------------------------------------------------------- +// call updateMotion() or updateMotionsMinimal() every frame +//----------------------------------------------------------------------------- //----------------------------------------------------------------------------- // updateMotion() //----------------------------------------------------------------------------- -void LLMotionController::updateMotion() +void LLMotionController::updateMotions(bool force_update) { BOOL use_quantum = (mTimeStep != 0.f); + // Always update mPrevTimerElapsed + F32 cur_time = mTimer.getElapsedTimeF32(); + F32 delta_time = cur_time - mPrevTimerElapsed; + mPrevTimerElapsed = cur_time; + mLastTime = mAnimTime; + + // Always cap the number of loaded motions + purgeExcessMotions(); + // Update timing info for this time step. if (!mPaused) { - F32 update_time = mTimeOffset + (mTimer.getElapsedTimeF32() * mTimeFactor); + F32 update_time = mAnimTime + delta_time * mTimeFactor; if (use_quantum) { F32 time_interval = fmodf(update_time, mTimeStep); @@ -740,7 +828,8 @@ void LLMotionController::updateMotion() mPoseBlender.interpolate(interp - mLastInterp); mLastInterp = interp; } - + + updateLoadingMotions(); return; } @@ -749,53 +838,24 @@ void LLMotionController::updateMotion() clearBlenders(); mTimeStepCount = quantum_count; - mLastTime = mTime; - mTime = (F32)quantum_count * mTimeStep; + mAnimTime = (F32)quantum_count * mTimeStep; mLastInterp = 0.f; } else { - mLastTime = mTime; - mTime = update_time; + mAnimTime = update_time; } } - // query pending motions for completion - for (motion_set_t::iterator iter = mLoadingMotions.begin(); - iter != mLoadingMotions.end(); ) - { - motion_set_t::iterator curiter = iter++; - LLMotion* motionp = *curiter; - if( !motionp) - { - continue; // maybe shouldn't happen but i've seen it -MG - } - LLMotion::LLMotionInitStatus status = motionp->onInitialize(mCharacter); - if (status == LLMotion::STATUS_SUCCESS) - { - mLoadingMotions.erase(curiter); - // add motion to our loaded motion list - addLoadedMotion(motionp); - // this motion should be playing - if (!motionp->isStopped()) - { - activateMotionInstance(motionp, mTime); - } - } - else if (status == LLMotion::STATUS_FAILURE) - { - llinfos << "Motion " << motionp->getID() << " init failed." << llendl; - sRegistry.markBad(motionp->getID()); - mLoadingMotions.erase(curiter); - - mAllMotions.erase(motionp->getID()); - delete motionp; - } - } + updateLoadingMotions(); resetJointSignatures(); - if (!mPaused) + if (mPaused && !force_update) + { + updateIdleActiveMotions(); + } + else { // update additive motions updateAdditiveMotions(); @@ -818,6 +878,23 @@ void LLMotionController::updateMotion() // llinfos << "Motion controller time " << motionTimer.getElapsedTimeF32() << llendl; } +//----------------------------------------------------------------------------- +// updateMotionsMinimal() +// minimal update (e.g. while hidden) +//----------------------------------------------------------------------------- +void LLMotionController::updateMotionsMinimal() +{ + // Always update mPrevTimerElapsed + mPrevTimerElapsed = mTimer.getElapsedTimeF32(); + + purgeExcessMotions(); + updateLoadingMotions(); + resetJointSignatures(); + + deactivateStoppedMotions(); + + mHasRunOnce = TRUE; +} //----------------------------------------------------------------------------- // activateMotionInstance() @@ -840,7 +917,6 @@ BOOL LLMotionController::activateMotionInstance(LLMotion *motion, F32 time) } motion->mResidualWeight = motion->getPose()->getWeight(); - motion->mActivationTimestamp = time; // set stop time based on given duration and ease out time if (motion->getDuration() != 0.f && !motion->getLoop()) @@ -861,13 +937,26 @@ BOOL LLMotionController::activateMotionInstance(LLMotion *motion, F32 time) { motion->mSendStopTimestamp = F32_MAX; } - - mActiveMotions.remove(motion); // in case it is already in the active list + + if (motion->isActive()) + { + mActiveMotions.remove(motion); + } mActiveMotions.push_front(motion); - motion->activate(); + motion->activate(time); motion->onUpdate(0.f, mJointSignature[1]); + if (mAnimTime >= motion->mSendStopTimestamp) + { + motion->setStopTime(motion->mSendStopTimestamp); + if (motion->mResidualWeight == 0.0f) + { + // bit of a hack; if newly activating a motion while easing out, weight should = 1 + motion->mResidualWeight = 1.f; + } + } + return TRUE; } @@ -924,9 +1013,17 @@ bool LLMotionController::isMotionLoading(LLMotion* motion) //----------------------------------------------------------------------------- // findMotion() //----------------------------------------------------------------------------- -LLMotion *LLMotionController::findMotion(const LLUUID& id) +LLMotion* LLMotionController::findMotion(const LLUUID& id) { - return get_if_there(mAllMotions, id, NULL); + motion_map_t::iterator iter = mAllMotions.find(id); + if(iter == mAllMotions.end()) + { + return NULL; + } + else + { + return iter->second; + } } //----------------------------------------------------------------------------- @@ -934,16 +1031,12 @@ LLMotion *LLMotionController::findMotion(const LLUUID& id) //----------------------------------------------------------------------------- void LLMotionController::deactivateAllMotions() { - //They must all die, precious. - for (std::map::iterator iter = mAllMotions.begin(); + for (motion_map_t::iterator iter = mAllMotions.begin(); iter != mAllMotions.end(); iter++) { LLMotion* motionp = iter->second; - if (motionp) motionp->deactivate(); + deactivateMotionInstance(motionp); } - - // delete all motion instances - deleteAllMotions(); } @@ -959,11 +1052,12 @@ void LLMotionController::flushAllMotions() { motion_list_t::iterator curiter = iter++; LLMotion* motionp = *curiter; - F32 dtime = mTime - motionp->mActivationTimestamp; + F32 dtime = mAnimTime - motionp->mActivationTimestamp; active_motions.push_back(std::make_pair(motionp->getID(),dtime)); - motionp->deactivate(); + motionp->deactivate(); // don't call deactivateMotionInstance() because we are going to reactivate it } - + mActiveMotions.clear(); + // delete all motion instances deleteAllMotions(); @@ -982,12 +1076,11 @@ void LLMotionController::flushAllMotions() //----------------------------------------------------------------------------- // pause() //----------------------------------------------------------------------------- -void LLMotionController::pause() +void LLMotionController::pauseAllMotions() { if (!mPaused) { //llinfos << "Pausing animations..." << llendl; - mPauseTime = mTimer.getElapsedTimeF32(); mPaused = TRUE; } @@ -996,13 +1089,11 @@ void LLMotionController::pause() //----------------------------------------------------------------------------- // unpause() //----------------------------------------------------------------------------- -void LLMotionController::unpause() +void LLMotionController::unpauseAllMotions() { if (mPaused) { //llinfos << "Unpausing animations..." << llendl; - mTimer.reset(); - mTimer.setAge(mPauseTime); mPaused = FALSE; } } diff --git a/linden/indra/llcharacter/llmotioncontroller.h b/linden/indra/llcharacter/llmotioncontroller.h index 48e184d..209f689 100644 --- a/linden/indra/llcharacter/llmotioncontroller.h +++ b/linden/indra/llcharacter/llmotioncontroller.h @@ -57,30 +57,6 @@ class LLCharacter; //----------------------------------------------------------------------------- typedef LLMotion*(*LLMotionConstructor)(const LLUUID &id); -class LLMotionTableEntry -{ -public: - LLMotionTableEntry(); - LLMotionTableEntry(LLMotionConstructor constructor, const LLUUID& id); - ~LLMotionTableEntry(){}; - - LLMotion* create(const LLUUID& id); - static BOOL uuidEq(const LLUUID &uuid, const LLMotionTableEntry &id_pair) - { - if (uuid == id_pair.mID) - { - return TRUE; - } - return FALSE; - } - - const LLUUID& getID() { return mID; } - -protected: - LLMotionConstructor mConstructor; - LLUUID mID; -}; - class LLMotionRegistry { public: @@ -92,7 +68,7 @@ public: // adds motion classes to the registry // returns true if successfull - BOOL addMotion( const LLUUID& id, LLMotionConstructor create); + BOOL registerMotion( const LLUUID& id, LLMotionConstructor create); // creates a new instance of a named motion // returns NULL motion is not registered @@ -103,7 +79,8 @@ public: protected: - LLUUIDHashMap mMotionTable; + typedef std::map motion_map_t; + motion_map_t mMotionTable; }; //----------------------------------------------------------------------------- @@ -130,7 +107,7 @@ public: // registers a motion with the controller // (actually just forwards call to motion registry) // returns true if successfull - BOOL addMotion( const LLUUID& id, LLMotionConstructor create ); + BOOL registerMotion( const LLUUID& id, LLMotionConstructor create ); // creates a motion from the registry LLMotion *createMotion( const LLUUID &id ); @@ -151,11 +128,17 @@ public: // returns true if successful BOOL stopMotionLocally( const LLUUID &id, BOOL stop_immediate ); + // Move motions from loading to loaded + void updateLoadingMotions(); + // update motions // invokes the update handlers for each active motion // activates sequenced motions // deactivates terminated motions` - void updateMotion(); + void updateMotions(bool force_update = false); + + // minimal update (e.g. while hidden) + void updateMotionsMinimal(); void clearBlenders() { mPoseBlender.clearBlenders(); } @@ -167,8 +150,8 @@ public: void deactivateAllMotions(); // pause and continue all motions - void pause(); - void unpause(); + void pauseAllMotions(); + void unpauseAllMotions(); BOOL isPaused() { return mPaused; } void setTimeStep(F32 step); @@ -178,6 +161,8 @@ public: motion_list_t& getActiveMotions() { return mActiveMotions; } + void incMotionCounts(S32& num_motions, S32& num_loading_motions, S32& num_loaded_motions, S32& num_active_motions, S32& num_deprecated_motions); + //protected: bool isMotionActive( LLMotion *motion ); bool isMotionLoading( LLMotion *motion ); @@ -187,7 +172,6 @@ protected: // internal operations act on motion instances directly // as there can be duplicate motions per id during blending overlap void deleteAllMotions(); - void addLoadedMotion(LLMotion *motion); BOOL activateMotionInstance(LLMotion *motion, F32 time); BOOL deactivateMotionInstance(LLMotion *motion); void deprecateMotionInstance(LLMotion* motion); @@ -197,6 +181,10 @@ protected: void updateAdditiveMotions(); void resetJointSignatures(); void updateMotionsByType(LLMotion::LLMotionBlendType motion_type); + void updateIdleMotion(LLMotion* motionp); + void updateIdleActiveMotions(); + void purgeExcessMotions(); + void deactivateStoppedMotions(); protected: F32 mTimeFactor; @@ -210,20 +198,20 @@ protected: // Animations are instantiated and immediately put in the mAllMotions map for their entire lifetime. // If the animations depend on any asset data, the appropriate data is fetched from the data server, // and the animation is put on the mLoadingMotions list. -// Once an animations is loaded, it will be initialized and put on the mLoadedMotions deque. +// Once an animations is loaded, it will be initialized and put on the mLoadedMotions list. // Any animation that is currently playing also sits in the mActiveMotions list. typedef std::map motion_map_t; motion_map_t mAllMotions; motion_set_t mLoadingMotions; - motion_list_t mLoadedMotions; + motion_set_t mLoadedMotions; motion_list_t mActiveMotions; motion_set_t mDeprecatedMotions; LLFrameTimer mTimer; - F32 mTime; - F32 mTimeOffset; + F32 mPrevTimerElapsed; + F32 mAnimTime; F32 mLastTime; BOOL mHasRunOnce; BOOL mPaused; diff --git a/linden/indra/llcommon/llversionviewer.h b/linden/indra/llcommon/llversionviewer.h index 75cc463..4121eb5 100644 --- a/linden/indra/llcommon/llversionviewer.h +++ b/linden/indra/llcommon/llversionviewer.h @@ -34,7 +34,7 @@ const S32 LL_VERSION_MAJOR = 1; const S32 LL_VERSION_MINOR = 20; -const S32 LL_VERSION_PATCH = 10; +const S32 LL_VERSION_PATCH = 11; const S32 LL_VERSION_BUILD = 0; const char * const LL_CHANNEL = "Second Life Release"; diff --git a/linden/indra/llcrashlogger/llcrashlogger.cpp b/linden/indra/llcrashlogger/llcrashlogger.cpp index 0fd8f63..306046a 100755 --- a/linden/indra/llcrashlogger/llcrashlogger.cpp +++ b/linden/indra/llcrashlogger/llcrashlogger.cpp @@ -158,7 +158,15 @@ void LLCrashLogger::gatherFiles() LLSDSerialize::fromXML(mDebugLog, debug_log_file); mFileMap["SecondLifeLog"] = mDebugLog["SLLog"].asString(); mFileMap["SettingsXml"] = mDebugLog["SettingsFilename"].asString(); - LLCurl::setCAFile(mDebugLog["CAFilename"].asString()); + if(mDebugLog.has("CAFilename")) + { + LLCurl::setCAFile(mDebugLog["CAFilename"].asString()); + } + else + { + LLCurl::setCAFile(gDirUtilp->getCAFile()); + } + llinfos << "Using log file from debug log " << mFileMap["SecondLifeLog"] << llendl; llinfos << "Using settings file from debug log " << mFileMap["SettingsXml"] << llendl; } diff --git a/linden/indra/llimage/llimage.cpp b/linden/indra/llimage/llimage.cpp index 65d19de..508be01 100644 --- a/linden/indra/llimage/llimage.cpp +++ b/linden/indra/llimage/llimage.cpp @@ -842,8 +842,8 @@ void LLImageRaw::scale( S32 new_width, S32 new_height, BOOL scale_image_data ) U8* temp_buffer = new U8[ temp_data_size ]; if (!temp_buffer) { - llerrs << "Out of memory in LLImageRaw::scale( S32 new_width, S32 new_height, BOOL scale_image_data )" << llendl; - return; + llerrs << "Out of memory in LLImageRaw::scale: old (w, h, c) = (" << old_width << ", " << old_height << ", " << (S32)getComponents() << + ") ; new (w, h, c) = (" << new_width << ", " << new_height << ", " << (S32)getComponents() << ")" << llendl; } memcpy(temp_buffer, getData(), temp_data_size); /* Flawfinder: ignore */ diff --git a/linden/indra/llrender/llimagegl.cpp b/linden/indra/llrender/llimagegl.cpp index 454a5bb..a402814 100644 --- a/linden/indra/llrender/llimagegl.cpp +++ b/linden/indra/llrender/llimagegl.cpp @@ -61,8 +61,6 @@ S32 LLImageGL::sCount = 0; BOOL LLImageGL::sGlobalUseAnisotropic = FALSE; F32 LLImageGL::sLastFrameTime = 0.f; -BOOL LLImageGL::sRefCheck = TRUE ; - std::set LLImageGL::sImageList; //---------------------------------------------------------------------------- @@ -279,9 +277,7 @@ LLImageGL::LLImageGL(const LLImageRaw* imageraw, BOOL usemipmaps) sImageList.insert(this); sCount++; - sRefCheck = FALSE ; createGLTexture(0, imageraw); - sRefCheck = TRUE ; } LLImageGL::~LLImageGL() @@ -426,9 +422,7 @@ void LLImageGL::dump() //---------------------------------------------------------------------------- BOOL LLImageGL::bindTextureInternal(const S32 stage) const -{ - llassert_always(!sRefCheck || (getNumRefs() > 0 && getNumRefs() < 100000)) ; - +{ if (gGLManager.mIsDisabled) { llwarns << "Trying to bind a texture while GL is disabled!" << llendl; diff --git a/linden/indra/llrender/llimagegl.h b/linden/indra/llrender/llimagegl.h index 99a6e49..3f231ee 100644 --- a/linden/indra/llrender/llimagegl.h +++ b/linden/indra/llrender/llimagegl.h @@ -207,9 +207,6 @@ public: #else BOOL getMissed() const { return FALSE; }; #endif - -private://paranoia error check - static BOOL sRefCheck ; }; #endif // LL_LLIMAGEGL_H diff --git a/linden/indra/llwindow/llgl.cpp b/linden/indra/llwindow/llgl.cpp index e8169b6..debf2e3 100644 --- a/linden/indra/llwindow/llgl.cpp +++ b/linden/indra/llwindow/llgl.cpp @@ -990,6 +990,12 @@ void LLGLState::initClass() { sStateMap[GL_DITHER] = GL_TRUE; sStateMap[GL_TEXTURE_2D] = GL_TRUE; + + //make sure vertex arrays are enabled + glEnableClientState(GL_VERTEX_ARRAY); + + //make sure multi sampling is disabled by default + glDisable(GL_MULTISAMPLE_ARB); } //static diff --git a/linden/indra/llwindow/llwindowwin32.cpp b/linden/indra/llwindow/llwindowwin32.cpp index 70487b7..2001899 100644 --- a/linden/indra/llwindow/llwindowwin32.cpp +++ b/linden/indra/llwindow/llwindowwin32.cpp @@ -1346,9 +1346,6 @@ BOOL LLWindowWin32::switchContext(BOOL fullscreen, const LLCoordScreen &size, BO SetWindowLong(mWindowHandle, GWL_USERDATA, (U32)this); show(); - //make sure multi sampling is disabled by default - glDisable(GL_MULTISAMPLE_ARB); - //register joystick timer callback SetTimer( mWindowHandle, 0, 1000 / 30, NULL ); // 30 fps timer diff --git a/linden/indra/newview/app_settings/settings.xml b/linden/indra/newview/app_settings/settings.xml index 18ca143..9d074ad 100644 --- a/linden/indra/newview/app_settings/settings.xml +++ b/linden/indra/newview/app_settings/settings.xml @@ -9921,7 +9921,7 @@ Type Boolean Value - 0 + 1 WaterEditPresets diff --git a/linden/indra/newview/gpu_table.txt b/linden/indra/newview/gpu_table.txt index f0b0f0c..f038e0f 100644 --- a/linden/indra/newview/gpu_table.txt +++ b/linden/indra/newview/gpu_table.txt @@ -186,6 +186,7 @@ NVIDIA GeForce Go 6700 .*NVIDIA.*GeForce Go 67.* 1 1 NVIDIA GeForce Go 6800 .*NVIDIA.*GeForce Go 68.* 1 1 NVIDIA GeForce Go 7200 .*NVIDIA.*GeForce Go 72.* 1 1 NVIDIA GeForce Go 7300 .*NVIDIA.*GeForce Go 73.* 1 1 +NVIDIA GeForce Go 7300 LE .*NVIDIA.*GeForce Go 73.*LE.* 0 1 NVIDIA GeForce Go 7400 .*NVIDIA.*GeForce Go 74.* 1 1 NVIDIA GeForce Go 7600 .*NVIDIA.*GeForce Go 76.* 2 1 NVIDIA GeForce Go 7700 .*NVIDIA.*GeForce Go 77.* 2 1 @@ -194,6 +195,7 @@ NVIDIA GeForce Go 7900 .*NVIDIA.*GeForce Go 79.* 2 1 NVIDIA GeForce Go 6 .*GeForce Go 6.* 1 1 NVIDIA GeForce PCX .*GeForce PCX.* 0 1 NVIDIA Generic .*NVIDIA.*Unknown.* 0 0 +NVIDIA NV34 .*NVIDIA.*NV34.* 0 1 NVIDIA NV43 .*NVIDIA.*NV43.* 1 1 NVIDIA MCP78 .*NVIDIA.*MCP78.* 1 1 NVIDIA Quadro2 .*Quadro2.* 0 1 diff --git a/linden/indra/newview/llagent.cpp b/linden/indra/newview/llagent.cpp index 1d3c5d4..b65a1f6 100644 --- a/linden/indra/newview/llagent.cpp +++ b/linden/indra/newview/llagent.cpp @@ -6429,6 +6429,7 @@ BOOL LLAgent::isWearingItem( const LLUUID& item_id ) return (getWearableFromWearableItem( item_id ) != NULL); } +extern LLString gInitialOutfit; // static void LLAgent::processAgentInitialWearablesUpdate( LLMessageSystem* mesgsys, void** user_data ) @@ -6468,8 +6469,12 @@ void LLAgent::processAgentInitialWearablesUpdate( LLMessageSystem* mesgsys, void //avatar->createStandardWearables(); // no, deal with it by noting that we need to choose a - // gender. - gAgent.setGenderChosen(FALSE); + // gender, but only if an initial outfit load isn't happening. + // This whole check (num_wearables < 4) can probably be deleted. JC + if (gInitialOutfit.empty()) + { + gAgent.setGenderChosen(FALSE); + } return; } diff --git a/linden/indra/newview/llappviewer.cpp b/linden/indra/newview/llappviewer.cpp index 96d96dc..1ec2c14 100644 --- a/linden/indra/newview/llappviewer.cpp +++ b/linden/indra/newview/llappviewer.cpp @@ -530,7 +530,7 @@ void LLAppViewer::initGridChoice() LLString custom_server = gSavedSettings.getString("CustomServer"); LLViewerLogin::getInstance()->setGridChoice(custom_server); } - else if(server != 0) + else if(server != (S32)GRID_INFO_NONE) { LLViewerLogin::getInstance()->setGridChoice((EGridInfo)server); } @@ -1139,12 +1139,12 @@ bool LLAppViewer::cleanup() llinfos << "Cleaning Up" << llendflush; - LLKeyframeDataCache::clear(); - // Must clean up texture references before viewer window is destroyed. LLHUDObject::cleanupHUDObjects(); llinfos << "HUD Objects cleaned up" << llendflush; + LLKeyframeDataCache::clear(); + // End TransferManager before deleting systems it depends on (Audio, VFS, AssetStorage) #if 0 // this seems to get us stuck in an infinite loop... gTransferManager.cleanup(); @@ -1322,7 +1322,7 @@ bool LLAppViewer::cleanup() removeMarkerFile(); // Any crashes from here on we'll just have to ignore - closeDebug(); + writeDebugInfo(); // Let threads finish LLTimer idleTimer; @@ -2139,7 +2139,7 @@ bool LLAppViewer::initWindow() return true; } -void LLAppViewer::closeDebug() +void LLAppViewer::writeDebugInfo() { std::string debug_filename = gDirUtilp->getExpandedFilename(LL_PATH_LOGS,"debug_info.log"); llinfos << "Opening debug file " << debug_filename << llendl; @@ -2219,6 +2219,8 @@ void LLAppViewer::writeSystemInfo() gDebugInfo["ClientInfo"]["PatchVersion"] = LL_VERSION_PATCH; gDebugInfo["ClientInfo"]["BuildVersion"] = LL_VERSION_BUILD; + gDebugInfo["CAFilename"] = gDirUtilp->getCAFile(); + gDebugInfo["CPUInfo"]["CPUString"] = gSysCPU.getCPUString(); gDebugInfo["CPUInfo"]["CPUFamily"] = gSysCPU.getFamily(); gDebugInfo["CPUInfo"]["CPUMhz"] = gSysCPU.getMhz(); @@ -2257,6 +2259,8 @@ void LLAppViewer::writeSystemInfo() LL_INFOS("SystemInfo") << "Memory info:\n" << gSysMemory << LL_ENDL; LL_INFOS("SystemInfo") << "OS: " << getOSInfo().getOSStringSimple() << LL_ENDL; LL_INFOS("SystemInfo") << "OS info: " << getOSInfo() << LL_ENDL; + + writeDebugInfo(); // Save out debug_info.log early, in case of crash. } void LLAppViewer::handleSyncViewerCrash() @@ -2376,7 +2380,7 @@ void LLAppViewer::handleViewerCrash() LLWorld::getInstance()->getInfo(gDebugInfo); // Close the debug file - pApp->closeDebug(); + pApp->writeDebugInfo(); LLError::logToFile(""); diff --git a/linden/indra/newview/llappviewer.h b/linden/indra/newview/llappviewer.h index 02406be..c98be41 100644 --- a/linden/indra/newview/llappviewer.h +++ b/linden/indra/newview/llappviewer.h @@ -70,7 +70,7 @@ public: bool quitRequested() { return mQuitRequested; } bool logoutRequestSent() { return mLogoutRequestSent; } - void closeDebug(); + void writeDebugInfo(); const LLOSInfo& getOSInfo() const { return mSysOSInfo; } diff --git a/linden/indra/newview/lldrawable.cpp b/linden/indra/newview/lldrawable.cpp index a228f68..71c9ebb 100644 --- a/linden/indra/newview/lldrawable.cpp +++ b/linden/indra/newview/lldrawable.cpp @@ -127,7 +127,6 @@ void LLDrawable::destroy() llerrs << "Illegal deletion of LLDrawable!" << llendl; } - LLFace::sDeleteLock = mFaces.size() ; std::for_each(mFaces.begin(), mFaces.end(), DeletePointer()); mFaces.clear(); @@ -190,7 +189,6 @@ void LLDrawable::cleanupReferences() { LLFastTimer t(LLFastTimer::FTM_PIPELINE); - LLFace::sDeleteLock = mFaces.size() ; std::for_each(mFaces.begin(), mFaces.end(), DeletePointer()); mFaces.clear(); @@ -284,7 +282,6 @@ void LLDrawable::setNumFaces(const S32 newFaces, LLFacePool *poolp, LLViewerImag } else if (newFaces < (S32)mFaces.size()) { - LLFace::sDeleteLock = (S32)mFaces.size() - newFaces ; std::for_each(mFaces.begin() + newFaces, mFaces.end(), DeletePointer()); mFaces.erase(mFaces.begin() + newFaces, mFaces.end()); } @@ -308,7 +305,6 @@ void LLDrawable::setNumFacesFast(const S32 newFaces, LLFacePool *poolp, LLViewer } else if (newFaces < (S32)mFaces.size()) { - LLFace::sDeleteLock = (S32)mFaces.size() - newFaces ; std::for_each(mFaces.begin() + newFaces, mFaces.end(), DeletePointer()); mFaces.erase(mFaces.begin() + newFaces, mFaces.end()); } @@ -343,12 +339,8 @@ void LLDrawable::deleteFaces(S32 offset, S32 count) face_list_t::iterator face_begin = mFaces.begin() + offset; face_list_t::iterator face_end = face_begin + count; - S32 end = (S32)mFaces.size() ; - LLFace::sDeleteLock = count ; std::for_each(face_begin, face_end, DeletePointer()); mFaces.erase(face_begin, face_end); - - llassert_always(mFaces.size() == end - count) ; } void LLDrawable::update() @@ -526,7 +518,7 @@ F32 LLDrawable::updateXform(BOOL undamped) } if ((mCurrentScale != target_scale) || - (!isRoot() && (dist_squared >= MIN_INTERPOLATE_DISTANCE_SQUARED*camdist2))) + (!isRoot() && (dist_squared >= MIN_INTERPOLATE_DISTANCE_SQUARED) || !mVObjp->getAngularVelocity().isExactlyZero())) { //child prim moving or scale change requires immediate rebuild gPipeline.markRebuild(this, LLDrawable::REBUILD_POSITION, TRUE); } diff --git a/linden/indra/newview/lldrawpoolalpha.cpp b/linden/indra/newview/lldrawpoolalpha.cpp index efe774f..ca8f3b4 100644 --- a/linden/indra/newview/lldrawpoolalpha.cpp +++ b/linden/indra/newview/lldrawpoolalpha.cpp @@ -230,7 +230,6 @@ void LLDrawPoolAlpha::renderGroupAlpha(LLSpatialGroup* group, U32 type, U32 mask if (texture && params.mTexture.notNull()) { - llassert_always(gGL.getTexUnit(0)) ; gGL.getTexUnit(0)->activate(); params.mTexture->bind(); params.mTexture->addTextureStats(params.mVSize); diff --git a/linden/indra/newview/lldrawpoolavatar.cpp b/linden/indra/newview/lldrawpoolavatar.cpp index fe5d4cd..4e1e390 100644 --- a/linden/indra/newview/lldrawpoolavatar.cpp +++ b/linden/indra/newview/lldrawpoolavatar.cpp @@ -452,7 +452,7 @@ void LLDrawPoolAvatar::renderAvatars(LLVOAvatar* single_avatar, S32 pass) return; } - if (single_avatar && avatarp->mSpecialRenderMode >= 2) // 2=image preview, 3=morph view + if (single_avatar && avatarp->mSpecialRenderMode >= 1) // 1=anim preview, 2=image preview, 3=morph view { gPipeline.enableLightsAvatarEdit(LLColor4(.5f, .5f, .5f, 1.f)); } diff --git a/linden/indra/newview/lldrawpoolbump.cpp b/linden/indra/newview/lldrawpoolbump.cpp index 6154c5b..68fa934 100644 --- a/linden/indra/newview/lldrawpoolbump.cpp +++ b/linden/indra/newview/lldrawpoolbump.cpp @@ -584,10 +584,6 @@ BOOL LLDrawPoolBump::bindBumpMap(LLDrawInfo& params) if( tex ) { bump = gBumpImageList.getBrightnessDarknessImage( tex, bump_code ); - //------------------------------------------ - //error check to make sure bump is valid - llassert_always(!bump || bump->getNumRefs() == 1) ; - //------------------------------------------ } break; @@ -602,11 +598,6 @@ BOOL LLDrawPoolBump::bindBumpMap(LLDrawInfo& params) if (bump) { - //------------------------------------------ - //error check to make sure bump is valid - llassert_always(bump->getNumRefs() > 0 && bump->getNumRefs() < 100000) ; - //------------------------------------------ - bump->bind(1); bump->bind(0); return TRUE; diff --git a/linden/indra/newview/lldriverparam.cpp b/linden/indra/newview/lldriverparam.cpp index dcae69d..4809182 100644 --- a/linden/indra/newview/lldriverparam.cpp +++ b/linden/indra/newview/lldriverparam.cpp @@ -34,6 +34,7 @@ #include "lldriverparam.h" #include "llfasttimer.h" +#include "llvoavatar.h" //----------------------------------------------------------------------------- // LLDriverParamInfo diff --git a/linden/indra/newview/lldriverparam.h b/linden/indra/newview/lldriverparam.h index d767d6b..afcda9c 100644 --- a/linden/indra/newview/lldriverparam.h +++ b/linden/indra/newview/lldriverparam.h @@ -32,9 +32,10 @@ #ifndef LL_LLDRIVERPARAM_H #define LL_LLDRIVERPARAM_H -#include "llvoavatar.h" #include "llviewervisualparam.h" +class LLVOAvatar; + //----------------------------------------------------------------------------- struct LLDrivenEntryInfo diff --git a/linden/indra/newview/llface.cpp b/linden/indra/newview/llface.cpp index 77251ce..3e0c5b2 100644 --- a/linden/indra/newview/llface.cpp +++ b/linden/indra/newview/llface.cpp @@ -57,7 +57,6 @@ extern BOOL gPickFaces; BOOL LLFace::sSafeRenderSelect = TRUE; // FALSE -S32 LLFace::sDeleteLock = 0 ; #define DOTVEC(a,b) (a.mV[0]*b.mV[0] + a.mV[1]*b.mV[1] + a.mV[2]*b.mV[2]) @@ -178,9 +177,6 @@ void LLFace::init(LLDrawable* drawablep, LLViewerObject* objp) void LLFace::destroy() { - llassert_always(sDeleteLock >= 1); - --sDeleteLock; - mDrawablep = NULL; mVObjp = NULL; diff --git a/linden/indra/newview/llface.h b/linden/indra/newview/llface.h index 35063a0..533851c 100644 --- a/linden/indra/newview/llface.h +++ b/linden/indra/newview/llface.h @@ -296,9 +296,6 @@ public: lhs->getTexture() < rhs->getTexture(); } }; - -public://paranoia check only - static S32 sDeleteLock ; }; #endif // LL_LLFACE_H diff --git a/linden/indra/newview/llfloateranimpreview.cpp b/linden/indra/newview/llfloateranimpreview.cpp index ca6982b..41a1a35 100644 --- a/linden/indra/newview/llfloateranimpreview.cpp +++ b/linden/indra/newview/llfloateranimpreview.cpp @@ -76,13 +76,14 @@ const F32 PREVIEW_CAMERA_DISTANCE = 4.f; const F32 MIN_CAMERA_ZOOM = 0.5f; const F32 MAX_CAMERA_ZOOM = 10.f; +const F32 BASE_ANIM_TIME_OFFSET = 5.f; + //----------------------------------------------------------------------------- // LLFloaterAnimPreview() //----------------------------------------------------------------------------- LLFloaterAnimPreview::LLFloaterAnimPreview(const char* filename) : LLFloaterNameDesc(filename) { - mLastSliderValue = 0.f; mLastMouseX = 0; mLastMouseY = 0; @@ -413,20 +414,32 @@ void LLFloaterAnimPreview::resetMotion() LLVOAvatar* avatarp = mAnimPreview->getDummyAvatar(); BOOL paused = avatarp->areAnimationsPaused(); - mPauseRequest = NULL; + // *TODO: Fix awful casting hack + LLKeyframeMotion* motionp = (LLKeyframeMotion*)avatarp->findMotion(mMotionID); + + // Set emotion + std::string emote = childGetValue("emote_combo").asString(); + motionp->setEmote(mIDList[emote]); - LLUUID anim_id = mIDList[childGetValue("preview_base_anim").asString()]; - avatarp->stopMotion(anim_id, TRUE); - avatarp->stopMotion(mMotionID, TRUE); - avatarp->startMotion(anim_id, 5.f); - avatarp->startMotion(mMotionID); - childSetValue("playback_slider", 0.0); - mLastSliderValue = 0.0f; + LLUUID base_id = mIDList[childGetValue("preview_base_anim").asString()]; + avatarp->deactivateAllMotions(); + avatarp->startMotion(base_id, BASE_ANIM_TIME_OFFSET); + avatarp->startMotion(mMotionID, 0.0f); + childSetValue("playback_slider", 0.0f); + + // Set pose + std::string handpose = childGetValue("hand_pose_combo").asString(); + avatarp->startMotion( ANIM_AGENT_HAND_MOTION, 0.0f ); + motionp->setHandPose(LLHandMotion::getHandPose(handpose)); if (paused) { mPauseRequest = avatarp->requestPause(); } + else + { + mPauseRequest = NULL; + } } //----------------------------------------------------------------------------- @@ -537,7 +550,8 @@ void LLFloaterAnimPreview::onMouseCaptureLost() void LLFloaterAnimPreview::onBtnPlay(void* user_data) { LLFloaterAnimPreview* previewp = (LLFloaterAnimPreview*)user_data; - if (!previewp->getEnabled()) return; + if (!previewp->getEnabled()) + return; if (previewp->mMotionID.notNull() && previewp->mAnimPreview) { @@ -568,22 +582,14 @@ void LLFloaterAnimPreview::onBtnPlay(void* user_data) void LLFloaterAnimPreview::onBtnStop(void* user_data) { LLFloaterAnimPreview* previewp = (LLFloaterAnimPreview*)user_data; - if (!previewp->getEnabled()) return; + if (!previewp->getEnabled()) + return; if (previewp->mMotionID.notNull() && previewp->mAnimPreview) { LLVOAvatar* avatarp = previewp->mAnimPreview->getDummyAvatar(); - - // is the motion looping and have we passed the loop in point? - if (previewp->childGetValue("loop_check").asBoolean() && - (F32)previewp->childGetValue("loop_in_point").asReal() <= (F32)previewp->childGetValue("playback_slider").asReal() * 100.f) - { - avatarp->stopMotion(previewp->mMotionID, FALSE); - } - else - { - avatarp->stopMotion(previewp->mMotionID, FALSE); - } + previewp->resetMotion(); + previewp->mPauseRequest = avatarp->requestPause(); } } @@ -593,43 +599,24 @@ void LLFloaterAnimPreview::onBtnStop(void* user_data) void LLFloaterAnimPreview::onSliderMove(LLUICtrl* ctrl, void*user_data) { LLFloaterAnimPreview* previewp = (LLFloaterAnimPreview*)user_data; - if (!previewp->getEnabled()) return; + if (!previewp->getEnabled()) + return; if (previewp->mAnimPreview) { LLVOAvatar* avatarp = previewp->mAnimPreview->getDummyAvatar(); + F32 slider_value = (F32)previewp->childGetValue("playback_slider").asReal(); + LLUUID base_id = previewp->mIDList[previewp->childGetValue("preview_base_anim").asString()]; LLMotion* motionp = avatarp->findMotion(previewp->mMotionID); - LLMotion* base_motionp = - avatarp->findMotion(previewp->mIDList[previewp->childGetValue("preview_base_anim").asString()]); - - if (motionp && base_motionp) - { - if (!avatarp->isMotionActive(previewp->mMotionID)) - { - previewp->resetMotion(); - } - - previewp->mPauseRequest = avatarp->requestPause(); - F32 original_activation_time = motionp->mActivationTimestamp; - motionp->mActivationTimestamp -= ((F32)previewp->childGetValue("playback_slider").asReal() - previewp->mLastSliderValue) * - motionp->getDuration(); - base_motionp->mActivationTimestamp -= ((F32)previewp->childGetValue("playback_slider").asReal() - previewp->mLastSliderValue) * - base_motionp->getDuration(); - - if (motionp->mSendStopTimestamp != F32_MIN) - { - motionp->mSendStopTimestamp = motionp->mSendStopTimestamp - original_activation_time + motionp->mActivationTimestamp; - } - - if (motionp->mStopTimestamp != F32_MIN) - { - motionp->mStopTimestamp = motionp->mStopTimestamp - original_activation_time + motionp->mActivationTimestamp; - } - previewp->refresh(); - } + F32 duration = motionp->getDuration();// + motionp->getEaseOutDuration(); + F32 delta_time = duration * slider_value; + avatarp->deactivateAllMotions(); + avatarp->startMotion(base_id, delta_time + BASE_ANIM_TIME_OFFSET); + avatarp->startMotion(previewp->mMotionID, delta_time); + previewp->mPauseRequest = avatarp->requestPause(); + previewp->refresh(); } - previewp->mLastSliderValue = (F32)previewp->childGetValue("playback_slider").asReal(); } //----------------------------------------------------------------------------- @@ -638,8 +625,8 @@ void LLFloaterAnimPreview::onSliderMove(LLUICtrl* ctrl, void*user_data) void LLFloaterAnimPreview::onCommitBaseAnim(LLUICtrl* ctrl, void* data) { LLFloaterAnimPreview* previewp = (LLFloaterAnimPreview*)data; - - if (!previewp->getEnabled()) return; + if (!previewp->getEnabled()) + return; if (previewp->mAnimPreview) { @@ -668,8 +655,9 @@ void LLFloaterAnimPreview::onCommitBaseAnim(LLUICtrl* ctrl, void* data) void LLFloaterAnimPreview::onCommitLoop(LLUICtrl* ctrl, void* data) { LLFloaterAnimPreview* previewp = (LLFloaterAnimPreview*)data; - - if (!previewp->getEnabled()) return; + if (!previewp->getEnabled()) + return; + LLVOAvatar* avatarp = previewp->mAnimPreview->getDummyAvatar(); LLKeyframeMotion* motionp = (LLKeyframeMotion*)avatarp->findMotion(previewp->mMotionID); @@ -687,7 +675,8 @@ void LLFloaterAnimPreview::onCommitLoop(LLUICtrl* ctrl, void* data) void LLFloaterAnimPreview::onCommitLoopIn(LLUICtrl* ctrl, void* data) { LLFloaterAnimPreview* previewp = (LLFloaterAnimPreview*)data; - if (!previewp->getEnabled()) return; + if (!previewp->getEnabled()) + return; LLVOAvatar* avatarp = previewp->mAnimPreview->getDummyAvatar(); LLKeyframeMotion* motionp = (LLKeyframeMotion*)avatarp->findMotion(previewp->mMotionID); @@ -707,7 +696,8 @@ void LLFloaterAnimPreview::onCommitLoopIn(LLUICtrl* ctrl, void* data) void LLFloaterAnimPreview::onCommitLoopOut(LLUICtrl* ctrl, void* data) { LLFloaterAnimPreview* previewp = (LLFloaterAnimPreview*)data; - if (!previewp->getEnabled()) return; + if (!previewp->getEnabled()) + return; LLVOAvatar* avatarp = previewp->mAnimPreview->getDummyAvatar(); LLKeyframeMotion* motionp = (LLKeyframeMotion*)avatarp->findMotion(previewp->mMotionID); @@ -727,7 +717,8 @@ void LLFloaterAnimPreview::onCommitLoopOut(LLUICtrl* ctrl, void* data) void LLFloaterAnimPreview::onCommitName(LLUICtrl* ctrl, void* data) { LLFloaterAnimPreview* previewp = (LLFloaterAnimPreview*)data; - if (!previewp->getEnabled()) return; + if (!previewp->getEnabled()) + return; LLVOAvatar* avatarp = previewp->mAnimPreview->getDummyAvatar(); LLKeyframeMotion* motionp = (LLKeyframeMotion*)avatarp->findMotion(previewp->mMotionID); @@ -746,13 +737,10 @@ void LLFloaterAnimPreview::onCommitName(LLUICtrl* ctrl, void* data) void LLFloaterAnimPreview::onCommitHandPose(LLUICtrl* ctrl, void* data) { LLFloaterAnimPreview* previewp = (LLFloaterAnimPreview*)data; - if (!previewp->getEnabled()) return; - - LLVOAvatar* avatarp = previewp->mAnimPreview->getDummyAvatar(); - LLKeyframeMotion* motionp = (LLKeyframeMotion*)avatarp->findMotion(previewp->mMotionID); + if (!previewp->getEnabled()) + return; - motionp->setHandPose(LLHandMotion::getHandPose(previewp->childGetValue("hand_pose_combo").asString())); - previewp->resetMotion(); + previewp->resetMotion(); // sets hand pose } //----------------------------------------------------------------------------- @@ -761,13 +749,10 @@ void LLFloaterAnimPreview::onCommitHandPose(LLUICtrl* ctrl, void* data) void LLFloaterAnimPreview::onCommitEmote(LLUICtrl* ctrl, void* data) { LLFloaterAnimPreview* previewp = (LLFloaterAnimPreview*)data; - if (!previewp->getEnabled()) return; + if (!previewp->getEnabled()) + return; - LLVOAvatar* avatarp = previewp->mAnimPreview->getDummyAvatar(); - LLKeyframeMotion* motionp = (LLKeyframeMotion*)avatarp->findMotion(previewp->mMotionID); - - motionp->setEmote(previewp->mIDList[previewp->childGetValue("emote_combo").asString()]); - previewp->resetMotion(); + previewp->resetMotion(); // ssts emote } //----------------------------------------------------------------------------- @@ -776,7 +761,8 @@ void LLFloaterAnimPreview::onCommitEmote(LLUICtrl* ctrl, void* data) void LLFloaterAnimPreview::onCommitPriority(LLUICtrl* ctrl, void* data) { LLFloaterAnimPreview* previewp = (LLFloaterAnimPreview*)data; - if (!previewp->getEnabled()) return; + if (!previewp->getEnabled()) + return; LLVOAvatar* avatarp = previewp->mAnimPreview->getDummyAvatar(); LLKeyframeMotion* motionp = (LLKeyframeMotion*)avatarp->findMotion(previewp->mMotionID); @@ -790,7 +776,8 @@ void LLFloaterAnimPreview::onCommitPriority(LLUICtrl* ctrl, void* data) void LLFloaterAnimPreview::onCommitEaseIn(LLUICtrl* ctrl, void* data) { LLFloaterAnimPreview* previewp = (LLFloaterAnimPreview*)data; - if (!previewp->getEnabled()) return; + if (!previewp->getEnabled()) + return; LLVOAvatar* avatarp = previewp->mAnimPreview->getDummyAvatar(); LLKeyframeMotion* motionp = (LLKeyframeMotion*)avatarp->findMotion(previewp->mMotionID); @@ -805,7 +792,8 @@ void LLFloaterAnimPreview::onCommitEaseIn(LLUICtrl* ctrl, void* data) void LLFloaterAnimPreview::onCommitEaseOut(LLUICtrl* ctrl, void* data) { LLFloaterAnimPreview* previewp = (LLFloaterAnimPreview*)data; - if (!previewp->getEnabled()) return; + if (!previewp->getEnabled()) + return; LLVOAvatar* avatarp = previewp->mAnimPreview->getDummyAvatar(); LLKeyframeMotion* motionp = (LLKeyframeMotion*)avatarp->findMotion(previewp->mMotionID); @@ -819,9 +807,9 @@ void LLFloaterAnimPreview::onCommitEaseOut(LLUICtrl* ctrl, void* data) //----------------------------------------------------------------------------- BOOL LLFloaterAnimPreview::validateEaseIn(LLUICtrl* spin, void* data) { - LLFloaterAnimPreview* previewp = (LLFloaterAnimPreview*)data; - - if (!previewp->getEnabled()) return FALSE; + LLFloaterAnimPreview* previewp = (LLFloaterAnimPreview*)data; + if (!previewp->getEnabled()) + return FALSE; LLVOAvatar* avatarp = previewp->mAnimPreview->getDummyAvatar(); LLKeyframeMotion* motionp = (LLKeyframeMotion*)avatarp->findMotion(previewp->mMotionID); @@ -842,7 +830,8 @@ BOOL LLFloaterAnimPreview::validateEaseOut(LLUICtrl* spin, void* data) { LLFloaterAnimPreview* previewp = (LLFloaterAnimPreview*)data; - if (!previewp->getEnabled()) return FALSE; + if (!previewp->getEnabled()) + return FALSE; LLVOAvatar* avatarp = previewp->mAnimPreview->getDummyAvatar(); LLKeyframeMotion* motionp = (LLKeyframeMotion*)avatarp->findMotion(previewp->mMotionID); @@ -862,8 +851,8 @@ BOOL LLFloaterAnimPreview::validateEaseOut(LLUICtrl* spin, void* data) BOOL LLFloaterAnimPreview::validateLoopIn(LLUICtrl* ctrl, void* data) { LLFloaterAnimPreview* previewp = (LLFloaterAnimPreview*)data; - - if (!previewp->getEnabled()) return FALSE; + if (!previewp->getEnabled()) + return FALSE; F32 loop_in_value = (F32)previewp->childGetValue("loop_in_point").asReal(); F32 loop_out_value = (F32)previewp->childGetValue("loop_out_point").asReal(); @@ -891,8 +880,8 @@ BOOL LLFloaterAnimPreview::validateLoopIn(LLUICtrl* ctrl, void* data) BOOL LLFloaterAnimPreview::validateLoopOut(LLUICtrl* spin, void* data) { LLFloaterAnimPreview* previewp = (LLFloaterAnimPreview*)data; - - if (!previewp->getEnabled()) return FALSE; + if (!previewp->getEnabled()) + return FALSE; F32 loop_out_value = (F32)previewp->childGetValue("loop_out_point").asReal(); F32 loop_in_value = (F32)previewp->childGetValue("loop_in_point").asReal(); @@ -947,11 +936,8 @@ void LLFloaterAnimPreview::refresh() { if (motionp) { - F32 fraction_complete; - fraction_complete = motionp->getLastUpdateTime() / motionp->getDuration(); - + F32 fraction_complete = motionp->getLastUpdateTime() / motionp->getDuration(); childSetValue("playback_slider", fraction_complete); - mLastSliderValue = fraction_complete; } mPlayButton->setImages("button_anim_pause.tga", "button_anim_pause_selected.tga"); @@ -964,7 +950,7 @@ void LLFloaterAnimPreview::refresh() mPlayButton->setImages("button_anim_play.tga", "button_anim_play_selected.tga"); - mStopButton->setEnabled(FALSE); + mStopButton->setEnabled(TRUE); // stop also resets, leave enabled. } childEnable("ok_btn"); mAnimPreview->requestUpdate(); @@ -1037,12 +1023,12 @@ LLPreviewAnimation::LLPreviewAnimation(S32 width, S32 height) : LLDynamicTexture mDummyAvatar = (LLVOAvatar*)gObjectList.createObjectViewer(LL_PCODE_LEGACY_AVATAR, gAgent.getRegion()); mDummyAvatar->createDrawable(&gPipeline); mDummyAvatar->mIsDummy = TRUE; - mDummyAvatar->mSpecialRenderMode = 2; + mDummyAvatar->mSpecialRenderMode = 1; mDummyAvatar->setPositionAgent(LLVector3::zero); mDummyAvatar->slamPosition(); mDummyAvatar->updateJointLODs(); mDummyAvatar->updateGeometry(mDummyAvatar->mDrawable); - mDummyAvatar->startMotion(ANIM_AGENT_STAND, 5.f); + mDummyAvatar->startMotion(ANIM_AGENT_STAND, BASE_ANIM_TIME_OFFSET); mDummyAvatar->mSkirtLOD.setVisible(FALSE, TRUE); gPipeline.markVisible(mDummyAvatar->mDrawable, *LLViewerCamera::getInstance()); @@ -1110,30 +1096,15 @@ BOOL LLPreviewAnimation::render() //avatarp->setAnimationData("LookAtPoint", (void *)&mCameraRelPos); - //RN: timestep must be zero, because paused animations will never initialize - // av skeleton otherwise - avatarp->setTimeStep(0.f); - if (avatarp->areAnimationsPaused()) - { - avatarp->updateMotion(TRUE); - } - else - { - avatarp->updateMotion(); - } + //SJB: Animation is updated in LLVOAvatar::updateCharacter - LLVertexBuffer::unbind(); - avatarp->updateLOD(); - - - avatarp->mRoot.updateWorldMatrixChildren(); - - stop_glerror(); - - LLGLDepthTest gls_depth(GL_TRUE); - if (avatarp->mDrawable.notNull()) { + avatarp->updateLOD(); + + LLVertexBuffer::unbind(); + LLGLDepthTest gls_depth(GL_TRUE); + LLDrawPoolAvatar *avatarPoolp = (LLDrawPoolAvatar *)avatarp->mDrawable->getFace(0)->getPool(); avatarp->dirtyMesh(); avatarPoolp->renderAvatars(avatarp); // renders only one avatar diff --git a/linden/indra/newview/llfloateranimpreview.h b/linden/indra/newview/llfloateranimpreview.h index 52c2d6f..99b66d7 100644 --- a/linden/indra/newview/llfloateranimpreview.h +++ b/linden/indra/newview/llfloateranimpreview.h @@ -118,7 +118,6 @@ protected: S32 mLastMouseY; LLButton* mPlayButton; LLButton* mStopButton; - F32 mLastSliderValue; LLRect mPreviewRect; LLRectf mPreviewImageRect; LLAssetID mMotionID; diff --git a/linden/indra/newview/llfloateravatarinfo.cpp b/linden/indra/newview/llfloateravatarinfo.cpp index d4b0b1c..b740a46 100644 --- a/linden/indra/newview/llfloateravatarinfo.cpp +++ b/linden/indra/newview/llfloateravatarinfo.cpp @@ -120,22 +120,14 @@ LLFloaterAvatarInfo::LLFloaterAvatarInfo(const std::string& name, const LLRect & mPanelAvatarp->selectTab(0); } - llassert_always(!gAvatarInfoInstances.checkData(mAvatarID));//if not inserted. gAvatarInfoInstances.addData(avatar_id, this); - - } // virtual LLFloaterAvatarInfo::~LLFloaterAvatarInfo() { - llassert_always(gAvatarInfoInstances.checkData(mAvatarID));//if there - llinfos << "to remove profile floater for avatar " << mAvatarID << llendl ; // child views automatically deleted gAvatarInfoInstances.removeData(mAvatarID); - - llinfos << "successfully removed profile floater for avatar " << mAvatarID << llendl ; - } void LLFloaterAvatarInfo::resetGroupList() diff --git a/linden/indra/newview/llfloatercustomize.h b/linden/indra/newview/llfloatercustomize.h index 96db2d2..9ca22d0 100644 --- a/linden/indra/newview/llfloatercustomize.h +++ b/linden/indra/newview/llfloatercustomize.h @@ -40,7 +40,6 @@ #include "lltimer.h" #include "llundo.h" #include "llviewermenu.h" -#include "llvoavatar.h" #include "llwearable.h" #include "lliconctrl.h" diff --git a/linden/indra/newview/llfloatergroups.cpp b/linden/indra/newview/llfloatergroups.cpp index c9ccf1a..f6e226d 100644 --- a/linden/indra/newview/llfloatergroups.cpp +++ b/linden/indra/newview/llfloatergroups.cpp @@ -438,7 +438,8 @@ void init_group_list(LLScrollListCtrl* ctrl, const LLUUID& highlight_id, U64 pow { id = gAgent.mGroups.get(i).mID; LLGroupData* group_datap = &gAgent.mGroups.get(i); - if ((group_datap->mPowers & powers_mask) != 0) { + if ((powers_mask == GP_ALL_POWERS) || ((group_datap->mPowers & powers_mask) != 0)) + { LLString style = "NORMAL"; if(highlight_id == id) { diff --git a/linden/indra/newview/llhudeffectlookat.cpp b/linden/indra/newview/llhudeffectlookat.cpp index 88ad5d6..0829fb2 100644 --- a/linden/indra/newview/llhudeffectlookat.cpp +++ b/linden/indra/newview/llhudeffectlookat.cpp @@ -501,8 +501,8 @@ void LLHUDEffectLookAt::render() LLVector3 target = mTargetPos + ((LLVOAvatar*)(LLViewerObject*)mSourceObject)->mHeadp->getWorldPosition(); glMatrixMode(GL_MODELVIEW); - glPushMatrix(); - glTranslatef(target.mV[VX], target.mV[VY], target.mV[VZ]); + gGL.pushMatrix(); + gGL.translatef(target.mV[VX], target.mV[VY], target.mV[VZ]); glScalef(0.3f, 0.3f, 0.3f); gGL.begin(LLVertexBuffer::LINES); { @@ -517,7 +517,7 @@ void LLHUDEffectLookAt::render() gGL.vertex3f(0.f, 0.f, -1.f); gGL.vertex3f(0.f, 0.f, 1.f); } gGL.end(); - glPopMatrix(); + gGL.popMatrix(); } } diff --git a/linden/indra/newview/llhudeffectpointat.cpp b/linden/indra/newview/llhudeffectpointat.cpp index 8cd1023..7ab03f2 100644 --- a/linden/indra/newview/llhudeffectpointat.cpp +++ b/linden/indra/newview/llhudeffectpointat.cpp @@ -331,8 +331,8 @@ void LLHUDEffectPointAt::render() LLGLSNoTexture gls_no_texture; LLVector3 target = mTargetPos + mSourceObject->getRenderPosition(); - glPushMatrix(); - glTranslatef(target.mV[VX], target.mV[VY], target.mV[VZ]); + gGL.pushMatrix(); + gGL.translatef(target.mV[VX], target.mV[VY], target.mV[VZ]); glScalef(0.3f, 0.3f, 0.3f); gGL.begin(LLVertexBuffer::LINES); { @@ -346,7 +346,7 @@ void LLHUDEffectPointAt::render() gGL.vertex3f(0.f, 0.f, -1.f); gGL.vertex3f(0.f, 0.f, 1.f); } gGL.end(); - glPopMatrix(); + gGL.popMatrix(); } } diff --git a/linden/indra/newview/llinventoryactions.cpp b/linden/indra/newview/llinventoryactions.cpp index 78b43d5..7f7a15f 100644 --- a/linden/indra/newview/llinventoryactions.cpp +++ b/linden/indra/newview/llinventoryactions.cpp @@ -76,6 +76,7 @@ #include "llviewerinventory.h" #include "llviewerobjectlist.h" #include "llviewerwindow.h" +#include "llvoavatar.h" #include "llwearable.h" #include "llwearablelist.h" #include "llviewermessage.h" diff --git a/linden/indra/newview/llinventorybridge.cpp b/linden/indra/newview/llinventorybridge.cpp index 1d5cd88..a909262 100644 --- a/linden/indra/newview/llinventorybridge.cpp +++ b/linden/indra/newview/llinventorybridge.cpp @@ -76,6 +76,7 @@ #include "llviewerinventory.h" #include "llviewerobjectlist.h" #include "llviewerwindow.h" +#include "llvoavatar.h" #include "llwearable.h" #include "llwearablelist.h" #include "llviewermessage.h" diff --git a/linden/indra/newview/llmemoryview.cpp b/linden/indra/newview/llmemoryview.cpp index ca38a9c..32f5431 100644 --- a/linden/indra/newview/llmemoryview.cpp +++ b/linden/indra/newview/llmemoryview.cpp @@ -41,6 +41,7 @@ #include "llfontgl.h" #include "llmemtype.h" +#include "llcharacter.h" #include "llui.h" #include "llviewercontrol.h" #include "llstat.h" @@ -120,6 +121,7 @@ static const struct mtv_display_info mtv_display_table[] = { LLMemType::MTYPE_SPACE_PARTITION, "Space Partition", &LLColor4::blue2 }, { LLMemType::MTYPE_VERTEX_DATA, "Vertex Buffer", &LLColor4::blue3 }, { LLMemType::MTYPE_AVATAR, "Avatar", &LLColor4::purple1 }, + { LLMemType::MTYPE_ANIMATION, "Animation", &LLColor4::purple3 }, { LLMemType::MTYPE_REGIONS, "Regions", &LLColor4::blue1 }, { LLMemType::MTYPE_VOLUME, "Volume", &LLColor4::pink1 }, { LLMemType::MTYPE_PRIMITIVE, "Profile", &LLColor4::pink2 }, @@ -208,10 +210,25 @@ void LLMemoryView::draw() if (textw > labelwidth) labelwidth = textw; } + + S32 num_avatars = 0; + S32 num_motions = 0; + S32 num_loading_motions = 0; + S32 num_loaded_motions = 0; + S32 num_active_motions = 0; + S32 num_deprecated_motions = 0; + for (std::vector::iterator iter = LLCharacter::sInstances.begin(); + iter != LLCharacter::sInstances.end(); ++iter) + { + num_avatars++; + (*iter)->getMotionController().incMotionCounts(num_motions, num_loading_motions, num_loaded_motions, num_active_motions, num_deprecated_motions); + } + x = xleft; - tdesc = llformat("Total Bytes: %d MB Overhead: %d KB", - LLMemType::sTotalMem >> 20, LLMemType::sOverheadMem >> 10); - LLFontGL::sMonospace->renderUTF8(tdesc, 0, x, y, LLColor4::white, LLFontGL::LEFT, LLFontGL::TOP); + tdesc = llformat("Total Bytes: %d MB Overhead: %d KB Avs %d Motions:%d Loading:%d Loaded:%d Active:%d Dep:%d", + LLMemType::sTotalMem >> 20, LLMemType::sOverheadMem >> 10, + num_avatars, num_motions, num_loading_motions, num_loaded_motions, num_active_motions, num_deprecated_motions); + LLFontGL::sMonospace->renderUTF8(tdesc, 0, x, y, LLColor4::white, LLFontGL::LEFT, LLFontGL::TOP); } // Bars diff --git a/linden/indra/newview/llmutelist.cpp b/linden/indra/newview/llmutelist.cpp index 75c7cce..408b70e 100644 --- a/linden/indra/newview/llmutelist.cpp +++ b/linden/indra/newview/llmutelist.cpp @@ -72,9 +72,6 @@ #include "llviewerobjectlist.h" -std::map LLMuteList::sUserVolumeSettings; - - // "emptymutelist" class LLDispatchEmptyMuteList : public LLDispatchHandler { @@ -182,10 +179,19 @@ LLMuteList* LLMuteList::getInstance() // LLMuteList() //----------------------------------------------------------------------------- LLMuteList::LLMuteList() : - mIsLoaded(FALSE) + mIsLoaded(FALSE), + mUserVolumesLoaded(FALSE) { gGenericDispatcher.addHandler("emptymutelist", &sDispatchEmptyMuteList); +} +void LLMuteList::loadUserVolumes() +{ + // call once, after LLDir::setLindenUserDir() has been called + if (mUserVolumesLoaded) + return; + mUserVolumesLoaded = TRUE; + // load per-resident voice volume information // conceptually, this is part of the mute list information, although it is only stored locally std::string filename = gDirUtilp->getExpandedFilename(LL_PATH_PER_SL_ACCOUNT, "volume_settings.xml"); @@ -201,7 +207,7 @@ LLMuteList::LLMuteList() : for (LLSD::map_const_iterator iter = settings_llsd.beginMap(); iter != settings_llsd.endMap(); ++iter) { - sUserVolumeSettings.insert(std::make_pair(LLUUID(iter->first), (F32)iter->second.asReal())); + mUserVolumeSettings.insert(std::make_pair(LLUUID(iter->first), (F32)iter->second.asReal())); } } @@ -213,7 +219,7 @@ LLMuteList::~LLMuteList() std::string filename = gDirUtilp->getExpandedFilename(LL_PATH_PER_SL_ACCOUNT, "volume_settings.xml"); LLSD settings_llsd; - for(user_volume_map_t::iterator iter = sUserVolumeSettings.begin(); iter != sUserVolumeSettings.end(); ++iter) + for(user_volume_map_t::iterator iter = mUserVolumeSettings.begin(); iter != mUserVolumeSettings.end(); ++iter) { settings_llsd[iter->first.asString()] = iter->second; } @@ -669,6 +675,8 @@ BOOL LLMuteList::isMuted(const LLUUID& id, const LLString& name, U32 flags) cons //----------------------------------------------------------------------------- void LLMuteList::requestFromServer(const LLUUID& agent_id) { + loadUserVolumes(); + char agent_id_string[UUID_STR_LENGTH]; /*Flawfinder: ignore*/ char filename[LL_MAX_PATH]; /*Flawfinder: ignore*/ agent_id.toString(agent_id_string); @@ -706,15 +714,15 @@ void LLMuteList::cache(const LLUUID& agent_id) void LLMuteList::setSavedResidentVolume(const LLUUID& id, F32 volume) { // store new value in volume settings file - sUserVolumeSettings[id] = volume; + mUserVolumeSettings[id] = volume; } F32 LLMuteList::getSavedResidentVolume(const LLUUID& id) { const F32 DEFAULT_VOLUME = 0.5f; - - user_volume_map_t::iterator found_it = sUserVolumeSettings.find(id); - if (found_it != sUserVolumeSettings.end()) + + user_volume_map_t::iterator found_it = mUserVolumeSettings.find(id); + if (found_it != mUserVolumeSettings.end()) { return found_it->second; } diff --git a/linden/indra/newview/llmutelist.h b/linden/indra/newview/llmutelist.h index 0a8c6aa..fa38cde 100644 --- a/linden/indra/newview/llmutelist.h +++ b/linden/indra/newview/llmutelist.h @@ -131,6 +131,8 @@ public: F32 getSavedResidentVolume(const LLUUID& id); private: + void loadUserVolumes(); + BOOL loadFromFile(const LLString& filename); BOOL saveToFile(const LLString& filename); @@ -171,11 +173,12 @@ private: observer_set_t mObservers; BOOL mIsLoaded; + BOOL mUserVolumesLoaded; friend class LLDispatchEmptyMuteList; typedef std::map user_volume_map_t; - static user_volume_map_t sUserVolumeSettings; + user_volume_map_t mUserVolumeSettings; }; class LLMuteListObserver diff --git a/linden/indra/newview/llpreviewanim.cpp b/linden/indra/newview/llpreviewanim.cpp index c7b1dc7..9c7fb4a 100644 --- a/linden/indra/newview/llpreviewanim.cpp +++ b/linden/indra/newview/llpreviewanim.cpp @@ -194,6 +194,7 @@ void LLPreviewAnim::onClose(bool app_quitting) if (motion) { + // *TODO: minor memory leak here, user data is never deleted (Use real callbacks) motion->setDeactivateCallback(NULL, (void *)NULL); } } diff --git a/linden/indra/newview/llselectmgr.cpp b/linden/indra/newview/llselectmgr.cpp index 1aad3e2..75e1fcc 100644 --- a/linden/indra/newview/llselectmgr.cpp +++ b/linden/indra/newview/llselectmgr.cpp @@ -4827,18 +4827,9 @@ void LLSelectMgr::renderSilhouettes(BOOL for_hud) for (S32 pass = 0; pass < 2; pass++) { - LLObjectSelection::iterator end_ = mSelectedObjects->end(); - S32 num_nodes = mSelectedObjects->getNumNodes() ; - LLObjectSelection::iterator prev_iter = mSelectedObjects->end(); for (LLObjectSelection::iterator iter = mSelectedObjects->begin(); iter != mSelectedObjects->end(); iter++) { - llassert_always(end_ == mSelectedObjects->end()) ;//mSelectedObjects should not grow - llassert_always(prev_iter != iter) ; //iter should move - llassert_always(num_nodes > 0) ; //iter should not circle inside mSelectedObjects. - num_nodes-- ; - prev_iter = iter ; - LLSelectNode* node = *iter; LLViewerObject* objectp = node->getObject(); if (!objectp) diff --git a/linden/indra/newview/llstartup.cpp b/linden/indra/newview/llstartup.cpp index 5a5aa8d..1eb0654 100644 --- a/linden/indra/newview/llstartup.cpp +++ b/linden/indra/newview/llstartup.cpp @@ -2201,6 +2201,18 @@ BOOL idle_startup() { do_normal_idle = TRUE; + // Avoid generic Ruth avatar in Orientation Island by starting + // our outfit load as soon as possible. This will be replaced + // with a more definitive patch from featurettes-4 later. JC + if (gAgent.isFirstLogin() + && !gInitialOutfit.empty() // registration set up an outfit + && gAgent.getAvatarObject() // can't wear clothes until have obj + && !gAgent.isGenderChosen() ) // nothing already loaded + { + llinfos << "Wearing initial outfit " << gInitialOutfit << llendl; + callback_choose_gender(-1, NULL); + } + F32 timeout_frac = timeout.getElapsedTimeF32()/PRECACHING_DELAY; // wait precache-delay and for agent's avatar or a lot longer. if(((timeout_frac > 1.f) && gAgent.getAvatarObject()) @@ -2211,7 +2223,7 @@ BOOL idle_startup() else { update_texture_fetch(); - set_startup_status(0.60f + 0.40f * timeout_frac, + set_startup_status(0.60f + 0.20f * timeout_frac, "Loading world...", gAgent.mMOTD.c_str()); } @@ -2241,7 +2253,7 @@ BOOL idle_startup() else { update_texture_fetch(); - set_startup_status(0.f + 0.25f * wearables_time / MAX_WEARABLES_TIME, + set_startup_status(0.80f + 0.20f * wearables_time / MAX_WEARABLES_TIME, LLTrans::getString("LoginDownloadingClothing").c_str(), gAgent.mMOTD.c_str()); } diff --git a/linden/indra/newview/lltexlayer.h b/linden/indra/newview/lltexlayer.h index 8306071..17cfb7c 100644 --- a/linden/indra/newview/lltexlayer.h +++ b/linden/indra/newview/lltexlayer.h @@ -40,7 +40,6 @@ #include "lluuid.h" #include "llviewerimage.h" #include "llviewervisualparam.h" -#include "llvoavatar.h" #include "llwearable.h" #include "v4color.h" #include "llfloater.h" diff --git a/linden/indra/newview/llviewerimagelist.cpp b/linden/indra/newview/llviewerimagelist.cpp index 384de83..142e862 100644 --- a/linden/indra/newview/llviewerimagelist.cpp +++ b/linden/indra/newview/llviewerimagelist.cpp @@ -47,6 +47,7 @@ #include "llvfs.h" #include "llvfile.h" #include "llvfsthread.h" +#include "llxmltree.h" #include "message.h" #include "llagent.h" @@ -534,7 +535,7 @@ void LLViewerImageList::updateImagesDecodePriorities() const size_t max_update_count = llmin((S32) (1024*gFrameIntervalSeconds) + 1, 32); //target 1024 textures per second S32 update_counter = llmin(max_update_count, mUUIDMap.size()/10); uuid_map_t::iterator iter = mUUIDMap.upper_bound(mLastUpdateUUID); - while(update_counter > 0) + while(update_counter > 0 && !mUUIDMap.empty()) { if (iter == mUUIDMap.end()) { @@ -715,10 +716,6 @@ void LLViewerImageList::updateImagesUpdateStats() iter != mImageList.end(); ) { LLViewerImage* imagep = *iter++; - - llassert_always(imagep) ; - llassert_always(imagep->getNumRefs() > 0 && imagep->getNumRefs() < 100000) ; - imagep->resetTextureStats(mForceResetTextureStats); } mUpdateStats = FALSE; diff --git a/linden/indra/newview/llviewerjoint.cpp b/linden/indra/newview/llviewerjoint.cpp index 1be6e66..914448e 100644 --- a/linden/indra/newview/llviewerjoint.cpp +++ b/linden/indra/newview/llviewerjoint.cpp @@ -118,123 +118,124 @@ void LLViewerJoint::setValid( BOOL valid, BOOL recursive ) //-------------------------------------------------------------------- // renderSkeleton() +// DEBUG (UNUSED) //-------------------------------------------------------------------- -void LLViewerJoint::renderSkeleton(BOOL recursive) -{ - F32 nc = 0.57735f; - - //---------------------------------------------------------------- - // push matrix stack - //---------------------------------------------------------------- - glPushMatrix(); - - //---------------------------------------------------------------- - // render the bone to my parent - //---------------------------------------------------------------- - if (mComponents & SC_BONE) - { - drawBone(); - } - - //---------------------------------------------------------------- - // offset to joint position and - // rotate to our orientation - //---------------------------------------------------------------- - glLoadIdentity(); - glMultMatrixf( &getWorldMatrix().mMatrix[0][0] ); - - //---------------------------------------------------------------- - // render joint axes - //---------------------------------------------------------------- - if (mComponents & SC_AXES) - { - gGL.begin(LLVertexBuffer::LINES); - gGL.color3f( 1.0f, 0.0f, 0.0f ); - gGL.vertex3f( 0.0f, 0.0f, 0.0f ); - gGL.vertex3f( 0.1f, 0.0f, 0.0f ); - - gGL.color3f( 0.0f, 1.0f, 0.0f ); - gGL.vertex3f( 0.0f, 0.0f, 0.0f ); - gGL.vertex3f( 0.0f, 0.1f, 0.0f ); - - gGL.color3f( 0.0f, 0.0f, 1.0f ); - gGL.vertex3f( 0.0f, 0.0f, 0.0f ); - gGL.vertex3f( 0.0f, 0.0f, 0.1f ); - gGL.end(); - } - - //---------------------------------------------------------------- - // render the joint graphic - //---------------------------------------------------------------- - if (mComponents & SC_JOINT) - { - gGL.color3f( 1.0f, 1.0f, 0.0f ); - - gGL.begin(LLVertexBuffer::TRIANGLES); - - // joint top half - glNormal3f(nc, nc, nc); - gGL.vertex3f(0.0f, 0.0f, 0.05f); - gGL.vertex3f(0.05f, 0.0f, 0.0f); - gGL.vertex3f(0.0f, 0.05f, 0.0f); - - glNormal3f(-nc, nc, nc); - gGL.vertex3f(0.0f, 0.0f, 0.05f); - gGL.vertex3f(0.0f, 0.05f, 0.0f); - gGL.vertex3f(-0.05f, 0.0f, 0.0f); +// void LLViewerJoint::renderSkeleton(BOOL recursive) +// { +// F32 nc = 0.57735f; + +// //---------------------------------------------------------------- +// // push matrix stack +// //---------------------------------------------------------------- +// glPushMatrix(); + +// //---------------------------------------------------------------- +// // render the bone to my parent +// //---------------------------------------------------------------- +// if (mComponents & SC_BONE) +// { +// drawBone(); +// } + +// //---------------------------------------------------------------- +// // offset to joint position and +// // rotate to our orientation +// //---------------------------------------------------------------- +// glLoadIdentity(); +// glMultMatrixf( &getWorldMatrix().mMatrix[0][0] ); + +// //---------------------------------------------------------------- +// // render joint axes +// //---------------------------------------------------------------- +// if (mComponents & SC_AXES) +// { +// gGL.begin(LLVertexBuffer::LINES); +// gGL.color3f( 1.0f, 0.0f, 0.0f ); +// gGL.vertex3f( 0.0f, 0.0f, 0.0f ); +// gGL.vertex3f( 0.1f, 0.0f, 0.0f ); + +// gGL.color3f( 0.0f, 1.0f, 0.0f ); +// gGL.vertex3f( 0.0f, 0.0f, 0.0f ); +// gGL.vertex3f( 0.0f, 0.1f, 0.0f ); + +// gGL.color3f( 0.0f, 0.0f, 1.0f ); +// gGL.vertex3f( 0.0f, 0.0f, 0.0f ); +// gGL.vertex3f( 0.0f, 0.0f, 0.1f ); +// gGL.end(); +// } + +// //---------------------------------------------------------------- +// // render the joint graphic +// //---------------------------------------------------------------- +// if (mComponents & SC_JOINT) +// { +// gGL.color3f( 1.0f, 1.0f, 0.0f ); + +// gGL.begin(LLVertexBuffer::TRIANGLES); + +// // joint top half +// glNormal3f(nc, nc, nc); +// gGL.vertex3f(0.0f, 0.0f, 0.05f); +// gGL.vertex3f(0.05f, 0.0f, 0.0f); +// gGL.vertex3f(0.0f, 0.05f, 0.0f); + +// glNormal3f(-nc, nc, nc); +// gGL.vertex3f(0.0f, 0.0f, 0.05f); +// gGL.vertex3f(0.0f, 0.05f, 0.0f); +// gGL.vertex3f(-0.05f, 0.0f, 0.0f); - glNormal3f(-nc, -nc, nc); - gGL.vertex3f(0.0f, 0.0f, 0.05f); - gGL.vertex3f(-0.05f, 0.0f, 0.0f); - gGL.vertex3f(0.0f, -0.05f, 0.0f); - - glNormal3f(nc, -nc, nc); - gGL.vertex3f(0.0f, 0.0f, 0.05f); - gGL.vertex3f(0.0f, -0.05f, 0.0f); - gGL.vertex3f(0.05f, 0.0f, 0.0f); +// glNormal3f(-nc, -nc, nc); +// gGL.vertex3f(0.0f, 0.0f, 0.05f); +// gGL.vertex3f(-0.05f, 0.0f, 0.0f); +// gGL.vertex3f(0.0f, -0.05f, 0.0f); + +// glNormal3f(nc, -nc, nc); +// gGL.vertex3f(0.0f, 0.0f, 0.05f); +// gGL.vertex3f(0.0f, -0.05f, 0.0f); +// gGL.vertex3f(0.05f, 0.0f, 0.0f); - // joint bottom half - glNormal3f(nc, nc, -nc); - gGL.vertex3f(0.0f, 0.0f, -0.05f); - gGL.vertex3f(0.0f, 0.05f, 0.0f); - gGL.vertex3f(0.05f, 0.0f, 0.0f); - - glNormal3f(-nc, nc, -nc); - gGL.vertex3f(0.0f, 0.0f, -0.05f); - gGL.vertex3f(-0.05f, 0.0f, 0.0f); - gGL.vertex3f(0.0f, 0.05f, 0.0f); +// // joint bottom half +// glNormal3f(nc, nc, -nc); +// gGL.vertex3f(0.0f, 0.0f, -0.05f); +// gGL.vertex3f(0.0f, 0.05f, 0.0f); +// gGL.vertex3f(0.05f, 0.0f, 0.0f); + +// glNormal3f(-nc, nc, -nc); +// gGL.vertex3f(0.0f, 0.0f, -0.05f); +// gGL.vertex3f(-0.05f, 0.0f, 0.0f); +// gGL.vertex3f(0.0f, 0.05f, 0.0f); - glNormal3f(-nc, -nc, -nc); - gGL.vertex3f(0.0f, 0.0f, -0.05f); - gGL.vertex3f(0.0f, -0.05f, 0.0f); - gGL.vertex3f(-0.05f, 0.0f, 0.0f); - - glNormal3f(nc, -nc, -nc); - gGL.vertex3f(0.0f, 0.0f, -0.05f); - gGL.vertex3f(0.05f, 0.0f, 0.0f); - gGL.vertex3f(0.0f, -0.05f, 0.0f); +// glNormal3f(-nc, -nc, -nc); +// gGL.vertex3f(0.0f, 0.0f, -0.05f); +// gGL.vertex3f(0.0f, -0.05f, 0.0f); +// gGL.vertex3f(-0.05f, 0.0f, 0.0f); + +// glNormal3f(nc, -nc, -nc); +// gGL.vertex3f(0.0f, 0.0f, -0.05f); +// gGL.vertex3f(0.05f, 0.0f, 0.0f); +// gGL.vertex3f(0.0f, -0.05f, 0.0f); - gGL.end(); - } - - //---------------------------------------------------------------- - // render children - //---------------------------------------------------------------- - if (recursive) - { - for (child_list_t::iterator iter = mChildren.begin(); - iter != mChildren.end(); ++iter) - { - LLViewerJoint* joint = (LLViewerJoint*)(*iter); - joint->renderSkeleton(); - } - } - - //---------------------------------------------------------------- - // pop matrix stack - //---------------------------------------------------------------- - glPopMatrix(); -} +// gGL.end(); +// } + +// //---------------------------------------------------------------- +// // render children +// //---------------------------------------------------------------- +// if (recursive) +// { +// for (child_list_t::iterator iter = mChildren.begin(); +// iter != mChildren.end(); ++iter) +// { +// LLViewerJoint* joint = (LLViewerJoint*)(*iter); +// joint->renderSkeleton(); +// } +// } + +// //---------------------------------------------------------------- +// // pop matrix stack +// //---------------------------------------------------------------- +// glPopMatrix(); +// } //-------------------------------------------------------------------- @@ -330,59 +331,60 @@ U32 LLViewerJoint::render( F32 pixelArea, BOOL first_pass ) //-------------------------------------------------------------------- // drawBone() +// DEBUG (UNUSED) //-------------------------------------------------------------------- -void LLViewerJoint::drawBone() -{ - if ( mParent == NULL ) - return; +// void LLViewerJoint::drawBone() +// { +// if ( mParent == NULL ) +// return; - F32 boneSize = 0.02f; +// F32 boneSize = 0.02f; - // rotate to point to child (bone direction) - glPushMatrix(); +// // rotate to point to child (bone direction) +// glPushMatrix(); - LLVector3 boneX = getPosition(); - F32 length = boneX.normVec(); +// LLVector3 boneX = getPosition(); +// F32 length = boneX.normVec(); - LLVector3 boneZ(1.0f, 0.0f, 1.0f); +// LLVector3 boneZ(1.0f, 0.0f, 1.0f); - LLVector3 boneY = boneZ % boneX; - boneY.normVec(); +// LLVector3 boneY = boneZ % boneX; +// boneY.normVec(); - boneZ = boneX % boneY; +// boneZ = boneX % boneY; - LLMatrix4 rotateMat; - rotateMat.setFwdRow( boneX ); - rotateMat.setLeftRow( boneY ); - rotateMat.setUpRow( boneZ ); - glMultMatrixf( &rotateMat.mMatrix[0][0] ); +// LLMatrix4 rotateMat; +// rotateMat.setFwdRow( boneX ); +// rotateMat.setLeftRow( boneY ); +// rotateMat.setUpRow( boneZ ); +// glMultMatrixf( &rotateMat.mMatrix[0][0] ); - // render the bone - gGL.color3f( 0.5f, 0.5f, 0.0f ); +// // render the bone +// gGL.color3f( 0.5f, 0.5f, 0.0f ); - gGL.begin(LLVertexBuffer::TRIANGLES); +// gGL.begin(LLVertexBuffer::TRIANGLES); - gGL.vertex3f( length, 0.0f, 0.0f); - gGL.vertex3f( 0.0f, boneSize, 0.0f); - gGL.vertex3f( 0.0f, 0.0f, boneSize); +// gGL.vertex3f( length, 0.0f, 0.0f); +// gGL.vertex3f( 0.0f, boneSize, 0.0f); +// gGL.vertex3f( 0.0f, 0.0f, boneSize); - gGL.vertex3f( length, 0.0f, 0.0f); - gGL.vertex3f( 0.0f, 0.0f, -boneSize); - gGL.vertex3f( 0.0f, boneSize, 0.0f); +// gGL.vertex3f( length, 0.0f, 0.0f); +// gGL.vertex3f( 0.0f, 0.0f, -boneSize); +// gGL.vertex3f( 0.0f, boneSize, 0.0f); - gGL.vertex3f( length, 0.0f, 0.0f); - gGL.vertex3f( 0.0f, -boneSize, 0.0f); - gGL.vertex3f( 0.0f, 0.0f, -boneSize); +// gGL.vertex3f( length, 0.0f, 0.0f); +// gGL.vertex3f( 0.0f, -boneSize, 0.0f); +// gGL.vertex3f( 0.0f, 0.0f, -boneSize); - gGL.vertex3f( length, 0.0f, 0.0f); - gGL.vertex3f( 0.0f, 0.0f, boneSize); - gGL.vertex3f( 0.0f, -boneSize, 0.0f); +// gGL.vertex3f( length, 0.0f, 0.0f); +// gGL.vertex3f( 0.0f, 0.0f, boneSize); +// gGL.vertex3f( 0.0f, -boneSize, 0.0f); - gGL.end(); +// gGL.end(); - // restore matrix - glPopMatrix(); -} +// // restore matrix +// glPopMatrix(); +// } //-------------------------------------------------------------------- // isTransparent() @@ -437,13 +439,13 @@ void LLViewerJoint::updateFaceData(LLFace *face, F32 pixel_area, BOOL damp_wind) } } -void LLViewerJoint::updateGeometry() +void LLViewerJoint::updateJointGeometry() { for (child_list_t::iterator iter = mChildren.begin(); iter != mChildren.end(); ++iter) { LLViewerJoint* joint = (LLViewerJoint*)(*iter); - joint->updateGeometry(); + joint->updateJointGeometry(); } } diff --git a/linden/indra/newview/llviewerjoint.h b/linden/indra/newview/llviewerjoint.h index d223c42..f73e705 100644 --- a/linden/indra/newview/llviewerjoint.h +++ b/linden/indra/newview/llviewerjoint.h @@ -60,7 +60,12 @@ public: // Primarily for debugging and character setup // Derived classes may add text/graphic output. // Draw skeleton graphic for debugging and character setup - virtual void renderSkeleton(BOOL recursive=TRUE); + void renderSkeleton(BOOL recursive=TRUE); // debug only (unused) + + // Draws a bone graphic to the parent joint. + // Derived classes may add text/graphic output. + // Called by renderSkeleton(). + void drawBone(); // debug only (unused) // Render character hierarchy. // Traverses the entire joint hierarchy, setting up @@ -68,11 +73,6 @@ public: // Derived classes may add text/graphic output. virtual U32 render( F32 pixelArea, BOOL first_pass = TRUE ); // Returns triangle count - // Draws a bone graphic to the parent joint. - // Derived classes may add text/graphic output. - // Called by renderSkeleton(). - virtual void drawBone(); - // Returns true if this object is transparent. // This is used to determine in which order to draw objects. virtual BOOL isTransparent(); @@ -127,7 +127,7 @@ public: virtual void updateFaceSizes(U32 &num_vertices, U32& num_indices, F32 pixel_area); virtual void updateFaceData(LLFace *face, F32 pixel_area, BOOL damp_wind = FALSE); virtual BOOL updateLOD(F32 pixel_area, BOOL activate); - virtual void updateGeometry(); + virtual void updateJointGeometry(); virtual void dump(); void setVisible( BOOL visible, BOOL recursive ); diff --git a/linden/indra/newview/llviewerjointattachment.cpp b/linden/indra/newview/llviewerjointattachment.cpp index f5a5d8a..1cdd10f 100644 --- a/linden/indra/newview/llviewerjointattachment.cpp +++ b/linden/indra/newview/llviewerjointattachment.cpp @@ -56,7 +56,6 @@ extern LLPipeline gPipeline; // LLViewerJointAttachment() //----------------------------------------------------------------------------- LLViewerJointAttachment::LLViewerJointAttachment() : -mJoint(NULL), mAttachedObject(NULL), mVisibleInFirst(FALSE), mGroup(0), diff --git a/linden/indra/newview/llviewerjointattachment.h b/linden/indra/newview/llviewerjointattachment.h index 63484c7..8e665aa 100644 --- a/linden/indra/newview/llviewerjointattachment.h +++ b/linden/indra/newview/llviewerjointattachment.h @@ -68,7 +68,6 @@ public: // accessors // - void setJoint (LLJoint* joint) { mJoint = joint; } void setPieSlice(S32 pie_slice) { mPieSlice = pie_slice; } void setVisibleInFirstPerson(BOOL visibility) { mVisibleInFirst = visibility; } BOOL getVisibleInFirstPerson() { return mVisibleInFirst; } @@ -99,7 +98,6 @@ protected: void calcLOD(); protected: - LLJoint* mJoint; // Backlink only; don't make this an LLPointer. LLViewerObject* mAttachedObject; BOOL mVisibleInFirst; diff --git a/linden/indra/newview/llviewerjointmesh.cpp b/linden/indra/newview/llviewerjointmesh.cpp index 0dcf4ab..9ffeee4 100644 --- a/linden/indra/newview/llviewerjointmesh.cpp +++ b/linden/indra/newview/llviewerjointmesh.cpp @@ -873,7 +873,7 @@ void LLViewerJointMesh::updateVectorize() } } -void LLViewerJointMesh::updateGeometry() +void LLViewerJointMesh::updateJointGeometry() { if (!(mValid && mMesh diff --git a/linden/indra/newview/llviewerjointmesh.h b/linden/indra/newview/llviewerjointmesh.h index 85f8e97..fd7f550 100644 --- a/linden/indra/newview/llviewerjointmesh.h +++ b/linden/indra/newview/llviewerjointmesh.h @@ -142,7 +142,7 @@ public: /*virtual*/ void updateFaceSizes(U32 &num_vertices, U32& num_indices, F32 pixel_area); /*virtual*/ void updateFaceData(LLFace *face, F32 pixel_area, BOOL damp_wind = FALSE); /*virtual*/ BOOL updateLOD(F32 pixel_area, BOOL activate); - /*virtual*/ void updateGeometry(); + /*virtual*/ void updateJointGeometry(); /*virtual*/ void dump(); void setIsTransparent(BOOL is_transparent) { mIsTransparent = is_transparent; } diff --git a/linden/indra/newview/llviewernetwork.cpp b/linden/indra/newview/llviewernetwork.cpp index c1de774..42cbe46 100644 --- a/linden/indra/newview/llviewernetwork.cpp +++ b/linden/indra/newview/llviewernetwork.cpp @@ -120,13 +120,8 @@ static LLGridData gGridInfo[GRID_INFO_COUNT] = "" } }; -#if LL_RELEASE_FOR_DOWNLOAD - // Default userserver for production builds is agni - const EGridInfo DEFAULT_GRID_CHOICE = GRID_INFO_AGNI; -#else - // Default userserver for development builds is none - const EGridInfo DEFAULT_GRID_CHOICE = GRID_INFO_NONE; -#endif +const EGridInfo DEFAULT_GRID_CHOICE = GRID_INFO_AGNI; + unsigned char gMACAddress[MAC_ADDRESS_BYTES]; /* Flawfinder: ignore */ @@ -142,7 +137,7 @@ void LLViewerLogin::setGridChoice(EGridInfo grid) llerrs << "Invalid grid index specified." << llendl; } - if(mGridChoice != grid) + if(mGridChoice != grid || gSavedSettings.getS32("ServerChoice") != grid) { mGridChoice = grid; if(GRID_INFO_LOCAL == mGridChoice) diff --git a/linden/indra/newview/llviewerobjectlist.cpp b/linden/indra/newview/llviewerobjectlist.cpp index 84475ab..bd8ed97 100644 --- a/linden/indra/newview/llviewerobjectlist.cpp +++ b/linden/indra/newview/llviewerobjectlist.cpp @@ -685,7 +685,6 @@ void LLViewerObjectList::update(LLAgent &agent, LLWorld &world) idle_iter != idle_list.end(); idle_iter++) { objectp = *idle_iter; - llassert_always(objectp) ; if (!objectp->idleUpdate(agent, world, frame_time)) { // If Idle Update returns false, kill object! diff --git a/linden/indra/newview/llviewerstats.cpp b/linden/indra/newview/llviewerstats.cpp index 52b6748..fd56c21 100644 --- a/linden/indra/newview/llviewerstats.cpp +++ b/linden/indra/newview/llviewerstats.cpp @@ -52,6 +52,7 @@ #include "lldebugview.h" #include "llfasttimerview.h" #include "llviewerregion.h" +#include "llvoavatar.h" #include "llfloaterhtml.h" #include "llviewerwindow.h" // *TODO: remove, only used for width/height #include "llworld.h" diff --git a/linden/indra/newview/llviewerwindow.cpp b/linden/indra/newview/llviewerwindow.cpp index d61fa59..c2fd92c 100644 --- a/linden/indra/newview/llviewerwindow.cpp +++ b/linden/indra/newview/llviewerwindow.cpp @@ -4522,7 +4522,6 @@ BOOL LLViewerWindow::rawSnapshot(LLImageRaw *raw, S32 image_width, S32 image_hei else { display(do_rebuild, scale_factor, subimage_x+(subimage_y*llceil(scale_factor)), use_fbo); - render_ui_and_swap(); } S32 subimage_x_offset = llclamp(buffer_x_offset - (subimage_x * window_width), 0, window_width); diff --git a/linden/indra/newview/llvoavatar.cpp b/linden/indra/newview/llvoavatar.cpp index 6b5f066..b4357d8 100644 --- a/linden/indra/newview/llvoavatar.cpp +++ b/linden/indra/newview/llvoavatar.cpp @@ -888,52 +888,53 @@ LLVOAvatar::LLVOAvatar( if (LLCharacter::sInstances.size() == 1) { LLKeyframeMotion::setVFS(gStaticVFS); - addMotion( ANIM_AGENT_BUSY, LLNullMotion::create ); - addMotion( ANIM_AGENT_CROUCH, LLKeyframeStandMotion::create ); - addMotion( ANIM_AGENT_CROUCHWALK, LLKeyframeWalkMotion::create ); - addMotion( ANIM_AGENT_EXPRESS_AFRAID, LLEmote::create ); - addMotion( ANIM_AGENT_EXPRESS_ANGER, LLEmote::create ); - addMotion( ANIM_AGENT_EXPRESS_BORED, LLEmote::create ); - addMotion( ANIM_AGENT_EXPRESS_CRY, LLEmote::create ); - addMotion( ANIM_AGENT_EXPRESS_DISDAIN, LLEmote::create ); - addMotion( ANIM_AGENT_EXPRESS_EMBARRASSED, LLEmote::create ); - addMotion( ANIM_AGENT_EXPRESS_FROWN, LLEmote::create ); - addMotion( ANIM_AGENT_EXPRESS_KISS, LLEmote::create ); - addMotion( ANIM_AGENT_EXPRESS_LAUGH, LLEmote::create ); - addMotion( ANIM_AGENT_EXPRESS_OPEN_MOUTH, LLEmote::create ); - addMotion( ANIM_AGENT_EXPRESS_REPULSED, LLEmote::create ); - addMotion( ANIM_AGENT_EXPRESS_SAD, LLEmote::create ); - addMotion( ANIM_AGENT_EXPRESS_SHRUG, LLEmote::create ); - addMotion( ANIM_AGENT_EXPRESS_SMILE, LLEmote::create ); - addMotion( ANIM_AGENT_EXPRESS_SURPRISE, LLEmote::create ); - addMotion( ANIM_AGENT_EXPRESS_TONGUE_OUT, LLEmote::create ); - addMotion( ANIM_AGENT_EXPRESS_TOOTHSMILE, LLEmote::create ); - addMotion( ANIM_AGENT_EXPRESS_WINK, LLEmote::create ); - addMotion( ANIM_AGENT_EXPRESS_WORRY, LLEmote::create ); - addMotion( ANIM_AGENT_RUN, LLKeyframeWalkMotion::create ); - addMotion( ANIM_AGENT_STAND, LLKeyframeStandMotion::create ); - addMotion( ANIM_AGENT_STAND_1, LLKeyframeStandMotion::create ); - addMotion( ANIM_AGENT_STAND_2, LLKeyframeStandMotion::create ); - addMotion( ANIM_AGENT_STAND_3, LLKeyframeStandMotion::create ); - addMotion( ANIM_AGENT_STAND_4, LLKeyframeStandMotion::create ); - addMotion( ANIM_AGENT_STANDUP, LLKeyframeFallMotion::create ); - addMotion( ANIM_AGENT_TURNLEFT, LLKeyframeWalkMotion::create ); - addMotion( ANIM_AGENT_TURNRIGHT, LLKeyframeWalkMotion::create ); - addMotion( ANIM_AGENT_WALK, LLKeyframeWalkMotion::create ); + registerMotion( ANIM_AGENT_BUSY, LLNullMotion::create ); + registerMotion( ANIM_AGENT_CROUCH, LLKeyframeStandMotion::create ); + registerMotion( ANIM_AGENT_CROUCHWALK, LLKeyframeWalkMotion::create ); + registerMotion( ANIM_AGENT_EXPRESS_AFRAID, LLEmote::create ); + registerMotion( ANIM_AGENT_EXPRESS_ANGER, LLEmote::create ); + registerMotion( ANIM_AGENT_EXPRESS_BORED, LLEmote::create ); + registerMotion( ANIM_AGENT_EXPRESS_CRY, LLEmote::create ); + registerMotion( ANIM_AGENT_EXPRESS_DISDAIN, LLEmote::create ); + registerMotion( ANIM_AGENT_EXPRESS_EMBARRASSED, LLEmote::create ); + registerMotion( ANIM_AGENT_EXPRESS_FROWN, LLEmote::create ); + registerMotion( ANIM_AGENT_EXPRESS_KISS, LLEmote::create ); + registerMotion( ANIM_AGENT_EXPRESS_LAUGH, LLEmote::create ); + registerMotion( ANIM_AGENT_EXPRESS_OPEN_MOUTH, LLEmote::create ); + registerMotion( ANIM_AGENT_EXPRESS_REPULSED, LLEmote::create ); + registerMotion( ANIM_AGENT_EXPRESS_SAD, LLEmote::create ); + registerMotion( ANIM_AGENT_EXPRESS_SHRUG, LLEmote::create ); + registerMotion( ANIM_AGENT_EXPRESS_SMILE, LLEmote::create ); + registerMotion( ANIM_AGENT_EXPRESS_SURPRISE, LLEmote::create ); + registerMotion( ANIM_AGENT_EXPRESS_TONGUE_OUT, LLEmote::create ); + registerMotion( ANIM_AGENT_EXPRESS_TOOTHSMILE, LLEmote::create ); + registerMotion( ANIM_AGENT_EXPRESS_WINK, LLEmote::create ); + registerMotion( ANIM_AGENT_EXPRESS_WORRY, LLEmote::create ); + registerMotion( ANIM_AGENT_RUN, LLKeyframeWalkMotion::create ); + registerMotion( ANIM_AGENT_STAND, LLKeyframeStandMotion::create ); + registerMotion( ANIM_AGENT_STAND_1, LLKeyframeStandMotion::create ); + registerMotion( ANIM_AGENT_STAND_2, LLKeyframeStandMotion::create ); + registerMotion( ANIM_AGENT_STAND_3, LLKeyframeStandMotion::create ); + registerMotion( ANIM_AGENT_STAND_4, LLKeyframeStandMotion::create ); + registerMotion( ANIM_AGENT_STANDUP, LLKeyframeFallMotion::create ); + registerMotion( ANIM_AGENT_TURNLEFT, LLKeyframeWalkMotion::create ); + registerMotion( ANIM_AGENT_TURNRIGHT, LLKeyframeWalkMotion::create ); + registerMotion( ANIM_AGENT_WALK, LLKeyframeWalkMotion::create ); // motions without a start/stop bit - addMotion( ANIM_AGENT_BODY_NOISE, LLBodyNoiseMotion::create ); - addMotion( ANIM_AGENT_BREATHE_ROT, LLBreatheMotionRot::create ); - addMotion( ANIM_AGENT_EDITING, LLEditingMotion::create ); - addMotion( ANIM_AGENT_EYE, LLEyeMotion::create ); - addMotion( ANIM_AGENT_FEMALE_WALK, LLKeyframeWalkMotion::create ); - addMotion( ANIM_AGENT_FLY_ADJUST, LLFlyAdjustMotion::create ); - addMotion( ANIM_AGENT_HAND_MOTION, LLHandMotion::create ); - addMotion( ANIM_AGENT_HEAD_ROT, LLHeadRotMotion::create ); - addMotion( ANIM_AGENT_PELVIS_FIX, LLPelvisFixMotion::create ); - addMotion( ANIM_AGENT_SIT_FEMALE, LLKeyframeMotion::create ); - addMotion( ANIM_AGENT_TARGET, LLTargetingMotion::create ); - addMotion( ANIM_AGENT_WALK_ADJUST, LLWalkAdjustMotion::create ); + registerMotion( ANIM_AGENT_BODY_NOISE, LLBodyNoiseMotion::create ); + registerMotion( ANIM_AGENT_BREATHE_ROT, LLBreatheMotionRot::create ); + registerMotion( ANIM_AGENT_EDITING, LLEditingMotion::create ); + registerMotion( ANIM_AGENT_EYE, LLEyeMotion::create ); + registerMotion( ANIM_AGENT_FEMALE_WALK, LLKeyframeWalkMotion::create ); + registerMotion( ANIM_AGENT_FLY_ADJUST, LLFlyAdjustMotion::create ); + registerMotion( ANIM_AGENT_HAND_MOTION, LLHandMotion::create ); + registerMotion( ANIM_AGENT_HEAD_ROT, LLHeadRotMotion::create ); + registerMotion( ANIM_AGENT_PELVIS_FIX, LLPelvisFixMotion::create ); + registerMotion( ANIM_AGENT_SIT_FEMALE, LLKeyframeMotion::create ); + registerMotion( ANIM_AGENT_TARGET, LLTargetingMotion::create ); + registerMotion( ANIM_AGENT_WALK_ADJUST, LLWalkAdjustMotion::create ); + } if (gNoRender) @@ -3329,7 +3330,7 @@ BOOL LLVOAvatar::updateCharacter(LLAgent &agent) // the rest should only be done occasionally for far away avatars //-------------------------------------------------------------------- - if (!mIsSelf && sUseImpostors && !mNeedsAnimUpdate && !sFreezeCounter) + if (!mIsSelf && !mIsDummy && sUseImpostors && !mNeedsAnimUpdate && !sFreezeCounter) { F32 impostor_area = 256.f*512.f*(8.125f - LLVOAvatar::sLODFactor*8.f); if (LLMuteList::getInstance()->isMuted(getID())) @@ -3350,22 +3351,13 @@ BOOL LLVOAvatar::updateCharacter(LLAgent &agent) if (!visible) { - if (!mMotionController.isPaused()) - { - mMotionController.pause(); - mMotionController.updateMotion(); - mMotionController.unpause(); - } - else - { - mMotionController.updateMotion(); - } + updateMotions(LLCharacter::HIDDEN_UPDATE); return FALSE; } } - + // change animation time quanta based on avatar render load - if (!mIsSelf) + if (!mIsSelf && !mIsDummy) { F32 time_quantum = clamp_rescale((F32)sInstances.size(), 10.f, 35.f, 0.f, 0.25f); F32 pixel_area_scale = clamp_rescale(mPixelArea, 100, 5000, 1.f, 0.f); @@ -3639,10 +3631,10 @@ BOOL LLVOAvatar::updateCharacter(LLAgent &agent) mSpeed = speed; // update animations - { - LLFastTimer t(LLFastTimer::FTM_UPDATE_ANIMATION); - updateMotion(); - } + if (mSpecialRenderMode == 1) // Animation Preview + updateMotions(LLCharacter::FORCE_UPDATE); + else + updateMotions(LLCharacter::NORMAL_UPDATE); // update head position updateHeadOffset(); @@ -3818,9 +3810,6 @@ void LLVOAvatar::updateVisibility() } else { - // calculate avatar distance wrt head - mDrawable->updateDistance(*LLViewerCamera::getInstance()); - if (!mDrawable->getSpatialGroup() || mDrawable->getSpatialGroup()->isVisible()) { visible = TRUE; @@ -3837,8 +3826,7 @@ void LLVOAvatar::updateVisibility() visible = FALSE; } } - else - if( !mFirstAppearanceMessageReceived ) + else if( !mFirstAppearanceMessageReceived ) { visible = FALSE; } @@ -3984,19 +3972,19 @@ U32 LLVOAvatar::renderSkinned(EAvatarRenderPass pass) if (mNeedsSkin) { //generate animated mesh - mLowerBodyLOD.updateGeometry(); - mUpperBodyLOD.updateGeometry(); + mLowerBodyLOD.updateJointGeometry(); + mUpperBodyLOD.updateJointGeometry(); if( isWearingWearableType( WT_SKIRT ) ) { - mSkirtLOD.updateGeometry(); + mSkirtLOD.updateJointGeometry(); } if (!mIsSelf || gAgent.needsRenderHead()) { - mEyeLashLOD.updateGeometry(); - mHeadLOD.updateGeometry(); - mHairLOD.updateGeometry(); + mEyeLashLOD.updateJointGeometry(); + mHeadLOD.updateJointGeometry(); + mHairLOD.updateJointGeometry(); } mNeedsSkin = FALSE; @@ -5756,6 +5744,7 @@ void LLVOAvatar::setPixelAreaAndAngle(LLAgent &agent) //----------------------------------------------------------------------------- BOOL LLVOAvatar::updateJointLODs() { + const F32 MAX_PIXEL_AREA = 100000000.f; F32 lod_factor = (sLODFactor * AVATAR_LOD_TWEAK_RANGE + (1.f - AVATAR_LOD_TWEAK_RANGE)); F32 avatar_num_min_factor = clamp_rescale(sLODFactor, 0.f, 1.f, 0.25f, 0.6f); F32 avatar_num_factor = clamp_rescale((F32)sNumVisibleAvatars, 8, 25, 1.f, avatar_num_min_factor); @@ -5766,7 +5755,7 @@ BOOL LLVOAvatar::updateJointLODs() { if(gAgent.cameraCustomizeAvatar() || gAgent.cameraMouselook()) { - mAdjustedPixelArea = 1000000; + mAdjustedPixelArea = MAX_PIXEL_AREA; } else { @@ -5775,7 +5764,7 @@ BOOL LLVOAvatar::updateJointLODs() } else if (mIsDummy) { - mAdjustedPixelArea = 1000000; + mAdjustedPixelArea = MAX_PIXEL_AREA; } else { @@ -6729,7 +6718,7 @@ void LLVOAvatar::dumpTotalLocalTextureByteCount() BOOL LLVOAvatar::isVisible() { - return mDrawable.notNull() && mDrawable->isVisible(); + return mDrawable.notNull() && (mDrawable->isVisible() || mIsDummy); } @@ -9691,7 +9680,8 @@ BOOL LLVOAvatar::updateLOD() mDrawable->clearState(LLDrawable::REBUILD_GEOMETRY); } - + updateVisibility(); + return res; } diff --git a/linden/indra/newview/llvoavatar.h b/linden/indra/newview/llvoavatar.h index 1df8275..a1f5bd2 100644 --- a/linden/indra/newview/llvoavatar.h +++ b/linden/indra/newview/llvoavatar.h @@ -751,9 +751,9 @@ public: //-------------------------------------------------------------------- F32 mSpeed; - // + //-------------------------------------------------------------------- // Shadow stuff - // + //-------------------------------------------------------------------- LLDrawable* mShadow; BOOL mInAir; LLFrameTimer mTimeInAir; @@ -1009,7 +1009,7 @@ protected: S32 getLocalDiscardLevel( S32 index); void shame(); //generate shame metric -//Ventrella + //----------------------------------------------------------------------------------------------- // the Voice Visualizer is responsible for detecting the user's voice signal, and when the // user speaks, it puts a voice symbol over the avatar's head, and triggering gesticulations @@ -1017,7 +1017,6 @@ protected: private: LLVoiceVisualizer * mVoiceVisualizer; int mCurrentGesticulationLevel; -//End Ventrella private: static S32 sFreezeCounter ; diff --git a/linden/indra/newview/llvoiceclient.h b/linden/indra/newview/llvoiceclient.h index d1609a8..8d2c2ac 100644 --- a/linden/indra/newview/llvoiceclient.h +++ b/linden/indra/newview/llvoiceclient.h @@ -31,8 +31,6 @@ #ifndef LL_VOICE_CLIENT_H #define LL_VOICE_CLIENT_H -// This would create a circular reference -- just do a forward definition of necessary class names. -//#include "llvoavatar.h" class LLVOAvatar; class LLVivoxProtocolParser; diff --git a/linden/indra/newview/llwebbrowserctrl.cpp b/linden/indra/newview/llwebbrowserctrl.cpp index 1d187cb..cfe5cb6 100644 --- a/linden/indra/newview/llwebbrowserctrl.cpp +++ b/linden/indra/newview/llwebbrowserctrl.cpp @@ -862,7 +862,7 @@ BOOL LLWebBrowserTexture::render() mTexture->setSubImage( pixels, media_data_width, media_data_height, 0, 0, - width, height ); + llmin(width, media_data_width), llmin(media_data_height, height) ); }; } else diff --git a/linden/indra/newview/macview.xcodeproj/project.pbxproj b/linden/indra/newview/macview.xcodeproj/project.pbxproj index c361fcf..81e0874 100644 --- a/linden/indra/newview/macview.xcodeproj/project.pbxproj +++ b/linden/indra/newview/macview.xcodeproj/project.pbxproj @@ -5544,6 +5544,7 @@ "-DLL_RELEASE_FOR_DOWNLOAD=1", "-DNDEBUG", "-fconstant-cfstrings", + "-mlong-branch", ); OTHER_CPLUSPLUSFLAGS = ( "$(OTHER_CFLAGS)", diff --git a/linden/indra/newview/pipeline.cpp b/linden/indra/newview/pipeline.cpp index 5088b16..cd546d4 100644 --- a/linden/indra/newview/pipeline.cpp +++ b/linden/indra/newview/pipeline.cpp @@ -1786,17 +1786,16 @@ void LLPipeline::stateSort(LLDrawable* drawablep, LLCamera& camera) LLSpatialGroup* group = drawablep->getSpatialGroup(); if (!group || group->changeLOD()) { - if (!drawablep->isActive() && drawablep->isVisible()) + if (drawablep->isVisible() && !sSkipUpdate) { - if (!sSkipUpdate) + if (!drawablep->isActive()) { drawablep->updateDistance(camera); } - } - else if (drawablep->isAvatar() && drawablep->isVisible()) - { - LLVOAvatar* vobj = (LLVOAvatar*) drawablep->getVObj().get(); - vobj->updateVisibility(); + else if (drawablep->isAvatar()) + { + drawablep->updateDistance(camera); // calls vobj->updateLOD() which calls LLVOAvatar::updateVisibility() + } } } diff --git a/linden/indra/newview/releasenotes.txt b/linden/indra/newview/releasenotes.txt index f3fbcb1..5ec38fc 100644 --- a/linden/indra/newview/releasenotes.txt +++ b/linden/indra/newview/releasenotes.txt @@ -4,10 +4,37 @@ | http://wiki.secondlife.com/wiki/Beta_Release_Notes | +------------------------------------------------------+ +Release Notes for Second Life 1.20(11) June 17th, 2008 +===================================== + +Fixes: +* Fixed: VWR-7730: Sound / UI Sound broken on Mac PPC RC 1.20.10 +* Fixed: VWR-7614: Snapshots show user interface when "Show Interface In Snapshot" is un-checked/ VWR-7679: Interface also shows in screen_last.bmp +* Fixed: VWR-2633: Some groups can't be accessed from Communicate window and only show in profile / VWR-6889: Unable to leave group when role has no allowed abilities +* Fixed: VWR-5895: slowly rotating llTargetOmega child prims stop rotating when you move away +* Fixed: VWR-6828: Character > Show Look At / Show Point At don't work +* Fixed: VWR-7682: Typo on Teleport Failure dialog +* Fixed: VWR-7086: floater_buy_land.xml still contains messages regarding First Land +* Fixed: VWR-5697: RC 1.19.1 crash on startup with Vista UAC enabled +* Fixed: VWR-7723: crash on LLImageGL::setSubImage line 780 +* Fixed: crash on LLViewerImageList::removeImageFromList +* Fixed: crash on LLViewerImageList::updateImagesUpdateStats +* Fixed: crash when creating many default boxes +* Fixed: changing to and from Fullscreen view using Alt+Enter shortcut causes viewer to crash/hang +* Fixed: Load the initial avatar outfit earlier in the startup process to avoid Ruth effect at Orientation Island +* Fixed: Add the new TRANSPARENT_TEXTURE constant's target texture to the inventory Library of 1.20 +* Fixed: Search > Places tab results are displayed in white text +* Fixed: 1.20 viewer reports GeForce FX5200 card incorrectly +* Fixed: Fix the URL used by crash_logger for pre login crashes. +* Fixed: The viewer's crash logger needs to trim very long SecondLife.log files before sending. + +Localization Fixes: +* Fixed: VWR-7731: Bad Japanese translation of "Select tool" + Release Notes for Second Life 1.20(10) June 9th, 2008 ===================================== -Changes: +New features: * Added five texture constants for referencing in llSetLinkTexture: ** TEXTURE_BLANK is the non-transparent blank texture, equivalent to UUID "5748decc-f629-461c-9a36-a35a221fe21f" ** TEXTURE_DEFAULT is the default plywood texture, equivalent to UUID "89556747-24cb-43ed-920b-47caed15465f" @@ -23,28 +50,31 @@ Changes: then you have to revert to the earlier LSL requirement to use the UUID of the texture you want to use. *** The TEXTURE_TRANSPARENT texture will be gray unless you view it with a viewer that supports this transparent texture (1.20.10 or above). +Changes: +* Watchdog is disabled in settings for final Release Candidates +* VWR-7315: "TEXTURE_DEFAULT" is a bad constant name; (this now refers to Plywood texture) + Fixes: -* Fixed: PowerPC Mac unexpectedly quits when SL runs -* Fixed: VWR-7069: Can't login to v1.20 RC until the second try -* Fixed: Openssl hangs on first https request +* Fixed: VWR-7612: PowerPC Mac unexpectedly quits when SL runs +** also Possible Fix: VWR-7400 Mac PPC 1.20.8: Unable to connect +* Fixed: VWR-7069: Can't login to v1.20 RC until the second try (Openssl hangs on first https request) * Fixed: VWR-7261: pixellation static/rectangle seen nearby avatar imposters * Fixed: VWR-1715: Macintosh: cyclic short-term freezing of display, getting worse over time: does not respond to commands, eventually change of POV attempt crashes app * Fixed: VWR-7338: New Texture Constant "TEXTURE_TRANSPARENT" is NOT transparent! -* Fixed: VWR-7315: "TEXTURE_DEFAULT" is a bad constant name -* Fixed: Automatic linux font selection doesn't override legacy data in config file -* Fixed: Viewer crash logger should trim very long SecondLife.log files before sending -* Fixed: viewer sends no grid choice to the web server -* Fixed: Fix the URL used by crash_logger for pre login crashes -* Fixed: Any change to preferences "restores" the viewer window size -* Fixed: Crash on LLSpeakerMgr::findSpeaker +* Fixed: crash on LLSpeakerMgr::findSpeaker * Fixed: crash on LLAudioData - llaudio/audioengine.cpp * Fixed: crash on LLGroupNotifyBox::moveToBack * Fixed: crash on LLPieMenu::show * Fixed: crash on LLFloaterWorldMap::buildLandmarkIDLists -* Fixed: Setting Preferences > General > Crash Reports to Never Send crashes to desktop +* Fixed: crash on LLDrawable::destroy +* Fixed: Automatic linux font selection doesn't override legacy data in config file +* Fixed: Any change to preferences "restores" the viewer window size +* Fixed: viewer sends no grid choice to the web server +* Fixed: Fix the URL used by crash_logger for pre login crashes +* Fixed: Viewer crash logger should trim very long SecondLife.log files before sending Localization Fixes: -Partial Fix: Repair truncated text in 1.20.9 localizations +* Partial Fix: Repair truncated text in 1.20.9 localizations Release Notes for Second Life 1.20(9) June 3rd, 2008 ===================================== diff --git a/linden/indra/newview/skins/xui/de/teleport_strings.xml b/linden/indra/newview/skins/xui/de/teleport_strings.xml index 061f41d..6beba54 100644 --- a/linden/indra/newview/skins/xui/de/teleport_strings.xml +++ b/linden/indra/newview/skins/xui/de/teleport_strings.xml @@ -4,7 +4,7 @@ Bei der Bearbeitung Ihrer Teleport-Anfrage ist ein Problem aufgetreten. Sie müssen sich zum Teleportieren eventuell neu anmelden. Wenn Sie diese -Nachricht weiterhin erhalten, konsultieren Sie bitte die Tech-Support-FAQ unter: +Nachricht weiterhin erhalten, konsultieren Sie bitte die Tech-Support-FAQ unter: www.secondlife.com/support diff --git a/linden/indra/newview/skins/xui/en-us/floater_buy_land.xml b/linden/indra/newview/skins/xui/en-us/floater_buy_land.xml index fe76e10..a7fd3ed 100644 --- a/linden/indra/newview/skins/xui/en-us/floater_buy_land.xml +++ b/linden/indra/newview/skins/xui/en-us/floater_buy_land.xml @@ -213,14 +213,6 @@ Try selecting a smaller area. Land owned by another user is selected. Try selecting a smaller area. - - This land is reserved for first time buyers. -You cannot buy it for a group. - - - This land is reserved for first time buyers. -You already own land. - Processing your purchase... diff --git a/linden/indra/newview/skins/xui/en-us/floater_directory.xml b/linden/indra/newview/skins/xui/en-us/floater_directory.xml index dd7520c..8cfb470 100644 --- a/linden/indra/newview/skins/xui/en-us/floater_directory.xml +++ b/linden/indra/newview/skins/xui/en-us/floater_directory.xml @@ -385,6 +385,7 @@ To buy direct, visit the land and click on the place name in the title bar. font="SansSerifSmall" h_pad="0" halign="left" height="16" left="4" mouse_opaque="true" name="result_text" v_pad="0" width="328" /> + @@ -458,9 +459,8 @@ To buy direct, visit the land and click on the place name in the title bar.