summaryrefslogtreecommitdiff
path: root/indra/llcharacter
diff options
context:
space:
mode:
authorSteven Bennetts <steve@lindenlab.com>2009-05-08 07:43:08 +0000
committerSteven Bennetts <steve@lindenlab.com>2009-05-08 07:43:08 +0000
commita4000c3744e42fcbb638e742f3b63fa31a0dee15 (patch)
tree7f472c30e65bbfa04ee9bc06631a1af305cc31fb /indra/llcharacter
parent6c4cadbb04d633ad7b762058bdeba6e1f650dafd (diff)
merge trunk@116587 skinning-7@119389 -> viewer-2.0.0-skinning-7
Diffstat (limited to 'indra/llcharacter')
-rw-r--r--indra/llcharacter/llbvhloader.cpp161
-rw-r--r--indra/llcharacter/llbvhloader.h51
-rw-r--r--indra/llcharacter/llcharacter.h2
-rw-r--r--indra/llcharacter/lljointstate.h2
-rw-r--r--indra/llcharacter/llkeyframemotionparam.cpp7
-rw-r--r--indra/llcharacter/llmultigesture.cpp64
-rw-r--r--indra/llcharacter/llmultigesture.h10
-rw-r--r--indra/llcharacter/llpose.h6
8 files changed, 203 insertions, 100 deletions
diff --git a/indra/llcharacter/llbvhloader.cpp b/indra/llcharacter/llbvhloader.cpp
index e1f8ce53fb..24391eb8f3 100644
--- a/indra/llcharacter/llbvhloader.cpp
+++ b/indra/llcharacter/llbvhloader.cpp
@@ -56,7 +56,7 @@ const F32 ROTATION_MOTION_THRESHOLD = 0.001f;
char gInFile[1024]; /* Flawfinder: ignore */
char gOutFile[1024]; /* Flawfinder: ignore */
-
+/*
//------------------------------------------------------------------------
// Status Codes
//------------------------------------------------------------------------
@@ -91,7 +91,7 @@ const char *LLBVHLoader::ST_NO_XLT_EASEIN = "Can't get easeIn values.";
const char *LLBVHLoader::ST_NO_XLT_EASEOUT = "Can't get easeOut values.";
const char *LLBVHLoader::ST_NO_XLT_HAND = "Can't get hand morph value.";
const char *LLBVHLoader::ST_NO_XLT_EMOTE = "Can't read emote name.";
-
+*/
//------------------------------------------------------------------------
// find_next_whitespace()
//------------------------------------------------------------------------
@@ -124,7 +124,9 @@ LLQuaternion::Order bvhStringToOrder( char *str )
//-----------------------------------------------------------------------------
// LLBVHLoader()
//-----------------------------------------------------------------------------
-LLBVHLoader::LLBVHLoader(const char* buffer)
+
+/*
+ LLBVHLoader::LLBVHLoader(const char* buffer)
{
reset();
@@ -144,7 +146,7 @@ LLBVHLoader::LLBVHLoader(const char* buffer)
}
}
- char error_text[128]; /* Flawfinder: ignore */
+ char error_text[128]; // Flawfinder: ignore
S32 error_line;
mStatus = loadBVHFile(buffer, error_text, error_line);
if (mStatus != LLBVHLoader::ST_OK)
@@ -158,6 +160,49 @@ LLBVHLoader::LLBVHLoader(const char* buffer)
mInitialized = TRUE;
}
+*/
+LLBVHLoader::LLBVHLoader(const char* buffer, ELoadStatus &loadStatus, S32 &errorLine)
+{
+ reset();
+ errorLine = 0;
+ mStatus = loadTranslationTable("anim.ini");
+ loadStatus = mStatus;
+ llinfos<<"Load Status 00 : "<< loadStatus << llendl;
+ if (mStatus == E_ST_NO_XLT_FILE)
+ {
+ //llwarns << "NOTE: No translation table found." << llendl;
+ loadStatus = mStatus;
+ return;
+ }
+ else
+ {
+ if (mStatus != E_ST_OK)
+ {
+ //llwarns << "ERROR: [line: " << getLineNumber() << "] " << mStatus << llendl;
+ errorLine = getLineNumber();
+ loadStatus = mStatus;
+ return;
+ }
+ }
+
+ char error_text[128]; /* Flawfinder: ignore */
+ S32 error_line;
+ mStatus = loadBVHFile(buffer, error_text, error_line);
+
+ if (mStatus != E_ST_OK)
+ {
+ //llwarns << "ERROR: [line: " << getLineNumber() << "] " << mStatus << llendl;
+ loadStatus = mStatus;
+ errorLine = getLineNumber();
+ return;
+ }
+
+ applyTranslations();
+ optimize();
+
+ mInitialized = TRUE;
+}
+
LLBVHLoader::~LLBVHLoader()
{
@@ -167,7 +212,7 @@ LLBVHLoader::~LLBVHLoader()
//------------------------------------------------------------------------
// LLBVHLoader::loadTranslationTable()
//------------------------------------------------------------------------
-LLBVHLoader::Status LLBVHLoader::loadTranslationTable(const char *fileName)
+ELoadStatus LLBVHLoader::loadTranslationTable(const char *fileName)
{
mLineNumber = 0;
mTranslations.clear();
@@ -182,7 +227,7 @@ LLBVHLoader::Status LLBVHLoader::loadTranslationTable(const char *fileName)
infile.open(path, LL_APR_R);
apr_file_t *fp = infile.getFileHandle();
if (!fp)
- return ST_NO_XLT_FILE;
+ return E_ST_NO_XLT_FILE;
llinfos << "NOTE: Loading translation table: " << fileName << llendl;
@@ -194,9 +239,9 @@ LLBVHLoader::Status LLBVHLoader::loadTranslationTable(const char *fileName)
// load header
//--------------------------------------------------------------------
if ( ! getLine(fp) )
- return ST_EOF;
+ return E_ST_EOF;
if ( strncmp(mLine, "Translations 1.0", 16) )
- return ST_NO_XLT_HEADER;
+ return E_ST_NO_XLT_HEADER;
//--------------------------------------------------------------------
// load data one line at a time
@@ -222,7 +267,7 @@ LLBVHLoader::Status LLBVHLoader::loadTranslationTable(const char *fileName)
{
char name[128]; /* Flawfinder: ignore */
if ( sscanf(mLine, " [%127[^]]", name) != 1 )
- return ST_NO_XLT_NAME;
+ return E_ST_NO_XLT_NAME;
if (strcmp(name, "GLOBALS")==0)
{
@@ -245,7 +290,7 @@ LLBVHLoader::Status LLBVHLoader::loadTranslationTable(const char *fileName)
{
char emote_str[1024]; /* Flawfinder: ignore */
if ( sscanf(mLine, " %*s = %1023s", emote_str) != 1 ) /* Flawfinder: ignore */
- return ST_NO_XLT_EMOTE;
+ return E_ST_NO_XLT_EMOTE;
mEmoteName.assign( emote_str );
// llinfos << "NOTE: Emote: " << mEmoteName.c_str() << llendl;
@@ -260,7 +305,7 @@ LLBVHLoader::Status LLBVHLoader::loadTranslationTable(const char *fileName)
{
S32 priority;
if ( sscanf(mLine, " %*s = %d", &priority) != 1 )
- return ST_NO_XLT_PRIORITY;
+ return E_ST_NO_XLT_PRIORITY;
mPriority = priority;
// llinfos << "NOTE: Priority: " << mPriority << llendl;
@@ -288,7 +333,7 @@ LLBVHLoader::Status LLBVHLoader::loadTranslationTable(const char *fileName)
}
else
{
- return ST_NO_XLT_LOOP;
+ return E_ST_NO_XLT_LOOP;
}
mLoopInPoint = loop_in * mDuration;
@@ -305,7 +350,7 @@ LLBVHLoader::Status LLBVHLoader::loadTranslationTable(const char *fileName)
F32 duration;
char type[128]; /* Flawfinder: ignore */
if ( sscanf(mLine, " %*s = %f %127s", &duration, type) != 2 ) /* Flawfinder: ignore */
- return ST_NO_XLT_EASEIN;
+ return E_ST_NO_XLT_EASEIN;
mEaseIn = duration;
continue;
@@ -319,7 +364,7 @@ LLBVHLoader::Status LLBVHLoader::loadTranslationTable(const char *fileName)
F32 duration;
char type[128]; /* Flawfinder: ignore */
if ( sscanf(mLine, " %*s = %f %127s", &duration, type) != 2 ) /* Flawfinder: ignore */
- return ST_NO_XLT_EASEOUT;
+ return E_ST_NO_XLT_EASEOUT;
mEaseOut = duration;
continue;
@@ -332,7 +377,7 @@ LLBVHLoader::Status LLBVHLoader::loadTranslationTable(const char *fileName)
{
S32 handMorph;
if (sscanf(mLine, " %*s = %d", &handMorph) != 1)
- return ST_NO_XLT_HAND;
+ return E_ST_NO_XLT_HAND;
mHand = handMorph;
continue;
@@ -380,7 +425,7 @@ LLBVHLoader::Status LLBVHLoader::loadTranslationTable(const char *fileName)
&constraint.mTargetOffset.mV[VY],
&constraint.mTargetOffset.mV[VZ]) != 13)
{
- return ST_NO_CONSTRAINT;
+ return E_ST_NO_CONSTRAINT;
}
}
else
@@ -440,7 +485,7 @@ LLBVHLoader::Status LLBVHLoader::loadTranslationTable(const char *fileName)
&constraint.mTargetOffset.mV[VY],
&constraint.mTargetOffset.mV[VZ]) != 13)
{
- return ST_NO_CONSTRAINT;
+ return E_ST_NO_CONSTRAINT;
}
}
else
@@ -463,7 +508,7 @@ LLBVHLoader::Status LLBVHLoader::loadTranslationTable(const char *fileName)
// at this point there must be a valid trans pointer
//----------------------------------------------------------------
if ( ! trans )
- return ST_NO_XLT_NAME;
+ return E_ST_NO_XLT_NAME;
//----------------------------------------------------------------
// check for ignore flag
@@ -472,7 +517,7 @@ LLBVHLoader::Status LLBVHLoader::loadTranslationTable(const char *fileName)
{
char trueFalse[128]; /* Flawfinder: ignore */
if ( sscanf(mLine, " %*s = %127s", trueFalse) != 1 ) /* Flawfinder: ignore */
- return ST_NO_XLT_IGNORE;
+ return E_ST_NO_XLT_IGNORE;
trans->mIgnore = (LLStringUtil::compareInsensitive(trueFalse, "true")==0);
continue;
@@ -497,12 +542,12 @@ LLBVHLoader::Status LLBVHLoader::loadTranslationTable(const char *fileName)
}
else
{
- return ST_NO_XLT_RELATIVE;
+ return E_ST_NO_XLT_RELATIVE;
}
}
else
{
- return ST_NO_XLT_RELATIVE;
+ return E_ST_NO_XLT_RELATIVE;
}
continue;
@@ -523,12 +568,12 @@ LLBVHLoader::Status LLBVHLoader::loadTranslationTable(const char *fileName)
}
else
{
- return ST_NO_XLT_RELATIVE;
+ return E_ST_NO_XLT_RELATIVE;
}
}
else
{
- return ST_NO_XLT_RELATIVE;
+ return E_ST_NO_XLT_RELATIVE;
}
continue;
@@ -541,7 +586,7 @@ LLBVHLoader::Status LLBVHLoader::loadTranslationTable(const char *fileName)
{
char outName[128]; /* Flawfinder: ignore */
if ( sscanf(mLine, " %*s = %127s", outName) != 1 ) /* Flawfinder: ignore */
- return ST_NO_XLT_OUTNAME;
+ return E_ST_NO_XLT_OUTNAME;
trans->mOutName = outName;
continue;
@@ -557,7 +602,7 @@ LLBVHLoader::Status LLBVHLoader::loadTranslationTable(const char *fileName)
&fm.mMatrix[0][0], &fm.mMatrix[0][1], &fm.mMatrix[0][2],
&fm.mMatrix[1][0], &fm.mMatrix[1][1], &fm.mMatrix[1][2],
&fm.mMatrix[2][0], &fm.mMatrix[2][1], &fm.mMatrix[2][2] ) != 9 )
- return ST_NO_XLT_MATRIX;
+ return E_ST_NO_XLT_MATRIX;
trans->mFrameMatrix = fm;
continue;
@@ -573,7 +618,7 @@ LLBVHLoader::Status LLBVHLoader::loadTranslationTable(const char *fileName)
&om.mMatrix[0][0], &om.mMatrix[0][1], &om.mMatrix[0][2],
&om.mMatrix[1][0], &om.mMatrix[1][1], &om.mMatrix[1][2],
&om.mMatrix[2][0], &om.mMatrix[2][1], &om.mMatrix[2][2] ) != 9 )
- return ST_NO_XLT_MATRIX;
+ return E_ST_NO_XLT_MATRIX;
trans->mOffsetMatrix = om;
continue;
@@ -586,7 +631,7 @@ LLBVHLoader::Status LLBVHLoader::loadTranslationTable(const char *fileName)
{
char mergeParentName[128]; /* Flawfinder: ignore */
if ( sscanf(mLine, " %*s = %127s", mergeParentName) != 1 ) /* Flawfinder: ignore */
- return ST_NO_XLT_MERGEPARENT;
+ return E_ST_NO_XLT_MERGEPARENT;
trans->mMergeParentName = mergeParentName;
continue;
@@ -599,7 +644,7 @@ LLBVHLoader::Status LLBVHLoader::loadTranslationTable(const char *fileName)
{
char mergeChildName[128]; /* Flawfinder: ignore */
if ( sscanf(mLine, " %*s = %127s", mergeChildName) != 1 ) /* Flawfinder: ignore */
- return ST_NO_XLT_MERGECHILD;
+ return E_ST_NO_XLT_MERGECHILD;
trans->mMergeChildName = mergeChildName;
continue;
@@ -612,7 +657,7 @@ LLBVHLoader::Status LLBVHLoader::loadTranslationTable(const char *fileName)
{
S32 priority;
if ( sscanf(mLine, " %*s = %d", &priority) != 1 )
- return ST_NO_XLT_PRIORITY;
+ return E_ST_NO_XLT_PRIORITY;
trans->mPriorityModifier = priority;
continue;
@@ -621,14 +666,14 @@ LLBVHLoader::Status LLBVHLoader::loadTranslationTable(const char *fileName)
}
infile.close() ;
- return ST_OK;
+ return E_ST_OK;
}
//------------------------------------------------------------------------
// LLBVHLoader::loadBVHFile()
//------------------------------------------------------------------------
-LLBVHLoader::Status LLBVHLoader::loadBVHFile(const char *buffer, char* error_text, S32 &err_line)
+ELoadStatus LLBVHLoader::loadBVHFile(const char *buffer, char* error_text, S32 &err_line)
{
std::string line;
@@ -650,14 +695,14 @@ LLBVHLoader::Status LLBVHLoader::loadBVHFile(const char *buffer, char* error_tex
// consume hierarchy
//--------------------------------------------------------------------
if (iter == tokens.end())
- return ST_EOF;
+ return E_ST_EOF;
line = (*(iter++));
err_line++;
if ( !strstr(line.c_str(), "HIERARCHY") )
{
// llinfos << line << llendl;
- return ST_NO_HIER;
+ return E_ST_NO_HIER;
}
//--------------------------------------------------------------------
@@ -669,7 +714,7 @@ LLBVHLoader::Status LLBVHLoader::loadBVHFile(const char *buffer, char* error_tex
// get next line
//----------------------------------------------------------------
if (iter == tokens.end())
- return ST_EOF;
+ return E_ST_EOF;
line = (*(iter++));
err_line++;
@@ -719,7 +764,7 @@ LLBVHLoader::Status LLBVHLoader::loadBVHFile(const char *buffer, char* error_tex
else
{
strncpy(error_text, line.c_str(), 127); /* Flawfinder: ignore */
- return ST_NO_JOINT;
+ return E_ST_NO_JOINT;
}
//----------------------------------------------------------------
@@ -729,7 +774,7 @@ LLBVHLoader::Status LLBVHLoader::loadBVHFile(const char *buffer, char* error_tex
if ( sscanf(line.c_str(), "%*s %79s", jointName) != 1 ) /* Flawfinder: ignore */
{
strncpy(error_text, line.c_str(), 127); /* Flawfinder: ignore */
- return ST_NO_NAME;
+ return E_ST_NO_NAME;
}
//----------------------------------------------------------------
@@ -754,7 +799,7 @@ LLBVHLoader::Status LLBVHLoader::loadBVHFile(const char *buffer, char* error_tex
//----------------------------------------------------------------
if (iter == tokens.end())
{
- return ST_EOF;
+ return E_ST_EOF;
}
line = (*(iter++));
err_line++;
@@ -765,7 +810,7 @@ LLBVHLoader::Status LLBVHLoader::loadBVHFile(const char *buffer, char* error_tex
if ( !strstr(line.c_str(), "{") )
{
strncpy(error_text, line.c_str(), 127); /*Flawfinder: ignore*/
- return ST_NO_OFFSET;
+ return E_ST_NO_OFFSET;
}
else
{
@@ -777,7 +822,7 @@ LLBVHLoader::Status LLBVHLoader::loadBVHFile(const char *buffer, char* error_tex
//----------------------------------------------------------------
if (iter == tokens.end())
{
- return ST_EOF;
+ return E_ST_EOF;
}
line = (*(iter++));
err_line++;
@@ -788,7 +833,7 @@ LLBVHLoader::Status LLBVHLoader::loadBVHFile(const char *buffer, char* error_tex
if ( !strstr(line.c_str(), "OFFSET") )
{
strncpy(error_text, line.c_str(), 127); /*Flawfinder: ignore*/
- return ST_NO_OFFSET;
+ return E_ST_NO_OFFSET;
}
//----------------------------------------------------------------
@@ -796,7 +841,7 @@ LLBVHLoader::Status LLBVHLoader::loadBVHFile(const char *buffer, char* error_tex
//----------------------------------------------------------------
if (iter == tokens.end())
{
- return ST_EOF;
+ return E_ST_EOF;
}
line = (*(iter++));
err_line++;
@@ -807,7 +852,7 @@ LLBVHLoader::Status LLBVHLoader::loadBVHFile(const char *buffer, char* error_tex
if ( !strstr(line.c_str(), "CHANNELS") )
{
strncpy(error_text, line.c_str(), 127); /*Flawfinder: ignore*/
- return ST_NO_CHANNELS;
+ return E_ST_NO_CHANNELS;
}
//----------------------------------------------------------------
@@ -820,14 +865,14 @@ LLBVHLoader::Status LLBVHLoader::loadBVHFile(const char *buffer, char* error_tex
if (!p)
{
strncpy(error_text, line.c_str(), 127); /*Flawfinder: ignore*/
- return ST_NO_ROTATION;
+ return E_ST_NO_ROTATION;
}
const char axis = *(p - 1);
if ((axis != 'X') && (axis != 'Y') && (axis != 'Z'))
{
strncpy(error_text, line.c_str(), 127); /*Flawfinder: ignore*/
- return ST_NO_AXIS;
+ return E_ST_NO_AXIS;
}
joint->mOrder[i] = axis;
@@ -842,7 +887,7 @@ LLBVHLoader::Status LLBVHLoader::loadBVHFile(const char *buffer, char* error_tex
if ( !strstr(line.c_str(), "MOTION") )
{
strncpy(error_text, line.c_str(), 127); /*Flawfinder: ignore*/
- return ST_NO_MOTION;
+ return E_ST_NO_MOTION;
}
//--------------------------------------------------------------------
@@ -850,7 +895,7 @@ LLBVHLoader::Status LLBVHLoader::loadBVHFile(const char *buffer, char* error_tex
//--------------------------------------------------------------------
if (iter == tokens.end())
{
- return ST_EOF;
+ return E_ST_EOF;
}
line = (*(iter++));
err_line++;
@@ -858,13 +903,13 @@ LLBVHLoader::Status LLBVHLoader::loadBVHFile(const char *buffer, char* error_tex
if ( !strstr(line.c_str(), "Frames:") )
{
strncpy(error_text, line.c_str(), 127); /*Flawfinder: ignore*/
- return ST_NO_FRAMES;
+ return E_ST_NO_FRAMES;
}
if ( sscanf(line.c_str(), "Frames: %d", &mNumFrames) != 1 )
{
strncpy(error_text, line.c_str(), 127); /*Flawfinder: ignore*/
- return ST_NO_FRAMES;
+ return E_ST_NO_FRAMES;
}
//--------------------------------------------------------------------
@@ -872,7 +917,7 @@ LLBVHLoader::Status LLBVHLoader::loadBVHFile(const char *buffer, char* error_tex
//--------------------------------------------------------------------
if (iter == tokens.end())
{
- return ST_EOF;
+ return E_ST_EOF;
}
line = (*(iter++));
err_line++;
@@ -880,13 +925,13 @@ LLBVHLoader::Status LLBVHLoader::loadBVHFile(const char *buffer, char* error_tex
if ( !strstr(line.c_str(), "Frame Time:") )
{
strncpy(error_text, line.c_str(), 127); /*Flawfinder: ignore*/
- return ST_NO_FRAME_TIME;
+ return E_ST_NO_FRAME_TIME;
}
if ( sscanf(line.c_str(), "Frame Time: %f", &mFrameTime) != 1 )
{
strncpy(error_text, line.c_str(), 127); /*Flawfinder: ignore*/
- return ST_NO_FRAME_TIME;
+ return E_ST_NO_FRAME_TIME;
}
mDuration = (F32)mNumFrames * mFrameTime;
@@ -903,7 +948,7 @@ LLBVHLoader::Status LLBVHLoader::loadBVHFile(const char *buffer, char* error_tex
// get next line
if (iter == tokens.end())
{
- return ST_EOF;
+ return E_ST_EOF;
}
line = (*(iter++));
err_line++;
@@ -922,7 +967,7 @@ LLBVHLoader::Status LLBVHLoader::loadBVHFile(const char *buffer, char* error_tex
if ( sscanf(p, "%f %f %f", key.mPos, key.mPos+1, key.mPos+2) != 3 )
{
strncpy(error_text, line.c_str(), 127); /*Flawfinder: ignore*/
- return ST_NO_POS;
+ return E_ST_NO_POS;
}
}
@@ -931,19 +976,19 @@ LLBVHLoader::Status LLBVHLoader::loadBVHFile(const char *buffer, char* error_tex
if (!p)
{
strncpy(error_text, line.c_str(), 127); /*Flawfinder: ignore*/
- return ST_NO_ROT;
+ return E_ST_NO_ROT;
}
p = find_next_whitespace(++p);
if (!p)
{
strncpy(error_text, line.c_str(), 127); /*Flawfinder: ignore*/
- return ST_NO_ROT;
+ return E_ST_NO_ROT;
}
p = find_next_whitespace(++p);
if (!p)
{
strncpy(error_text, line.c_str(), 127); /*Flawfinder: ignore*/
- return ST_NO_ROT;
+ return E_ST_NO_ROT;
}
// get 3 rot values for joint
@@ -951,7 +996,7 @@ LLBVHLoader::Status LLBVHLoader::loadBVHFile(const char *buffer, char* error_tex
if ( sscanf(p, " %f %f %f", rot, rot+1, rot+2) != 3 )
{
strncpy(error_text, line.c_str(), 127); /*Flawfinder: ignore*/
- return ST_NO_ROT;
+ return E_ST_NO_ROT;
}
p++;
@@ -962,7 +1007,7 @@ LLBVHLoader::Status LLBVHLoader::loadBVHFile(const char *buffer, char* error_tex
}
}
- return ST_OK;
+ return E_ST_OK;
}
diff --git a/indra/llcharacter/llbvhloader.h b/indra/llcharacter/llbvhloader.h
index 6937b9d835..ecdfc95478 100644
--- a/indra/llcharacter/llbvhloader.h
+++ b/indra/llcharacter/llbvhloader.h
@@ -184,6 +184,41 @@ public:
S32 mPriorityModifier;
};
+typedef enum e_load_status
+ {
+ E_ST_OK,
+ E_ST_EOF,
+ E_ST_NO_CONSTRAINT,
+ E_ST_NO_FILE,
+ E_ST_NO_HIER,
+ E_ST_NO_JOINT,
+ E_ST_NO_NAME,
+ E_ST_NO_OFFSET,
+ E_ST_NO_CHANNELS,
+ E_ST_NO_ROTATION,
+ E_ST_NO_AXIS,
+ E_ST_NO_MOTION,
+ E_ST_NO_FRAMES,
+ E_ST_NO_FRAME_TIME,
+ E_ST_NO_POS,
+ E_ST_NO_ROT,
+ E_ST_NO_XLT_FILE,
+ E_ST_NO_XLT_HEADER,
+ E_ST_NO_XLT_NAME,
+ E_ST_NO_XLT_IGNORE,
+ E_ST_NO_XLT_RELATIVE,
+ E_ST_NO_XLT_OUTNAME,
+ E_ST_NO_XLT_MATRIX,
+ E_ST_NO_XLT_MERGECHILD,
+ E_ST_NO_XLT_MERGEPARENT,
+ E_ST_NO_XLT_PRIORITY,
+ E_ST_NO_XLT_LOOP,
+ E_ST_NO_XLT_EASEIN,
+ E_ST_NO_XLT_EASEOUT,
+ E_ST_NO_XLT_HAND,
+ E_ST_NO_XLT_EMOTE
+ } ELoadStatus;
+
//------------------------------------------------------------------------
// TranslationMap
//------------------------------------------------------------------------
@@ -194,9 +229,11 @@ class LLBVHLoader
friend class LLKeyframeMotion;
public:
// Constructor
- LLBVHLoader(const char* buffer);
+// LLBVHLoader(const char* buffer);
+ LLBVHLoader(const char* buffer, ELoadStatus &loadStatus, S32 &errorLine);
~LLBVHLoader();
-
+
+/*
// Status Codes
typedef const char *Status;
static const char *ST_OK;
@@ -230,13 +267,13 @@ public:
static const char *ST_NO_XLT_EASEOUT;
static const char *ST_NO_XLT_HAND;
static const char *ST_NO_XLT_EMOTE;
-
+*/
// Loads the specified translation table.
- Status loadTranslationTable(const char *fileName);
+ ELoadStatus loadTranslationTable(const char *fileName);
// Load the specified BVH file.
// Returns status code.
- Status loadBVHFile(const char *buffer, char *error_text, S32 &error_line);
+ ELoadStatus loadBVHFile(const char *buffer, char *error_text, S32 &error_line);
// Applies translations to BVH data loaded.
void applyTranslations();
@@ -260,7 +297,7 @@ public:
BOOL isInitialized() { return mInitialized; }
- Status getStatus() { return mStatus; }
+ ELoadStatus getStatus() { return mStatus; }
protected:
// Consumes one line of input from file.
@@ -287,7 +324,7 @@ protected:
std::string mEmoteName;
BOOL mInitialized;
- Status mStatus;
+ ELoadStatus mStatus;
// computed values
F32 mDuration;
};
diff --git a/indra/llcharacter/llcharacter.h b/indra/llcharacter/llcharacter.h
index 0112788884..66c4c188ed 100644
--- a/indra/llcharacter/llcharacter.h
+++ b/indra/llcharacter/llcharacter.h
@@ -42,7 +42,7 @@
#include "llmotioncontroller.h"
#include "llvisualparam.h"
#include "string_table.h"
-#include "llmemory.h"
+#include "llpointer.h"
#include "llthread.h"
class LLPolyMesh;
diff --git a/indra/llcharacter/lljointstate.h b/indra/llcharacter/lljointstate.h
index 16ad0e1200..e40cf2673f 100644
--- a/indra/llcharacter/lljointstate.h
+++ b/indra/llcharacter/lljointstate.h
@@ -37,7 +37,7 @@
// Header Files
//-----------------------------------------------------------------------------
#include "lljoint.h"
-#include "llmemory.h"
+#include "llrefcount.h"
//-----------------------------------------------------------------------------
// class LLJointState
diff --git a/indra/llcharacter/llkeyframemotionparam.cpp b/indra/llcharacter/llkeyframemotionparam.cpp
index 622405a5e1..c4333fc0fd 100644
--- a/indra/llcharacter/llkeyframemotionparam.cpp
+++ b/indra/llcharacter/llkeyframemotionparam.cpp
@@ -347,8 +347,11 @@ BOOL LLKeyframeMotionParam::loadMotions()
// Load named file by concatenating the character prefix with the motion name.
// Load data into a buffer to be parsed.
//-------------------------------------------------------------------------
- std::string path = gDirUtilp->getExpandedFilename(LL_PATH_MOTIONS,mCharacter->getAnimationPrefix())
- + "_" + getName() + ".llp";
+ //std::string path = gDirUtilp->getExpandedFilename(LL_PATH_MOTIONS,mCharacter->getAnimationPrefix())
+ // + "_" + getName() + ".llp";
+ //RN: deprecated unused reference to "motion" directory
+ std::string path;
+
//-------------------------------------------------------------------------
// open the file
diff --git a/indra/llcharacter/llmultigesture.cpp b/indra/llcharacter/llmultigesture.cpp
index 7fe21dbc93..701d6889ca 100644
--- a/indra/llcharacter/llmultigesture.cpp
+++ b/indra/llcharacter/llmultigesture.cpp
@@ -243,7 +243,7 @@ void LLMultiGesture::dump()
//---------------------------------------------------------------------------
LLGestureStepAnimation::LLGestureStepAnimation()
: LLGestureStep(),
- mAnimName("None"),
+ mAnimName("None"),
mAnimAssetID(),
mFlags(0x0)
{ }
@@ -292,20 +292,27 @@ BOOL LLGestureStepAnimation::deserialize(LLDataPacker& dp)
dp.unpackU32(mFlags, "flags");
return TRUE;
}
-
-std::string LLGestureStepAnimation::getLabel() const
+// *TODO: Translate
+std::vector<std::string> LLGestureStepAnimation::getLabel() const
{
- std::string label;
+ std::vector<std::string> strings;
+
+// std::string label;
if (mFlags & ANIM_FLAG_STOP)
{
- label = "Stop Animation: ";
+ strings.push_back( "AnimFlagStop");
+
+// label = "Stop Animation: ";
}
else
{
- label = "Start Animation: ";
+ strings.push_back( "AnimFlagStart");
+
+// label = "Start Animation: ";
}
- label += mAnimName;
- return label;
+ strings.push_back( mAnimName);
+// label += mAnimName;
+ return strings;
}
void LLGestureStepAnimation::dump()
@@ -359,12 +366,15 @@ BOOL LLGestureStepSound::deserialize(LLDataPacker& dp)
dp.unpackU32(mFlags, "flags");
return TRUE;
}
-
-std::string LLGestureStepSound::getLabel() const
+// *TODO: Translate
+std::vector<std::string> LLGestureStepSound::getLabel() const
{
- std::string label("Sound: ");
- label += mSoundName;
- return label;
+ std::vector<std::string> strings;
+ strings.push_back( "Sound");
+ strings.push_back( mSoundName);
+// std::string label("Sound: ");
+// label += mSoundName;
+ return strings;
}
void LLGestureStepSound::dump()
@@ -414,12 +424,13 @@ BOOL LLGestureStepChat::deserialize(LLDataPacker& dp)
dp.unpackU32(mFlags, "flags");
return TRUE;
}
-
-std::string LLGestureStepChat::getLabel() const
+// *TODO: Translate
+std::vector<std::string> LLGestureStepChat::getLabel() const
{
- std::string label("Chat: ");
- label += mChatText;
- return label;
+ std::vector<std::string> strings;
+ strings.push_back("Chat");
+ strings.push_back(mChatText);
+ return strings;
}
void LLGestureStepChat::dump()
@@ -467,22 +478,27 @@ BOOL LLGestureStepWait::deserialize(LLDataPacker& dp)
dp.unpackU32(mFlags, "flags");
return TRUE;
}
-
-std::string LLGestureStepWait::getLabel() const
+// *TODO: Translate
+std::vector<std::string> LLGestureStepWait::getLabel() const
{
- std::string label("--- Wait: ");
+ std::vector<std::string> strings;
+ strings.push_back( "Wait" );
+
+// std::string label("--- Wait: ");
if (mFlags & WAIT_FLAG_TIME)
{
char buffer[64]; /* Flawfinder: ignore */
snprintf(buffer, sizeof(buffer), "%.1f seconds", (double)mWaitSeconds); /* Flawfinder: ignore */
- label += buffer;
+ strings.push_back(buffer);
+// label += buffer;
}
else if (mFlags & WAIT_FLAG_ALL_ANIM)
{
- label += "until animations are done";
+ strings.push_back("until animations are done");
+ // label += "until animations are done";
}
- return label;
+ return strings;
}
diff --git a/indra/llcharacter/llmultigesture.h b/indra/llcharacter/llmultigesture.h
index eb15f600ca..fdffb35c31 100644
--- a/indra/llcharacter/llmultigesture.h
+++ b/indra/llcharacter/llmultigesture.h
@@ -130,7 +130,7 @@ public:
virtual EStepType getType() = 0;
// Return a user-readable label for this step
- virtual std::string getLabel() const = 0;
+ virtual std::vector<std::string> getLabel() const = 0;
virtual S32 getMaxSerialSize() const = 0;
virtual BOOL serialize(LLDataPacker& dp) const = 0;
@@ -152,7 +152,7 @@ public:
virtual EStepType getType() { return STEP_ANIMATION; }
- virtual std::string getLabel() const;
+ virtual std::vector<std::string> getLabel() const;
virtual S32 getMaxSerialSize() const;
virtual BOOL serialize(LLDataPacker& dp) const;
@@ -175,7 +175,7 @@ public:
virtual EStepType getType() { return STEP_SOUND; }
- virtual std::string getLabel() const;
+ virtual std::vector<std::string> getLabel() const;
virtual S32 getMaxSerialSize() const;
virtual BOOL serialize(LLDataPacker& dp) const;
@@ -198,7 +198,7 @@ public:
virtual EStepType getType() { return STEP_CHAT; }
- virtual std::string getLabel() const;
+ virtual std::vector<std::string> getLabel() const;
virtual S32 getMaxSerialSize() const;
virtual BOOL serialize(LLDataPacker& dp) const;
@@ -223,7 +223,7 @@ public:
virtual EStepType getType() { return STEP_WAIT; }
- virtual std::string getLabel() const;
+ virtual std::vector<std::string> getLabel() const;
virtual S32 getMaxSerialSize() const;
virtual BOOL serialize(LLDataPacker& dp) const;
diff --git a/indra/llcharacter/llpose.h b/indra/llcharacter/llpose.h
index 5698f21614..2b976b219d 100644
--- a/indra/llcharacter/llpose.h
+++ b/indra/llcharacter/llpose.h
@@ -36,12 +36,14 @@
//-----------------------------------------------------------------------------
// Header Files
//-----------------------------------------------------------------------------
-#include <string>
-#include "llmap.h"
#include "lljointstate.h"
#include "lljoint.h"
+#include "llmap.h"
+#include "llpointer.h"
+
#include <map>
+#include <string>
//-----------------------------------------------------------------------------