summaryrefslogtreecommitdiff
path: root/indra/llcharacter
diff options
context:
space:
mode:
authorAdam Moss <moss@lindenlab.com>2009-04-16 23:45:35 +0000
committerAdam Moss <moss@lindenlab.com>2009-04-16 23:45:35 +0000
commitb01c75cb423f07a3d3354f8bd62f265f80062b3b (patch)
treedec1b220c24a60cc220d1cb07fd3545610644f0a /indra/llcharacter
parent868250bdd74f348557102c0d8408d9bec30331f6 (diff)
svn merge -r117314:117337
svn+ssh://svn.lindenlab.com/svn/linden/branches/moss/mv13a-merge-1 QAR-1343 maint-viewer-13a+libcurlexploitfix-3-3 combo merge
Diffstat (limited to 'indra/llcharacter')
-rw-r--r--indra/llcharacter/lleditingmotion.cpp6
-rw-r--r--indra/llcharacter/llkeyframemotion.cpp4
-rw-r--r--indra/llcharacter/llkeyframemotionparam.cpp16
3 files changed, 10 insertions, 16 deletions
diff --git a/indra/llcharacter/lleditingmotion.cpp b/indra/llcharacter/lleditingmotion.cpp
index 913be27ba7..6907df82d4 100644
--- a/indra/llcharacter/lleditingmotion.cpp
+++ b/indra/llcharacter/lleditingmotion.cpp
@@ -190,8 +190,10 @@ BOOL LLEditingMotion::onUpdate(F32 time, U8* joint_mask)
if (!llfinite(focus_pt.magVecSquared()))
{
LLVector3 tmp = mCharacter->getCharacterPosition() ;
- llerrs << "Non finite focus point in editing motion. focus point: " << focus_pt << " and character position: " <<
- tmp << " and pointAtPt: " << *pointAtPt << llendl;
+ LL_WARNS_ONCE("Animation") << "Non finite focus point in editing motion. focus point: " << focus_pt << " and character position: " <<
+ tmp << " and pointAtPt: " << pointAtPt <<
+ " - ignoring anim" << LL_ENDL;
+ return FALSE;
}
// propagate joint positions to kinematic chain
diff --git a/indra/llcharacter/llkeyframemotion.cpp b/indra/llcharacter/llkeyframemotion.cpp
index e1c457b745..19d8386255 100644
--- a/indra/llcharacter/llkeyframemotion.cpp
+++ b/indra/llcharacter/llkeyframemotion.cpp
@@ -468,7 +468,7 @@ LLMotion *LLKeyframeMotion::create(const LLUUID &id)
//-----------------------------------------------------------------------------
LLPointer<LLJointState>& LLKeyframeMotion::getJointState(U32 index)
{
- llassert_always (index < (S32)mJointStates.size());
+ llassert_always (index < mJointStates.size());
return mJointStates[index];
}
@@ -477,7 +477,7 @@ LLPointer<LLJointState>& LLKeyframeMotion::getJointState(U32 index)
//-----------------------------------------------------------------------------
LLJoint* LLKeyframeMotion::getJoint(U32 index)
{
- llassert_always (index < (S32)mJointStates.size());
+ llassert_always (index < mJointStates.size());
LLJoint* joint = mJointStates[index]->getJoint();
llassert_always (joint);
return joint;
diff --git a/indra/llcharacter/llkeyframemotionparam.cpp b/indra/llcharacter/llkeyframemotionparam.cpp
index a9c1f6fc45..622405a5e1 100644
--- a/indra/llcharacter/llkeyframemotionparam.cpp
+++ b/indra/llcharacter/llkeyframemotionparam.cpp
@@ -364,18 +364,13 @@ BOOL LLKeyframeMotionParam::loadMotions()
}
// allocate a text buffer
- char *text = new char[ fileSize+1 ];
- if ( !text )
- {
- llinfos << "ERROR: can't allocated keyframe text buffer." << llendl;
- return FALSE;
- }
+ std::vector<char> text(fileSize+1);
//-------------------------------------------------------------------------
// load data from file into buffer
//-------------------------------------------------------------------------
bool error = false;
- char *p = text;
+ char *p = &text[0];
while ( 1 )
{
if (apr_file_eof(fp) == APR_EOF)
@@ -399,12 +394,11 @@ BOOL LLKeyframeMotionParam::loadMotions()
//-------------------------------------------------------------------------
// check for error
//-------------------------------------------------------------------------
- llassert( p <= (text+fileSize) );
+ llassert( p <= (&text[0] + fileSize) );
if ( error )
{
llinfos << "ERROR: error while reading from " << path << llendl;
- delete [] text;
return FALSE;
}
@@ -413,7 +407,7 @@ BOOL LLKeyframeMotionParam::loadMotions()
//-------------------------------------------------------------------------
// parse the text and build keyframe data structures
//-------------------------------------------------------------------------
- p = text;
+ p = &text[0];
S32 num;
char strA[80]; /* Flawfinder: ignore */
char strB[80]; /* Flawfinder: ignore */
@@ -432,7 +426,6 @@ BOOL LLKeyframeMotionParam::loadMotions()
if ((num != 3))
{
llinfos << "WARNING: can't read parametric motion" << llendl;
- delete [] text;
return FALSE;
}
@@ -453,7 +446,6 @@ BOOL LLKeyframeMotionParam::loadMotions()
num = sscanf(p, "%79s %79s %f", strA, strB, &floatA); /* Flawfinder: ignore */
}
- delete [] text;
return TRUE;
}