summaryrefslogtreecommitdiff
path: root/indra/llcharacter
diff options
context:
space:
mode:
authorChristian Goetze <cg@lindenlab.com>2007-08-21 22:17:53 +0000
committerChristian Goetze <cg@lindenlab.com>2007-08-21 22:17:53 +0000
commitce0a5fe14590b8d675b885fccd5f79d7ea17a302 (patch)
tree3388e6f8ff02292ec4521d278c841801462945b8 /indra/llcharacter
parentb699ae454d8477d19342d320758cd993d1d28cec (diff)
EFFECTIVE MERGE: svn merge -r 66133:68118 svn+ssh://svn/svn/linden/branches/maintenance into release
Actual action: branched maintenance-r68118, merged in release, then copied result into release
Diffstat (limited to 'indra/llcharacter')
-rw-r--r--indra/llcharacter/llkeyframemotion.cpp27
-rw-r--r--indra/llcharacter/llkeyframemotion.h16
-rw-r--r--indra/llcharacter/llmultigesture.cpp2
3 files changed, 24 insertions, 21 deletions
diff --git a/indra/llcharacter/llkeyframemotion.cpp b/indra/llcharacter/llkeyframemotion.cpp
index 16a0e71f04..d8a4acecc1 100644
--- a/indra/llcharacter/llkeyframemotion.cpp
+++ b/indra/llcharacter/llkeyframemotion.cpp
@@ -405,15 +405,17 @@ void LLKeyframeMotion::JointMotion::update(LLJointState* joint_state, F32 time,
// LLKeyframeMotion()
// Class Constructor
//-----------------------------------------------------------------------------
-LLKeyframeMotion::LLKeyframeMotion( const LLUUID &id) : LLMotion(id)
+LLKeyframeMotion::LLKeyframeMotion(const LLUUID &id)
+ : LLMotion(id),
+ mJointMotionList(NULL),
+ mJointStates(NULL),
+ mPelvisp(NULL),
+ mLastSkeletonSerialNum(0),
+ mLastUpdateTime(0.f),
+ mLastLoopedTime(0.f),
+ mAssetStatus(ASSET_UNDEFINED)
{
- mJointMotionList = NULL;
- mJointStates = NULL;
- mLastSkeletonSerialNum = 0;
- mLastLoopedTime = 0.f;
- mLastUpdateTime = 0.f;
- mAssetStatus = ASSET_UNDEFINED;
- mPelvisp = NULL;
+
}
@@ -1718,7 +1720,7 @@ BOOL LLKeyframeMotion::serialize(LLDataPacker& dp) const
}
success &= dp.packS32(mJointMotionList->mConstraints.size(), "num_constraints");
- for (JointMotionList::constraint_list_t::iterator iter = mJointMotionList->mConstraints.begin();
+ for (JointMotionList::constraint_list_t::const_iterator iter = mJointMotionList->mConstraints.begin();
iter != mJointMotionList->mConstraints.end(); ++iter)
{
JointConstraintSharedData* shared_constraintp = *iter;
@@ -1836,8 +1838,7 @@ void LLKeyframeMotion::setEaseOut(F32 ease_in)
//-----------------------------------------------------------------------------
void LLKeyframeMotion::flushKeyframeCache()
{
- // TODO: Make this safe to do
-// LLKeyframeDataCache::clear();
+ LLKeyframeDataCache::clear();
}
//-----------------------------------------------------------------------------
@@ -1913,7 +1914,7 @@ void LLKeyframeMotion::setLoopOut(F32 out_point)
void LLKeyframeMotion::onLoadComplete(LLVFS *vfs,
const LLUUID& asset_uuid,
LLAssetType::EType type,
- void* user_data, S32 status)
+ void* user_data, S32 status, LLExtStat ext_status)
{
LLUUID* id = (LLUUID*)user_data;
@@ -2091,7 +2092,6 @@ void LLKeyframeDataCache::removeKeyframeData(const LLUUID& id)
keyframe_data_map_t::iterator found_data = sKeyframeDataMap.find(id);
if (found_data != sKeyframeDataMap.end())
{
- delete found_data->second;
sKeyframeDataMap.erase(found_data);
}
}
@@ -2122,7 +2122,6 @@ LLKeyframeDataCache::~LLKeyframeDataCache()
//-----------------------------------------------------------------------------
void LLKeyframeDataCache::clear()
{
- for_each(sKeyframeDataMap.begin(), sKeyframeDataMap.end(), DeletePairedPointer());
sKeyframeDataMap.clear();
}
diff --git a/indra/llcharacter/llkeyframemotion.h b/indra/llcharacter/llkeyframemotion.h
index 9b8c04ac92..5a03f7549a 100644
--- a/indra/llcharacter/llkeyframemotion.h
+++ b/indra/llcharacter/llkeyframemotion.h
@@ -20,6 +20,7 @@
#include "llhandmotion.h"
#include "lljointstate.h"
#include "llmotion.h"
+#include "llmemory.h"
#include "llptrskipmap.h"
#include "llquaternion.h"
#include "v3dmath.h"
@@ -124,14 +125,14 @@ public:
static void onLoadComplete(LLVFS *vfs,
const LLUUID& asset_uuid,
LLAssetType::EType type,
- void* user_data, S32 status);
+ void* user_data, S32 status, LLExtStat ext_status);
public:
U32 getFileSize();
BOOL serialize(LLDataPacker& dp) const;
BOOL deserialize(LLDataPacker& dp);
void writeCAL3D(apr_file_t* fp);
- BOOL isLoaded() { return mJointMotionList != NULL; }
+ BOOL isLoaded() { return mJointMotionList.notNull(); }
// setters for modifying a keyframe animation
@@ -371,8 +372,11 @@ public:
//-------------------------------------------------------------------------
// JointMotionList
//-------------------------------------------------------------------------
- class JointMotionList
+ class JointMotionList : public LLRefCount
{
+ protected:
+ ~JointMotionList();
+
public:
U32 mNumJointMotions;
JointMotion* mJointMotionArray;
@@ -390,7 +394,6 @@ public:
LLBBoxLocal mPelvisBBox;
public:
JointMotionList();
- ~JointMotionList();
U32 dumpDiagInfo();
};
@@ -401,7 +404,7 @@ protected:
//-------------------------------------------------------------------------
// Member Data
//-------------------------------------------------------------------------
- JointMotionList* mJointMotionList;
+ LLPointer<JointMotionList> mJointMotionList;
LLJointState* mJointStates;
LLJoint* mPelvisp;
LLCharacter* mCharacter;
@@ -421,7 +424,7 @@ public:
LLKeyframeDataCache(){};
~LLKeyframeDataCache();
- typedef std::map<LLUUID, class LLKeyframeMotion::JointMotionList*> keyframe_data_map_t;
+ typedef std::map<LLUUID, LLPointer<class LLKeyframeMotion::JointMotionList> > keyframe_data_map_t;
static keyframe_data_map_t sKeyframeDataMap;
static void addKeyframeData(const LLUUID& id, LLKeyframeMotion::JointMotionList*);
@@ -436,3 +439,4 @@ public:
#endif // LL_LLKEYFRAMEMOTION_H
+
diff --git a/indra/llcharacter/llmultigesture.cpp b/indra/llcharacter/llmultigesture.cpp
index 34064b758e..c86f32fd9b 100644
--- a/indra/llcharacter/llmultigesture.cpp
+++ b/indra/llcharacter/llmultigesture.cpp
@@ -258,7 +258,7 @@ BOOL LLGestureStepAnimation::deserialize(LLDataPacker& dp)
// Apparently an earlier version of the gesture code added \r to the end
// of the animation names. Get rid of it. JC
- if (mAnimName[mAnimName.length() - 1] == '\r')
+ if (!mAnimName.empty() && mAnimName[mAnimName.length() - 1] == '\r')
{
// chop the last character
mAnimName.resize(mAnimName.length() - 1);