diff options
| -rw-r--r-- | indra/llcharacter/llcharacter.cpp | 9 | ||||
| -rw-r--r-- | indra/llcharacter/llcharacter.h | 3 | ||||
| -rw-r--r-- | indra/llcharacter/llmotioncontroller.cpp | 17 | ||||
| -rw-r--r-- | indra/llcharacter/llmotioncontroller.h | 3 | ||||
| -rw-r--r-- | indra/newview/llpreview.cpp | 14 | ||||
| -rw-r--r-- | indra/newview/llpreview.h | 6 | ||||
| -rw-r--r-- | indra/newview/llpreviewanim.cpp | 10 | ||||
| -rw-r--r-- | indra/newview/llpreviewgesture.cpp | 6 | ||||
| -rw-r--r-- | indra/newview/llpreviewnotecard.cpp | 12 | ||||
| -rw-r--r-- | indra/newview/llpreviewnotecard.h | 2 | ||||
| -rw-r--r-- | indra/newview/llpreviewscript.cpp | 10 | ||||
| -rw-r--r-- | indra/newview/llpreviewsound.cpp | 6 | ||||
| -rw-r--r-- | indra/newview/llpreviewtexture.cpp | 4 | ||||
| -rw-r--r-- | indra/newview/llviewermenu.cpp | 6 | 
14 files changed, 68 insertions, 40 deletions
| diff --git a/indra/llcharacter/llcharacter.cpp b/indra/llcharacter/llcharacter.cpp index 583f01cf91..c6ed3e6b5d 100644 --- a/indra/llcharacter/llcharacter.cpp +++ b/indra/llcharacter/llcharacter.cpp @@ -170,6 +170,15 @@ void LLCharacter::updateMotion(BOOL force_update)  //----------------------------------------------------------------------------- +// deactivateAllMotions() +//----------------------------------------------------------------------------- +void LLCharacter::deactivateAllMotions() +{ +	mMotionController.deactivateAllMotions(); +} + + +//-----------------------------------------------------------------------------  // flushAllMotions()  //-----------------------------------------------------------------------------  void LLCharacter::flushAllMotions() diff --git a/indra/llcharacter/llcharacter.h b/indra/llcharacter/llcharacter.h index 44fb6d0833..8f720d3b84 100644 --- a/indra/llcharacter/llcharacter.h +++ b/indra/llcharacter/llcharacter.h @@ -150,6 +150,9 @@ public:  	// no cached references to character joint data.  This is   	// useful if a character wants to rebuild it's skeleton.  	virtual void flushAllMotions(); +	 +	// Flush only wipes active animations.  +	virtual void deactivateAllMotions();  	// dumps information for debugging  	virtual void dumpCharacter( LLJoint *joint = NULL ); diff --git a/indra/llcharacter/llmotioncontroller.cpp b/indra/llcharacter/llmotioncontroller.cpp index 71bbdfb932..fad69fc6e9 100644 --- a/indra/llcharacter/llmotioncontroller.cpp +++ b/indra/llcharacter/llmotioncontroller.cpp @@ -835,6 +835,23 @@ LLMotion *LLMotionController::findMotion(const LLUUID& id)  	return mAllMotions[id];  } +//----------------------------------------------------------------------------- +// deactivateAllMotions() +//----------------------------------------------------------------------------- +void LLMotionController::deactivateAllMotions() +{ +	//They must all die, precious. +	for (std::map<LLUUID, LLMotion*>::iterator iter = mAllMotions.begin(); +		 iter != mAllMotions.end(); iter++) +	{ +		LLMotion* motionp = iter->second; +		if (motionp) motionp->deactivate(); +	} + +	// delete all motion instances +	deleteAllMotions(); +} +  //-----------------------------------------------------------------------------  // flushAllMotions() diff --git a/indra/llcharacter/llmotioncontroller.h b/indra/llcharacter/llmotioncontroller.h index a19e704643..15791b6318 100644 --- a/indra/llcharacter/llmotioncontroller.h +++ b/indra/llcharacter/llmotioncontroller.h @@ -138,6 +138,9 @@ public:  	// releases all motion instances  	void flushAllMotions(); +	//Flush is a liar. +	void deactivateAllMotions();	 +  	// pause and continue all motions  	void pause();  	void unpause(); diff --git a/indra/newview/llpreview.cpp b/indra/newview/llpreview.cpp index 562e4c37c1..c4f958420b 100644 --- a/indra/newview/llpreview.cpp +++ b/indra/newview/llpreview.cpp @@ -50,7 +50,7 @@ LLPreview::LLPreview(const std::string& name) :  	mAutoFocus = FALSE;  } -LLPreview::LLPreview(const std::string& name, const LLRect& rect, const std::string& title, const LLUUID& item_uuid, const LLUUID& object_uuid, BOOL allow_resize, S32 min_width, S32 min_height, LLViewerInventoryItem* inv_item ) +LLPreview::LLPreview(const std::string& name, const LLRect& rect, const std::string& title, const LLUUID& item_uuid, const LLUUID& object_uuid, BOOL allow_resize, S32 min_width, S32 min_height, LLPointer<LLViewerInventoryItem> inv_item )  :	LLFloater(name, rect, title, allow_resize, min_width, min_height ),  	mItemUUID(item_uuid),  	mSourceID(LLUUID::null), @@ -135,11 +135,11 @@ void LLPreview::setSourceID(const LLUUID& source_id)  	sPreviewsBySource.insert(preview_multimap_t::value_type(mSourceID, mViewHandle));  } -LLViewerInventoryItem* LLPreview::getItem() const +const LLViewerInventoryItem *LLPreview::getItem() const  { -	if(mItem != NULL) +	if(mItem)  		return mItem; -	LLViewerInventoryItem* item = NULL; +	const LLViewerInventoryItem *item = NULL;  	if(mObjectUUID.isNull())  	{  		// it's an inventory item, so get the item. @@ -160,7 +160,7 @@ LLViewerInventoryItem* LLPreview::getItem() const  // Sub-classes should override this function if they allow editing  void LLPreview::onCommit()  { -	LLViewerInventoryItem* item = getItem(); +	const LLViewerInventoryItem *item = getItem();  	if(item)  	{  		if (!item->isComplete()) @@ -333,7 +333,7 @@ BOOL LLPreview::handleHover(S32 x, S32 y, MASK mask)  	{  		S32 screen_x;  		S32 screen_y; -		LLViewerInventoryItem *item = getItem(); +		const LLViewerInventoryItem *item = getItem();  		localPointToScreen(x, y, &screen_x, &screen_y );  		if(item @@ -419,7 +419,7 @@ void LLPreview::onDiscardBtn(void* data)  {  	LLPreview* self = (LLPreview*)data; -	LLViewerInventoryItem* item = self->getItem(); +	const LLViewerInventoryItem* item = self->getItem();  	if (!item) return;  	self->mForceClose = TRUE; diff --git a/indra/newview/llpreview.h b/indra/newview/llpreview.h index 1b7c0fd9c8..589e1fde21 100644 --- a/indra/newview/llpreview.h +++ b/indra/newview/llpreview.h @@ -51,13 +51,13 @@ public:  public:  	// Used for XML-based construction.  	LLPreview(const std::string& name); -	LLPreview(const std::string& name, const LLRect& rect, const std::string& title, const LLUUID& item_uuid, const LLUUID& object_uuid, BOOL allow_resize = FALSE, S32 min_width = 0, S32 min_height = 0, LLViewerInventoryItem* inv_item = NULL ); +	LLPreview(const std::string& name, const LLRect& rect, const std::string& title, const LLUUID& item_uuid, const LLUUID& object_uuid, BOOL allow_resize = FALSE, S32 min_width = 0, S32 min_height = 0, LLPointer<LLViewerInventoryItem> inv_item = NULL );  	virtual ~LLPreview();  	void setItemID(const LLUUID& item_id);  	void setObjectID(const LLUUID& object_id);  	void setSourceID(const LLUUID& source_id); -	LLViewerInventoryItem* getItem() const; // searches if not constructed with it +	const LLViewerInventoryItem *getItem() const; // searches if not constructed with it  	static LLPreview* find(const LLUUID& item_uuid);  	static LLPreview*	show(const LLUUID& item_uuid, BOOL take_focus = TRUE ); @@ -134,7 +134,7 @@ protected:  	static preview_map_t sInstances;  	LLUUID mNotecardInventoryID;  	LLUUID mObjectID; -	LLViewerInventoryItem* mItem; +	LLPointer<LLViewerInventoryItem> mItem;  }; diff --git a/indra/newview/llpreviewanim.cpp b/indra/newview/llpreviewanim.cpp index 99cff4b718..6e3403932d 100644 --- a/indra/newview/llpreviewanim.cpp +++ b/indra/newview/llpreviewanim.cpp @@ -31,7 +31,7 @@ LLPreviewAnim::LLPreviewAnim(const std::string& name, const LLRect& rect, const  	childSetAction("Anim play btn",playAnim,this);  	childSetAction("Anim audition btn",auditionAnim,this); -	LLInventoryItem* item = getItem(); +	const LLInventoryItem* item = getItem();  	childSetCommitCallback("desc", LLPreview::onText, this);  	childSetText("desc", item->getDescription()); @@ -87,7 +87,7 @@ void LLPreviewAnim::endAnimCallback( void *userdata )  void LLPreviewAnim::playAnim( void *userdata )  {  	LLPreviewAnim* self = (LLPreviewAnim*) userdata; -	LLInventoryItem *item = self->getItem(); +	const LLInventoryItem *item = self->getItem();  	if(item)  	{ @@ -124,7 +124,7 @@ void LLPreviewAnim::playAnim( void *userdata )  void LLPreviewAnim::auditionAnim( void *userdata )  {  	LLPreviewAnim* self = (LLPreviewAnim*) userdata; -	LLInventoryItem *item = self->getItem(); +	const LLInventoryItem *item = self->getItem();  	if(item)  	{ @@ -160,7 +160,7 @@ void LLPreviewAnim::auditionAnim( void *userdata )  void LLPreviewAnim::saveAnim( void *userdata )  {  	LLPreviewAnim* self = (LLPreviewAnim*) userdata; -	LLInventoryItem *item = self->getItem(); +	const LLInventoryItem *item = self->getItem();  	if(item)  	{ @@ -186,7 +186,7 @@ void LLPreviewAnim::saveAnim( void *userdata )  void LLPreviewAnim::onClose(bool app_quitting)  { -	LLInventoryItem *item = getItem(); +	const LLInventoryItem *item = getItem();  	if(item)  	{ diff --git a/indra/newview/llpreviewgesture.cpp b/indra/newview/llpreviewgesture.cpp index 9710fc8bf2..c556e3f450 100644 --- a/indra/newview/llpreviewgesture.cpp +++ b/indra/newview/llpreviewgesture.cpp @@ -504,7 +504,7 @@ BOOL LLPreviewGesture::postBuild()  	addSounds(); -	LLInventoryItem* item = getItem(); +	const LLInventoryItem* item = getItem();  	if (item)   	{ @@ -830,7 +830,7 @@ void LLPreviewGesture::initDefaultGesture()  void LLPreviewGesture::loadAsset()  { -	LLInventoryItem* item = getItem(); +	const LLInventoryItem* item = getItem();  	if (!item) return;  	LLUUID asset_id = item->getAssetUUID(); @@ -1100,7 +1100,7 @@ void LLPreviewGesture::saveIfNeeded()  		file.write((U8*)buffer, size);  		// Upload that asset to the database -		LLInventoryItem* item = getItem(); +		const LLInventoryItem* item = getItem();  		if (item)  		{  			std::string agent_url = gAgent.getRegion()->getCapability("UpdateGestureAgentInventory"); diff --git a/indra/newview/llpreviewnotecard.cpp b/indra/newview/llpreviewnotecard.cpp index e5dfb9ae76..8650bcf459 100644 --- a/indra/newview/llpreviewnotecard.cpp +++ b/indra/newview/llpreviewnotecard.cpp @@ -62,7 +62,7 @@ LLPreviewNotecard::LLPreviewNotecard(const std::string& name,  									 const LLUUID& object_id,  									 const LLUUID& asset_id,  									 BOOL show_keep_discard, -									 LLViewerInventoryItem* inv_item) : +									 LLPointer<LLViewerInventoryItem> inv_item) :  	LLPreview(name, rect, title, item_id, object_id, TRUE,  			  PREVIEW_MIN_WIDTH,  			  PREVIEW_MIN_HEIGHT, @@ -86,7 +86,7 @@ LLPreviewNotecard::LLPreviewNotecard(const std::string& name,  		if( mAssetID.isNull() )  		{ -			LLInventoryItem* item = getItem(); +			const LLInventoryItem* item = getItem();  			if( item )  			{  				mAssetID = item->getAssetUUID(); @@ -103,7 +103,7 @@ LLPreviewNotecard::LLPreviewNotecard(const std::string& name,  	childSetVisible("lock", FALSE);	 -	LLInventoryItem* item = getItem(); +	const LLInventoryItem* item = getItem();  	childSetCommitCallback("desc", LLPreview::onText, this);  	if (item) @@ -242,7 +242,7 @@ void LLPreviewNotecard::refreshFromInventory()  void LLPreviewNotecard::loadAsset()  {  	// request the asset. -	LLInventoryItem* item = getItem(); +	const LLInventoryItem* item = getItem();  	LLViewerTextEditor* editor = LLViewerUICtrlFactory::getViewerTextEditorByName(this, "Notecard Editor");  	if (!editor) @@ -366,7 +366,7 @@ void LLPreviewNotecard::onLoadComplete(LLVFS *vfs,  			previewEditor->makePristine(); -			LLInventoryItem* item = preview->getItem(); +			const LLInventoryItem* item = preview->getItem();  			BOOL modifiable = item && gAgent.allowOperation(PERM_MODIFY,  								item->getPermissions(), GP_OBJECT_MANIPULATE);  			preview->setEnabled(modifiable); @@ -471,7 +471,7 @@ bool LLPreviewNotecard::saveIfNeeded(LLInventoryItem* copyitem)  		file.setMaxSize(size);  		file.write((U8*)buffer.c_str(), size); -		LLInventoryItem* item = getItem(); +		const LLInventoryItem* item = getItem();  		// save it out to database  		if (item)  		{			 diff --git a/indra/newview/llpreviewnotecard.h b/indra/newview/llpreviewnotecard.h index 908d4da98c..88ce8b36ce 100644 --- a/indra/newview/llpreviewnotecard.h +++ b/indra/newview/llpreviewnotecard.h @@ -30,7 +30,7 @@ public:  					  const LLUUID& object_id = LLUUID::null,  					  const LLUUID& asset_id = LLUUID::null,  					  BOOL show_keep_discard = FALSE, -					  LLViewerInventoryItem* inv_item = NULL); +					  LLPointer<LLViewerInventoryItem> inv_item = NULL);  	// llpreview	  	virtual bool saveItem(LLPointer<LLInventoryItem>* itemptr); diff --git a/indra/newview/llpreviewscript.cpp b/indra/newview/llpreviewscript.cpp index 51ead9c532..07e3853b27 100644 --- a/indra/newview/llpreviewscript.cpp +++ b/indra/newview/llpreviewscript.cpp @@ -1077,7 +1077,7 @@ LLPreviewLSL::LLPreviewLSL(const std::string& name, const LLRect& rect,  	moveResizeHandleToFront(); -	LLInventoryItem* item = getItem();	 +	const LLInventoryItem* item = getItem();	  	childSetCommitCallback("desc", LLPreview::onText, this);  	childSetText("desc", item->getDescription()); @@ -1131,7 +1131,7 @@ void LLPreviewLSL::loadAsset()  	// *HACK: we poke into inventory to see if it's there, and if so,  	// then it might be part of the inventory library. If it's in the  	// library, then you can see the script, but not modify it. -	LLInventoryItem* item = gInventory.getItem(mItemUUID); +	const LLInventoryItem* item = gInventory.getItem(mItemUUID);  	BOOL is_library = item  		&& !gInventory.isObjectDescendentOf(mItemUUID,  											gAgent.getInventoryRootID()); @@ -1258,7 +1258,7 @@ void LLPreviewLSL::saveIfNeeded()  	fclose(fp);  	fp = NULL; -	LLInventoryItem *inv_item = getItem(); +	const LLInventoryItem *inv_item = getItem();  	// save it out to asset server  	std::string url = gAgent.getRegion()->getCapability("UpdateScriptAgentInventory");  	if(inv_item) @@ -1373,8 +1373,8 @@ void LLPreviewLSL::onSaveComplete(const LLUUID& asset_uuid, void* user_data, S32  	{  		if (info)  		{ -			LLViewerInventoryItem* item; -			item = (LLViewerInventoryItem*)gInventory.getItem(info->mItemUUID); +			const LLViewerInventoryItem* item; +			item = (const LLViewerInventoryItem*)gInventory.getItem(info->mItemUUID);  			if(item)  			{  				LLPointer<LLViewerInventoryItem> new_item = new LLViewerInventoryItem(item); diff --git a/indra/newview/llpreviewsound.cpp b/indra/newview/llpreviewsound.cpp index 871a0c55b7..7df0e48762 100644 --- a/indra/newview/llpreviewsound.cpp +++ b/indra/newview/llpreviewsound.cpp @@ -39,7 +39,7 @@ LLPreviewSound::LLPreviewSound(const std::string& name, const LLRect& rect, cons  	button = LLUICtrlFactory::getButtonByName(this, "Sound audition btn");  	button->setSoundFlags(LLView::SILENT); -	LLInventoryItem* item = getItem(); +	const LLInventoryItem* item = getItem();  	childSetCommitCallback("desc", LLPreview::onText, this);  	childSetText("desc", item->getDescription()); @@ -65,7 +65,7 @@ LLPreviewSound::LLPreviewSound(const std::string& name, const LLRect& rect, cons  void LLPreviewSound::playSound( void *userdata )  {  	LLPreviewSound* self = (LLPreviewSound*) userdata; -	LLInventoryItem *item = self->getItem(); +	const LLInventoryItem *item = self->getItem();  	if(item && gAudiop)  	{ @@ -77,7 +77,7 @@ void LLPreviewSound::playSound( void *userdata )  void LLPreviewSound::auditionSound( void *userdata )  {  	LLPreviewSound* self = (LLPreviewSound*) userdata; -	LLInventoryItem *item = self->getItem(); +	const LLInventoryItem *item = self->getItem();  	if(item && gAudiop)  	{ diff --git a/indra/newview/llpreviewtexture.cpp b/indra/newview/llpreviewtexture.cpp index 214b3e38f8..974ee27476 100644 --- a/indra/newview/llpreviewtexture.cpp +++ b/indra/newview/llpreviewtexture.cpp @@ -47,7 +47,7 @@ LLPreviewTexture::LLPreviewTexture(const std::string& name,  	mLastHeight(0),  	mLastWidth(0)  { -	LLInventoryItem *item = getItem(); +	const LLInventoryItem *item = getItem();  	if(item)  	{  		mImageID = item->getAssetUUID(); @@ -157,7 +157,7 @@ void LLPreviewTexture::init()  	if (!mCopyToInv)   	{ -		LLInventoryItem* item = getItem(); +		const LLInventoryItem* item = getItem();  		if (item)  		{ diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index 898af8932f..1565a5875b 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -4538,11 +4538,7 @@ class LLToolsStopAllAnimations : public view_listener_t  		if (!avatarp) return true; -		LLVOAvatar::AnimSourceIterator anim_it = avatarp->mAnimationSources.begin(); -		for (;anim_it != avatarp->mAnimationSources.end(); ++anim_it) -		{ -			avatarp->stopMotion( anim_it->second, TRUE ); -		} +		avatarp->deactivateAllMotions();  		avatarp->processAnimationStateChanges();  		return true; | 
