diff options
Diffstat (limited to 'indra/llcharacter/llgesture.cpp')
-rwxr-xr-x | indra/llcharacter/llgesture.cpp | 41 |
1 files changed, 8 insertions, 33 deletions
diff --git a/indra/llcharacter/llgesture.cpp b/indra/llcharacter/llgesture.cpp index c23694639e..aeb65eb10f 100755 --- a/indra/llcharacter/llgesture.cpp +++ b/indra/llcharacter/llgesture.cpp @@ -173,27 +173,7 @@ S32 LLGesture::getMaxSerialSize() LLGestureList::LLGestureList() : mList(0) -{ - // add some gestures for debugging -// LLGesture *gesture = NULL; -/* - gesture = new LLGesture(KEY_F2, MASK_NONE, ":-)", - SND_CHIRP, "dance2", ":-)" ); - mList.put(gesture); - - gesture = new LLGesture(KEY_F3, MASK_NONE, "/dance", - SND_OBJECT_CREATE, "dance3", "(dances)" ); - mList.put(gesture); - - gesture = new LLGesture(KEY_F4, MASK_NONE, "/boogie", - LLUUID::null, "dance4", LLStringUtil::null ); - mList.put(gesture); - - gesture = new LLGesture(KEY_F5, MASK_SHIFT, "/tongue", - LLUUID::null, "Express_Tongue_Out", LLStringUtil::null ); - mList.put(gesture); - */ -} +{} LLGestureList::~LLGestureList() { @@ -203,12 +183,7 @@ LLGestureList::~LLGestureList() void LLGestureList::deleteAll() { - S32 count = mList.count(); - for (S32 i = 0; i < count; i++) - { - delete mList.get(i); - } - mList.reset(); + delete_and_clear(mList); } // Iterates through space delimited tokens in string, triggering any gestures found. @@ -235,9 +210,9 @@ BOOL LLGestureList::triggerAndReviseString(const std::string &string, std::strin std::string cur_token_lower = *token_iter; LLStringUtil::toLower(cur_token_lower); - for (S32 i = 0; i < mList.count(); i++) + for (U32 i = 0; i < mList.size(); i++) { - gesture = mList.get(i); + gesture = mList.at(i); if (gesture->trigger(cur_token_lower)) { if( !gesture->getOutputString().empty() ) @@ -286,9 +261,9 @@ BOOL LLGestureList::triggerAndReviseString(const std::string &string, std::strin BOOL LLGestureList::trigger(KEY key, MASK mask) { - for (S32 i = 0; i < mList.count(); i++) + for (U32 i = 0; i < mList.size(); i++) { - LLGesture* gesture = mList.get(i); + LLGesture* gesture = mList.at(i); if( gesture ) { if (gesture->trigger(key, mask)) @@ -308,7 +283,7 @@ BOOL LLGestureList::trigger(KEY key, MASK mask) U8 *LLGestureList::serialize(U8 *buffer) const { // a single S32 serves as the header that tells us how many to read - S32 count = mList.count(); + U32 count = mList.size(); htonmemcpy(buffer, &count, MVT_S32, 4); buffer += sizeof(count); @@ -345,7 +320,7 @@ U8 *LLGestureList::deserialize(U8 *buffer, S32 max_size) tmp += sizeof(count); - mList.reserve_block(count); + mList.resize(count); for (S32 i = 0; i < count; i++) { |