diff options
Diffstat (limited to '')
43 files changed, 218 insertions, 163 deletions
diff --git a/linden/indra/llcharacter/llanimationstates.cpp b/linden/indra/llcharacter/llanimationstates.cpp index 8687dfb..95aa5d6 100644 --- a/linden/indra/llcharacter/llanimationstates.cpp +++ b/linden/indra/llcharacter/llanimationstates.cpp | |||
@@ -4,6 +4,7 @@ | |||
4 | * | 4 | * |
5 | * Copyright (c) 2001-2007, Linden Research, Inc. | 5 | * Copyright (c) 2001-2007, Linden Research, Inc. |
6 | * | 6 | * |
7 | * Second Life Viewer Source Code | ||
7 | * The source code in this file ("Source Code") is provided by Linden Lab | 8 | * The source code in this file ("Source Code") is provided by Linden Lab |
8 | * to you under the terms of the GNU General Public License, version 2.0 | 9 | * to you under the terms of the GNU General Public License, version 2.0 |
9 | * ("GPL"), unless you have obtained a separate licensing agreement | 10 | * ("GPL"), unless you have obtained a separate licensing agreement |
diff --git a/linden/indra/llcharacter/llanimationstates.h b/linden/indra/llcharacter/llanimationstates.h index 75e2f67..6a9f7a4 100644 --- a/linden/indra/llcharacter/llanimationstates.h +++ b/linden/indra/llcharacter/llanimationstates.h | |||
@@ -4,6 +4,7 @@ | |||
4 | * | 4 | * |
5 | * Copyright (c) 2001-2007, Linden Research, Inc. | 5 | * Copyright (c) 2001-2007, Linden Research, Inc. |
6 | * | 6 | * |
7 | * Second Life Viewer Source Code | ||
7 | * The source code in this file ("Source Code") is provided by Linden Lab | 8 | * The source code in this file ("Source Code") is provided by Linden Lab |
8 | * to you under the terms of the GNU General Public License, version 2.0 | 9 | * to you under the terms of the GNU General Public License, version 2.0 |
9 | * ("GPL"), unless you have obtained a separate licensing agreement | 10 | * ("GPL"), unless you have obtained a separate licensing agreement |
diff --git a/linden/indra/llcharacter/llbvhloader.cpp b/linden/indra/llcharacter/llbvhloader.cpp index 48b5e7c..9f7e901 100644 --- a/linden/indra/llcharacter/llbvhloader.cpp +++ b/linden/indra/llcharacter/llbvhloader.cpp | |||
@@ -4,6 +4,7 @@ | |||
4 | * | 4 | * |
5 | * Copyright (c) 2004-2007, Linden Research, Inc. | 5 | * Copyright (c) 2004-2007, Linden Research, Inc. |
6 | * | 6 | * |
7 | * Second Life Viewer Source Code | ||
7 | * The source code in this file ("Source Code") is provided by Linden Lab | 8 | * The source code in this file ("Source Code") is provided by Linden Lab |
8 | * to you under the terms of the GNU General Public License, version 2.0 | 9 | * to you under the terms of the GNU General Public License, version 2.0 |
9 | * ("GPL"), unless you have obtained a separate licensing agreement | 10 | * ("GPL"), unless you have obtained a separate licensing agreement |
@@ -175,7 +176,7 @@ LLBVHLoader::Status LLBVHLoader::loadTranslationTable(const char *fileName) | |||
175 | //-------------------------------------------------------------------- | 176 | //-------------------------------------------------------------------- |
176 | char path[LL_MAX_PATH]; /* Flawfinder: ignore */ | 177 | char path[LL_MAX_PATH]; /* Flawfinder: ignore */ |
177 | 178 | ||
178 | snprintf( path, sizeof(path), "%s",/* Flawfinder: ignore */ | 179 | snprintf( path, sizeof(path), "%s", /* Flawfinder: ignore */ |
179 | gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS,fileName).c_str()); | 180 | gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS,fileName).c_str()); |
180 | 181 | ||
181 | 182 | ||
diff --git a/linden/indra/llcharacter/llbvhloader.h b/linden/indra/llcharacter/llbvhloader.h index 0ae31ef..0a4f9a9 100644 --- a/linden/indra/llcharacter/llbvhloader.h +++ b/linden/indra/llcharacter/llbvhloader.h | |||
@@ -4,6 +4,7 @@ | |||
4 | * | 4 | * |
5 | * Copyright (c) 2004-2007, Linden Research, Inc. | 5 | * Copyright (c) 2004-2007, Linden Research, Inc. |
6 | * | 6 | * |
7 | * Second Life Viewer Source Code | ||
7 | * The source code in this file ("Source Code") is provided by Linden Lab | 8 | * The source code in this file ("Source Code") is provided by Linden Lab |
8 | * to you under the terms of the GNU General Public License, version 2.0 | 9 | * to you under the terms of the GNU General Public License, version 2.0 |
9 | * ("GPL"), unless you have obtained a separate licensing agreement | 10 | * ("GPL"), unless you have obtained a separate licensing agreement |
diff --git a/linden/indra/llcharacter/llcharacter.cpp b/linden/indra/llcharacter/llcharacter.cpp index 6e9327f..90a3cc6 100644 --- a/linden/indra/llcharacter/llcharacter.cpp +++ b/linden/indra/llcharacter/llcharacter.cpp | |||
@@ -4,6 +4,7 @@ | |||
4 | * | 4 | * |
5 | * Copyright (c) 2001-2007, Linden Research, Inc. | 5 | * Copyright (c) 2001-2007, Linden Research, Inc. |
6 | * | 6 | * |
7 | * Second Life Viewer Source Code | ||
7 | * The source code in this file ("Source Code") is provided by Linden Lab | 8 | * The source code in this file ("Source Code") is provided by Linden Lab |
8 | * to you under the terms of the GNU General Public License, version 2.0 | 9 | * to you under the terms of the GNU General Public License, version 2.0 |
9 | * ("GPL"), unless you have obtained a separate licensing agreement | 10 | * ("GPL"), unless you have obtained a separate licensing agreement |
diff --git a/linden/indra/llcharacter/llcharacter.h b/linden/indra/llcharacter/llcharacter.h index 6f4fe17..90824aa 100644 --- a/linden/indra/llcharacter/llcharacter.h +++ b/linden/indra/llcharacter/llcharacter.h | |||
@@ -4,6 +4,7 @@ | |||
4 | * | 4 | * |
5 | * Copyright (c) 2001-2007, Linden Research, Inc. | 5 | * Copyright (c) 2001-2007, Linden Research, Inc. |
6 | * | 6 | * |
7 | * Second Life Viewer Source Code | ||
7 | * The source code in this file ("Source Code") is provided by Linden Lab | 8 | * The source code in this file ("Source Code") is provided by Linden Lab |
8 | * to you under the terms of the GNU General Public License, version 2.0 | 9 | * to you under the terms of the GNU General Public License, version 2.0 |
9 | * ("GPL"), unless you have obtained a separate licensing agreement | 10 | * ("GPL"), unless you have obtained a separate licensing agreement |
@@ -127,7 +128,7 @@ public: | |||
127 | // updates all visual parameters for this character | 128 | // updates all visual parameters for this character |
128 | virtual void updateVisualParams(); | 129 | virtual void updateVisualParams(); |
129 | 130 | ||
130 | virtual void addDebugText( const char* text ) = 0; | 131 | virtual void addDebugText( const std::string& text ) = 0; |
131 | 132 | ||
132 | virtual const LLUUID& getID() = 0; | 133 | virtual const LLUUID& getID() = 0; |
133 | //------------------------------------------------------------------------- | 134 | //------------------------------------------------------------------------- |
diff --git a/linden/indra/llcharacter/lleditingmotion.cpp b/linden/indra/llcharacter/lleditingmotion.cpp index 66608f8..08d7940 100644 --- a/linden/indra/llcharacter/lleditingmotion.cpp +++ b/linden/indra/llcharacter/lleditingmotion.cpp | |||
@@ -4,6 +4,7 @@ | |||
4 | * | 4 | * |
5 | * Copyright (c) 2001-2007, Linden Research, Inc. | 5 | * Copyright (c) 2001-2007, Linden Research, Inc. |
6 | * | 6 | * |
7 | * Second Life Viewer Source Code | ||
7 | * The source code in this file ("Source Code") is provided by Linden Lab | 8 | * The source code in this file ("Source Code") is provided by Linden Lab |
8 | * to you under the terms of the GNU General Public License, version 2.0 | 9 | * to you under the terms of the GNU General Public License, version 2.0 |
9 | * ("GPL"), unless you have obtained a separate licensing agreement | 10 | * ("GPL"), unless you have obtained a separate licensing agreement |
diff --git a/linden/indra/llcharacter/lleditingmotion.h b/linden/indra/llcharacter/lleditingmotion.h index 37df991..6ca6765 100644 --- a/linden/indra/llcharacter/lleditingmotion.h +++ b/linden/indra/llcharacter/lleditingmotion.h | |||
@@ -4,6 +4,7 @@ | |||
4 | * | 4 | * |
5 | * Copyright (c) 2001-2007, Linden Research, Inc. | 5 | * Copyright (c) 2001-2007, Linden Research, Inc. |
6 | * | 6 | * |
7 | * Second Life Viewer Source Code | ||
7 | * The source code in this file ("Source Code") is provided by Linden Lab | 8 | * The source code in this file ("Source Code") is provided by Linden Lab |
8 | * to you under the terms of the GNU General Public License, version 2.0 | 9 | * to you under the terms of the GNU General Public License, version 2.0 |
9 | * ("GPL"), unless you have obtained a separate licensing agreement | 10 | * ("GPL"), unless you have obtained a separate licensing agreement |
diff --git a/linden/indra/llcharacter/llgesture.cpp b/linden/indra/llcharacter/llgesture.cpp index 944df78..231047d 100644 --- a/linden/indra/llcharacter/llgesture.cpp +++ b/linden/indra/llcharacter/llgesture.cpp | |||
@@ -3,6 +3,7 @@ | |||
3 | * | 3 | * |
4 | * Copyright (c) 2002-2007, Linden Research, Inc. | 4 | * Copyright (c) 2002-2007, Linden Research, Inc. |
5 | * | 5 | * |
6 | * Second Life Viewer Source Code | ||
6 | * The source code in this file ("Source Code") is provided by Linden Lab | 7 | * The source code in this file ("Source Code") is provided by Linden Lab |
7 | * to you under the terms of the GNU General Public License, version 2.0 | 8 | * to you under the terms of the GNU General Public License, version 2.0 |
8 | * ("GPL"), unless you have obtained a separate licensing agreement | 9 | * ("GPL"), unless you have obtained a separate licensing agreement |
diff --git a/linden/indra/llcharacter/llgesture.h b/linden/indra/llcharacter/llgesture.h index 5180be0..dc2b10c 100644 --- a/linden/indra/llcharacter/llgesture.h +++ b/linden/indra/llcharacter/llgesture.h | |||
@@ -5,6 +5,7 @@ | |||
5 | * | 5 | * |
6 | * Copyright (c) 2002-2007, Linden Research, Inc. | 6 | * Copyright (c) 2002-2007, Linden Research, Inc. |
7 | * | 7 | * |
8 | * Second Life Viewer Source Code | ||
8 | * The source code in this file ("Source Code") is provided by Linden Lab | 9 | * The source code in this file ("Source Code") is provided by Linden Lab |
9 | * to you under the terms of the GNU General Public License, version 2.0 | 10 | * to you under the terms of the GNU General Public License, version 2.0 |
10 | * ("GPL"), unless you have obtained a separate licensing agreement | 11 | * ("GPL"), unless you have obtained a separate licensing agreement |
diff --git a/linden/indra/llcharacter/llhandmotion.cpp b/linden/indra/llcharacter/llhandmotion.cpp index 12ef070..96b1dc7 100644 --- a/linden/indra/llcharacter/llhandmotion.cpp +++ b/linden/indra/llcharacter/llhandmotion.cpp | |||
@@ -4,6 +4,7 @@ | |||
4 | * | 4 | * |
5 | * Copyright (c) 2001-2007, Linden Research, Inc. | 5 | * Copyright (c) 2001-2007, Linden Research, Inc. |
6 | * | 6 | * |
7 | * Second Life Viewer Source Code | ||
7 | * The source code in this file ("Source Code") is provided by Linden Lab | 8 | * The source code in this file ("Source Code") is provided by Linden Lab |
8 | * to you under the terms of the GNU General Public License, version 2.0 | 9 | * to you under the terms of the GNU General Public License, version 2.0 |
9 | * ("GPL"), unless you have obtained a separate licensing agreement | 10 | * ("GPL"), unless you have obtained a separate licensing agreement |
diff --git a/linden/indra/llcharacter/llhandmotion.h b/linden/indra/llcharacter/llhandmotion.h index 3f3dac6..b909818 100644 --- a/linden/indra/llcharacter/llhandmotion.h +++ b/linden/indra/llcharacter/llhandmotion.h | |||
@@ -4,6 +4,7 @@ | |||
4 | * | 4 | * |
5 | * Copyright (c) 2001-2007, Linden Research, Inc. | 5 | * Copyright (c) 2001-2007, Linden Research, Inc. |
6 | * | 6 | * |
7 | * Second Life Viewer Source Code | ||
7 | * The source code in this file ("Source Code") is provided by Linden Lab | 8 | * The source code in this file ("Source Code") is provided by Linden Lab |
8 | * to you under the terms of the GNU General Public License, version 2.0 | 9 | * to you under the terms of the GNU General Public License, version 2.0 |
9 | * ("GPL"), unless you have obtained a separate licensing agreement | 10 | * ("GPL"), unless you have obtained a separate licensing agreement |
diff --git a/linden/indra/llcharacter/llheadrotmotion.cpp b/linden/indra/llcharacter/llheadrotmotion.cpp index 1d1771d..be0b55d 100644 --- a/linden/indra/llcharacter/llheadrotmotion.cpp +++ b/linden/indra/llcharacter/llheadrotmotion.cpp | |||
@@ -4,6 +4,7 @@ | |||
4 | * | 4 | * |
5 | * Copyright (c) 2001-2007, Linden Research, Inc. | 5 | * Copyright (c) 2001-2007, Linden Research, Inc. |
6 | * | 6 | * |
7 | * Second Life Viewer Source Code | ||
7 | * The source code in this file ("Source Code") is provided by Linden Lab | 8 | * The source code in this file ("Source Code") is provided by Linden Lab |
8 | * to you under the terms of the GNU General Public License, version 2.0 | 9 | * to you under the terms of the GNU General Public License, version 2.0 |
9 | * ("GPL"), unless you have obtained a separate licensing agreement | 10 | * ("GPL"), unless you have obtained a separate licensing agreement |
diff --git a/linden/indra/llcharacter/llheadrotmotion.h b/linden/indra/llcharacter/llheadrotmotion.h index 1412354..bdb82aa 100644 --- a/linden/indra/llcharacter/llheadrotmotion.h +++ b/linden/indra/llcharacter/llheadrotmotion.h | |||
@@ -4,6 +4,7 @@ | |||
4 | * | 4 | * |
5 | * Copyright (c) 2001-2007, Linden Research, Inc. | 5 | * Copyright (c) 2001-2007, Linden Research, Inc. |
6 | * | 6 | * |
7 | * Second Life Viewer Source Code | ||
7 | * The source code in this file ("Source Code") is provided by Linden Lab | 8 | * The source code in this file ("Source Code") is provided by Linden Lab |
8 | * to you under the terms of the GNU General Public License, version 2.0 | 9 | * to you under the terms of the GNU General Public License, version 2.0 |
9 | * ("GPL"), unless you have obtained a separate licensing agreement | 10 | * ("GPL"), unless you have obtained a separate licensing agreement |
diff --git a/linden/indra/llcharacter/lljoint.cpp b/linden/indra/llcharacter/lljoint.cpp index 4102612..6141cc0 100644 --- a/linden/indra/llcharacter/lljoint.cpp +++ b/linden/indra/llcharacter/lljoint.cpp | |||
@@ -4,6 +4,7 @@ | |||
4 | * | 4 | * |
5 | * Copyright (c) 2001-2007, Linden Research, Inc. | 5 | * Copyright (c) 2001-2007, Linden Research, Inc. |
6 | * | 6 | * |
7 | * Second Life Viewer Source Code | ||
7 | * The source code in this file ("Source Code") is provided by Linden Lab | 8 | * The source code in this file ("Source Code") is provided by Linden Lab |
8 | * to you under the terms of the GNU General Public License, version 2.0 | 9 | * to you under the terms of the GNU General Public License, version 2.0 |
9 | * ("GPL"), unless you have obtained a separate licensing agreement | 10 | * ("GPL"), unless you have obtained a separate licensing agreement |
diff --git a/linden/indra/llcharacter/lljoint.h b/linden/indra/llcharacter/lljoint.h index 352d222..f188968 100644 --- a/linden/indra/llcharacter/lljoint.h +++ b/linden/indra/llcharacter/lljoint.h | |||
@@ -4,6 +4,7 @@ | |||
4 | * | 4 | * |
5 | * Copyright (c) 2001-2007, Linden Research, Inc. | 5 | * Copyright (c) 2001-2007, Linden Research, Inc. |
6 | * | 6 | * |
7 | * Second Life Viewer Source Code | ||
7 | * The source code in this file ("Source Code") is provided by Linden Lab | 8 | * The source code in this file ("Source Code") is provided by Linden Lab |
8 | * to you under the terms of the GNU General Public License, version 2.0 | 9 | * to you under the terms of the GNU General Public License, version 2.0 |
9 | * ("GPL"), unless you have obtained a separate licensing agreement | 10 | * ("GPL"), unless you have obtained a separate licensing agreement |
diff --git a/linden/indra/llcharacter/lljointsolverrp3.cpp b/linden/indra/llcharacter/lljointsolverrp3.cpp index 2221a53..9ecb31b 100644 --- a/linden/indra/llcharacter/lljointsolverrp3.cpp +++ b/linden/indra/llcharacter/lljointsolverrp3.cpp | |||
@@ -4,6 +4,7 @@ | |||
4 | * | 4 | * |
5 | * Copyright (c) 2001-2007, Linden Research, Inc. | 5 | * Copyright (c) 2001-2007, Linden Research, Inc. |
6 | * | 6 | * |
7 | * Second Life Viewer Source Code | ||
7 | * The source code in this file ("Source Code") is provided by Linden Lab | 8 | * The source code in this file ("Source Code") is provided by Linden Lab |
8 | * to you under the terms of the GNU General Public License, version 2.0 | 9 | * to you under the terms of the GNU General Public License, version 2.0 |
9 | * ("GPL"), unless you have obtained a separate licensing agreement | 10 | * ("GPL"), unless you have obtained a separate licensing agreement |
diff --git a/linden/indra/llcharacter/lljointsolverrp3.h b/linden/indra/llcharacter/lljointsolverrp3.h index 7dd35eb..42f4912 100644 --- a/linden/indra/llcharacter/lljointsolverrp3.h +++ b/linden/indra/llcharacter/lljointsolverrp3.h | |||
@@ -4,6 +4,7 @@ | |||
4 | * | 4 | * |
5 | * Copyright (c) 2001-2007, Linden Research, Inc. | 5 | * Copyright (c) 2001-2007, Linden Research, Inc. |
6 | * | 6 | * |
7 | * Second Life Viewer Source Code | ||
7 | * The source code in this file ("Source Code") is provided by Linden Lab | 8 | * The source code in this file ("Source Code") is provided by Linden Lab |
8 | * to you under the terms of the GNU General Public License, version 2.0 | 9 | * to you under the terms of the GNU General Public License, version 2.0 |
9 | * ("GPL"), unless you have obtained a separate licensing agreement | 10 | * ("GPL"), unless you have obtained a separate licensing agreement |
diff --git a/linden/indra/llcharacter/lljointstate.h b/linden/indra/llcharacter/lljointstate.h index 7fef28a..8b55410 100644 --- a/linden/indra/llcharacter/lljointstate.h +++ b/linden/indra/llcharacter/lljointstate.h | |||
@@ -4,6 +4,7 @@ | |||
4 | * | 4 | * |
5 | * Copyright (c) 2001-2007, Linden Research, Inc. | 5 | * Copyright (c) 2001-2007, Linden Research, Inc. |
6 | * | 6 | * |
7 | * Second Life Viewer Source Code | ||
7 | * The source code in this file ("Source Code") is provided by Linden Lab | 8 | * The source code in this file ("Source Code") is provided by Linden Lab |
8 | * to you under the terms of the GNU General Public License, version 2.0 | 9 | * to you under the terms of the GNU General Public License, version 2.0 |
9 | * ("GPL"), unless you have obtained a separate licensing agreement | 10 | * ("GPL"), unless you have obtained a separate licensing agreement |
diff --git a/linden/indra/llcharacter/llkeyframefallmotion.cpp b/linden/indra/llcharacter/llkeyframefallmotion.cpp index 2fca225..d539be6 100644 --- a/linden/indra/llcharacter/llkeyframefallmotion.cpp +++ b/linden/indra/llcharacter/llkeyframefallmotion.cpp | |||
@@ -4,6 +4,7 @@ | |||
4 | * | 4 | * |
5 | * Copyright (c) 2001-2007, Linden Research, Inc. | 5 | * Copyright (c) 2001-2007, Linden Research, Inc. |
6 | * | 6 | * |
7 | * Second Life Viewer Source Code | ||
7 | * The source code in this file ("Source Code") is provided by Linden Lab | 8 | * The source code in this file ("Source Code") is provided by Linden Lab |
8 | * to you under the terms of the GNU General Public License, version 2.0 | 9 | * to you under the terms of the GNU General Public License, version 2.0 |
9 | * ("GPL"), unless you have obtained a separate licensing agreement | 10 | * ("GPL"), unless you have obtained a separate licensing agreement |
diff --git a/linden/indra/llcharacter/llkeyframefallmotion.h b/linden/indra/llcharacter/llkeyframefallmotion.h index ddf4c45..b6a4e68 100644 --- a/linden/indra/llcharacter/llkeyframefallmotion.h +++ b/linden/indra/llcharacter/llkeyframefallmotion.h | |||
@@ -4,6 +4,7 @@ | |||
4 | * | 4 | * |
5 | * Copyright (c) 2001-2007, Linden Research, Inc. | 5 | * Copyright (c) 2001-2007, Linden Research, Inc. |
6 | * | 6 | * |
7 | * Second Life Viewer Source Code | ||
7 | * The source code in this file ("Source Code") is provided by Linden Lab | 8 | * The source code in this file ("Source Code") is provided by Linden Lab |
8 | * to you under the terms of the GNU General Public License, version 2.0 | 9 | * to you under the terms of the GNU General Public License, version 2.0 |
9 | * ("GPL"), unless you have obtained a separate licensing agreement | 10 | * ("GPL"), unless you have obtained a separate licensing agreement |
diff --git a/linden/indra/llcharacter/llkeyframemotion.cpp b/linden/indra/llcharacter/llkeyframemotion.cpp index d09de0e..94e45b6 100644 --- a/linden/indra/llcharacter/llkeyframemotion.cpp +++ b/linden/indra/llcharacter/llkeyframemotion.cpp | |||
@@ -4,6 +4,7 @@ | |||
4 | * | 4 | * |
5 | * Copyright (c) 2001-2007, Linden Research, Inc. | 5 | * Copyright (c) 2001-2007, Linden Research, Inc. |
6 | * | 6 | * |
7 | * Second Life Viewer Source Code | ||
7 | * The source code in this file ("Source Code") is provided by Linden Lab | 8 | * The source code in this file ("Source Code") is provided by Linden Lab |
8 | * to you under the terms of the GNU General Public License, version 2.0 | 9 | * to you under the terms of the GNU General Public License, version 2.0 |
9 | * ("GPL"), unless you have obtained a separate licensing agreement | 10 | * ("GPL"), unless you have obtained a separate licensing agreement |
@@ -48,7 +49,7 @@ | |||
48 | // Static Definitions | 49 | // Static Definitions |
49 | //----------------------------------------------------------------------------- | 50 | //----------------------------------------------------------------------------- |
50 | LLVFS* LLKeyframeMotion::sVFS = NULL; | 51 | LLVFS* LLKeyframeMotion::sVFS = NULL; |
51 | LLKeyframeDataCache::LLKeyframeDataMap LLKeyframeDataCache::sKeyframeDataMap; | 52 | LLKeyframeDataCache::keyframe_data_map_t LLKeyframeDataCache::sKeyframeDataMap; |
52 | 53 | ||
53 | //----------------------------------------------------------------------------- | 54 | //----------------------------------------------------------------------------- |
54 | // Globals | 55 | // Globals |
@@ -64,8 +65,20 @@ static F32 MIN_ACCELERATION_SQUARED = 0.0005f * 0.0005f; | |||
64 | static F32 MAX_CONSTRAINTS = 10; | 65 | static F32 MAX_CONSTRAINTS = 10; |
65 | 66 | ||
66 | //----------------------------------------------------------------------------- | 67 | //----------------------------------------------------------------------------- |
67 | // JointMotionList::dumpDiagInfo() | 68 | // JointMotionList |
68 | //----------------------------------------------------------------------------- | 69 | //----------------------------------------------------------------------------- |
70 | LLKeyframeMotion::JointMotionList::JointMotionList() | ||
71 | : mNumJointMotions(0), | ||
72 | mJointMotionArray(NULL) | ||
73 | { | ||
74 | } | ||
75 | |||
76 | LLKeyframeMotion::JointMotionList::~JointMotionList() | ||
77 | { | ||
78 | for_each(mConstraints.begin(), mConstraints.end(), DeletePointer()); | ||
79 | delete [] mJointMotionArray; | ||
80 | } | ||
81 | |||
69 | U32 LLKeyframeMotion::JointMotionList::dumpDiagInfo() | 82 | U32 LLKeyframeMotion::JointMotionList::dumpDiagInfo() |
70 | { | 83 | { |
71 | S32 total_size = sizeof(JointMotionList); | 84 | S32 total_size = sizeof(JointMotionList); |
@@ -434,7 +447,7 @@ LLKeyframeMotion::~LLKeyframeMotion() | |||
434 | { | 447 | { |
435 | delete [] mJointStates; | 448 | delete [] mJointStates; |
436 | } | 449 | } |
437 | mConstraints.deleteAllData(); | 450 | for_each(mConstraints.begin(), mConstraints.end(), DeletePointer()); |
438 | } | 451 | } |
439 | 452 | ||
440 | //----------------------------------------------------------------------------- | 453 | //----------------------------------------------------------------------------- |
@@ -569,8 +582,7 @@ LLMotion::LLMotionInitStatus LLKeyframeMotion::onInitialize(LLCharacter *charact | |||
569 | BOOL LLKeyframeMotion::setupPose() | 582 | BOOL LLKeyframeMotion::setupPose() |
570 | { | 583 | { |
571 | // add all valid joint states to the pose | 584 | // add all valid joint states to the pose |
572 | U32 jm; | 585 | for (U32 jm=0; jm<mJointMotionList->mNumJointMotions; jm++) |
573 | for (jm=0; jm<mJointMotionList->mNumJointMotions; jm++) | ||
574 | { | 586 | { |
575 | if ( mJointStates[jm].getJoint() ) | 587 | if ( mJointStates[jm].getJoint() ) |
576 | { | 588 | { |
@@ -579,16 +591,16 @@ BOOL LLKeyframeMotion::setupPose() | |||
579 | } | 591 | } |
580 | 592 | ||
581 | // initialize joint constraints | 593 | // initialize joint constraints |
582 | for (JointConstraintSharedData* shared_constraintp = mJointMotionList->mConstraints.getFirstData(); | 594 | for (JointMotionList::constraint_list_t::iterator iter = mJointMotionList->mConstraints.begin(); |
583 | shared_constraintp; | 595 | iter != mJointMotionList->mConstraints.end(); ++iter) |
584 | shared_constraintp = mJointMotionList->mConstraints.getNextData()) | 596 | { |
585 | { | 597 | JointConstraintSharedData* shared_constraintp = *iter; |
586 | JointConstraint* constraintp = new JointConstraint(shared_constraintp); | 598 | JointConstraint* constraintp = new JointConstraint(shared_constraintp); |
587 | initializeConstraint(constraintp); | 599 | initializeConstraint(constraintp); |
588 | mConstraints.addData(constraintp); | 600 | mConstraints.push_front(constraintp); |
589 | } | 601 | } |
590 | 602 | ||
591 | if (mJointMotionList->mConstraints.getLength()) | 603 | if (mJointMotionList->mConstraints.size()) |
592 | { | 604 | { |
593 | mPelvisp = mCharacter->getJoint("mPelvis"); | 605 | mPelvisp = mCharacter->getJoint("mPelvis"); |
594 | if (!mPelvisp) | 606 | if (!mPelvisp) |
@@ -711,21 +723,21 @@ void LLKeyframeMotion::applyConstraints(F32 time, U8* joint_mask) | |||
711 | if (mCharacter->getSkeletonSerialNum() != mLastSkeletonSerialNum) | 723 | if (mCharacter->getSkeletonSerialNum() != mLastSkeletonSerialNum) |
712 | { | 724 | { |
713 | mLastSkeletonSerialNum = mCharacter->getSkeletonSerialNum(); | 725 | mLastSkeletonSerialNum = mCharacter->getSkeletonSerialNum(); |
714 | for (JointConstraint* constraintp = mConstraints.getFirstData(); | 726 | for (constraint_list_t::iterator iter = mConstraints.begin(); |
715 | constraintp; | 727 | iter != mConstraints.end(); ++iter) |
716 | constraintp = mConstraints.getNextData()) | 728 | { |
717 | { | 729 | JointConstraint* constraintp = *iter; |
718 | initializeConstraint(constraintp); | 730 | initializeConstraint(constraintp); |
719 | } | 731 | } |
720 | } | 732 | } |
721 | 733 | ||
722 | // apply constraints | 734 | // apply constraints |
723 | for (JointConstraint* constraintp = mConstraints.getFirstData(); | 735 | for (constraint_list_t::iterator iter = mConstraints.begin(); |
724 | constraintp; | 736 | iter != mConstraints.end(); ++iter) |
725 | constraintp = mConstraints.getNextData()) | 737 | { |
726 | { | 738 | JointConstraint* constraintp = *iter; |
727 | applyConstraint(constraintp, time, joint_mask); | 739 | applyConstraint(constraintp, time, joint_mask); |
728 | } | 740 | } |
729 | } | 741 | } |
730 | 742 | ||
731 | //----------------------------------------------------------------------------- | 743 | //----------------------------------------------------------------------------- |
@@ -733,12 +745,12 @@ void LLKeyframeMotion::applyConstraints(F32 time, U8* joint_mask) | |||
733 | //----------------------------------------------------------------------------- | 745 | //----------------------------------------------------------------------------- |
734 | void LLKeyframeMotion::onDeactivate() | 746 | void LLKeyframeMotion::onDeactivate() |
735 | { | 747 | { |
736 | for (JointConstraint* constraintp = mConstraints.getFirstData(); | 748 | for (constraint_list_t::iterator iter = mConstraints.begin(); |
737 | constraintp; | 749 | iter != mConstraints.end(); ++iter) |
738 | constraintp = mConstraints.getNextData()) | 750 | { |
739 | { | 751 | JointConstraint* constraintp = *iter; |
740 | deactivateConstraint(constraintp); | 752 | deactivateConstraint(constraintp); |
741 | } | 753 | } |
742 | } | 754 | } |
743 | 755 | ||
744 | //----------------------------------------------------------------------------- | 756 | //----------------------------------------------------------------------------- |
@@ -1605,7 +1617,7 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp) | |||
1605 | return FALSE; | 1617 | return FALSE; |
1606 | } | 1618 | } |
1607 | 1619 | ||
1608 | mJointMotionList->mConstraints.addData(constraintp); | 1620 | mJointMotionList->mConstraints.push_front(constraintp); |
1609 | 1621 | ||
1610 | constraintp->mJointStateIndices = new S32[constraintp->mChainLength + 1]; | 1622 | constraintp->mJointStateIndices = new S32[constraintp->mChainLength + 1]; |
1611 | 1623 | ||
@@ -1713,10 +1725,19 @@ BOOL LLKeyframeMotion::serialize(LLDataPacker& dp) const | |||
1713 | } | 1725 | } |
1714 | } | 1726 | } |
1715 | 1727 | ||
1716 | success &= dp.packS32(mJointMotionList->mConstraints.getLength(), "num_constraints"); | 1728 | success &= dp.packS32(mJointMotionList->mConstraints.size(), "num_constraints"); |
1717 | for (JointConstraintSharedData* shared_constraintp = mJointMotionList->mConstraints.getFirstData(); | 1729 | for (JointMotionList::constraint_list_t::iterator iter = mJointMotionList->mConstraints.begin(); |
1718 | shared_constraintp; | 1730 | iter != mJointMotionList->mConstraints.end(); ++iter) |
1719 | shared_constraintp = mJointMotionList->mConstraints.getNextData()) | 1731 | { |
1732 | JointConstraintSharedData* shared_constraintp = *iter; | ||
1733 | success &= dp.packU8(shared_constraintp->mChainLength, "chain_length"); | ||
1734 | success &= dp.packU8(shared_constraintp->mConstraintType, "constraint_type"); | ||
1735 | char volume_name[16]; /* Flawfinder: ignore */ | ||
1736 | snprintf(volume_name, sizeof(volume_name), "%s", /* Flawfinder: ignore */ | ||
1737 | mCharacter->findCollisionVolume(shared_constraintp->mSourceConstraintVolume)->getName().c_str()); | ||
1738 | success &= dp.packBinaryDataFixed((U8*)volume_name, 16, "source_volume"); | ||
1739 | success &= dp.packVector3(shared_constraintp->mSourceConstraintOffset, "source_offset"); | ||
1740 | if (shared_constraintp->mConstraintTargetType == TYPE_GROUND) | ||
1720 | { | 1741 | { |
1721 | success &= dp.packU8(shared_constraintp->mChainLength, "chain_length"); | 1742 | success &= dp.packU8(shared_constraintp->mChainLength, "chain_length"); |
1722 | success &= dp.packU8(shared_constraintp->mConstraintType, "constraint_type"); | 1743 | success &= dp.packU8(shared_constraintp->mConstraintType, "constraint_type"); |
@@ -1731,7 +1752,7 @@ BOOL LLKeyframeMotion::serialize(LLDataPacker& dp) const | |||
1731 | } | 1752 | } |
1732 | else | 1753 | else |
1733 | { | 1754 | { |
1734 | snprintf(volume_name, sizeof(volume_name),"%s", /* Flawfinder: ignore */ | 1755 | snprintf(volume_name, sizeof(volume_name),"%s", /* Flawfinder: ignore */ |
1735 | mCharacter->findCollisionVolume(shared_constraintp->mTargetConstraintVolume)->getName().c_str()); | 1756 | mCharacter->findCollisionVolume(shared_constraintp->mTargetConstraintVolume)->getName().c_str()); |
1736 | } | 1757 | } |
1737 | success &= dp.packBinaryDataFixed((U8*)volume_name, 16, "target_volume"); | 1758 | success &= dp.packBinaryDataFixed((U8*)volume_name, 16, "target_volume"); |
@@ -1742,6 +1763,19 @@ BOOL LLKeyframeMotion::serialize(LLDataPacker& dp) const | |||
1742 | success &= dp.packF32(shared_constraintp->mEaseOutStartTime, "ease_out_start"); | 1763 | success &= dp.packF32(shared_constraintp->mEaseOutStartTime, "ease_out_start"); |
1743 | success &= dp.packF32(shared_constraintp->mEaseOutStopTime, "ease_out_stop"); | 1764 | success &= dp.packF32(shared_constraintp->mEaseOutStopTime, "ease_out_stop"); |
1744 | } | 1765 | } |
1766 | else | ||
1767 | { | ||
1768 | snprintf(volume_name, sizeof(volume_name),"%s", /* Flawfinder: ignore */ | ||
1769 | mCharacter->findCollisionVolume(shared_constraintp->mTargetConstraintVolume)->getName().c_str()); | ||
1770 | } | ||
1771 | success &= dp.packBinaryDataFixed((U8*)volume_name, 16, "target_volume"); | ||
1772 | success &= dp.packVector3(shared_constraintp->mTargetConstraintOffset, "target_offset"); | ||
1773 | success &= dp.packVector3(shared_constraintp->mTargetConstraintDir, "target_dir"); | ||
1774 | success &= dp.packF32(shared_constraintp->mEaseInStartTime, "ease_in_start"); | ||
1775 | success &= dp.packF32(shared_constraintp->mEaseInStopTime, "ease_in_stop"); | ||
1776 | success &= dp.packF32(shared_constraintp->mEaseOutStartTime, "ease_out_start"); | ||
1777 | success &= dp.packF32(shared_constraintp->mEaseOutStopTime, "ease_out_stop"); | ||
1778 | } | ||
1745 | 1779 | ||
1746 | return success; | 1780 | return success; |
1747 | } | 1781 | } |
@@ -1832,7 +1866,8 @@ void LLKeyframeMotion::setEaseOut(F32 ease_in) | |||
1832 | //----------------------------------------------------------------------------- | 1866 | //----------------------------------------------------------------------------- |
1833 | void LLKeyframeMotion::flushKeyframeCache() | 1867 | void LLKeyframeMotion::flushKeyframeCache() |
1834 | { | 1868 | { |
1835 | LLKeyframeDataCache::clear(); | 1869 | // TODO: Make this safe to do |
1870 | // LLKeyframeDataCache::clear(); | ||
1836 | } | 1871 | } |
1837 | 1872 | ||
1838 | //----------------------------------------------------------------------------- | 1873 | //----------------------------------------------------------------------------- |
@@ -2041,8 +2076,8 @@ void LLKeyframeDataCache::dumpDiagInfo() | |||
2041 | llinfos << "-----------------------------------------------------" << llendl; | 2076 | llinfos << "-----------------------------------------------------" << llendl; |
2042 | 2077 | ||
2043 | // print each loaded mesh, and it's memory usage | 2078 | // print each loaded mesh, and it's memory usage |
2044 | LLKeyframeDataMap::iterator map_it; | 2079 | for (keyframe_data_map_t::iterator map_it = sKeyframeDataMap.begin(); |
2045 | for (map_it = sKeyframeDataMap.begin(); map_it != sKeyframeDataMap.end(); ++map_it) | 2080 | map_it != sKeyframeDataMap.end(); ++map_it) |
2046 | { | 2081 | { |
2047 | U32 joint_motion_kb; | 2082 | U32 joint_motion_kb; |
2048 | 2083 | ||
@@ -2076,12 +2111,12 @@ void LLKeyframeDataCache::addKeyframeData(const LLUUID& id, LLKeyframeMotion::Jo | |||
2076 | //-------------------------------------------------------------------- | 2111 | //-------------------------------------------------------------------- |
2077 | void LLKeyframeDataCache::removeKeyframeData(const LLUUID& id) | 2112 | void LLKeyframeDataCache::removeKeyframeData(const LLUUID& id) |
2078 | { | 2113 | { |
2079 | LLKeyframeMotion::JointMotionList* joint_motion_listp = getKeyframeData(id); | 2114 | keyframe_data_map_t::iterator found_data = sKeyframeDataMap.find(id); |
2080 | if (joint_motion_listp) | 2115 | if (found_data != sKeyframeDataMap.end()) |
2081 | { | 2116 | { |
2082 | delete joint_motion_listp; | 2117 | delete found_data->second; |
2118 | sKeyframeDataMap.erase(found_data); | ||
2083 | } | 2119 | } |
2084 | sKeyframeDataMap.erase(id); | ||
2085 | } | 2120 | } |
2086 | 2121 | ||
2087 | //-------------------------------------------------------------------- | 2122 | //-------------------------------------------------------------------- |
@@ -2089,7 +2124,7 @@ void LLKeyframeDataCache::removeKeyframeData(const LLUUID& id) | |||
2089 | //-------------------------------------------------------------------- | 2124 | //-------------------------------------------------------------------- |
2090 | LLKeyframeMotion::JointMotionList* LLKeyframeDataCache::getKeyframeData(const LLUUID& id) | 2125 | LLKeyframeMotion::JointMotionList* LLKeyframeDataCache::getKeyframeData(const LLUUID& id) |
2091 | { | 2126 | { |
2092 | LLKeyframeDataMap::iterator found_data = sKeyframeDataMap.find(id); | 2127 | keyframe_data_map_t::iterator found_data = sKeyframeDataMap.find(id); |
2093 | if (found_data == sKeyframeDataMap.end()) | 2128 | if (found_data == sKeyframeDataMap.end()) |
2094 | { | 2129 | { |
2095 | return NULL; | 2130 | return NULL; |
diff --git a/linden/indra/llcharacter/llkeyframemotion.h b/linden/indra/llcharacter/llkeyframemotion.h index c33df80..1e5cd62 100644 --- a/linden/indra/llcharacter/llkeyframemotion.h +++ b/linden/indra/llcharacter/llkeyframemotion.h | |||
@@ -4,6 +4,7 @@ | |||
4 | * | 4 | * |
5 | * Copyright (c) 2001-2007, Linden Research, Inc. | 5 | * Copyright (c) 2001-2007, Linden Research, Inc. |
6 | * | 6 | * |
7 | * Second Life Viewer Source Code | ||
7 | * The source code in this file ("Source Code") is provided by Linden Lab | 8 | * The source code in this file ("Source Code") is provided by Linden Lab |
8 | * to you under the terms of the GNU General Public License, version 2.0 | 9 | * to you under the terms of the GNU General Public License, version 2.0 |
9 | * ("GPL"), unless you have obtained a separate licensing agreement | 10 | * ("GPL"), unless you have obtained a separate licensing agreement |
@@ -35,7 +36,6 @@ | |||
35 | #include <string> | 36 | #include <string> |
36 | 37 | ||
37 | #include "llassetstorage.h" | 38 | #include "llassetstorage.h" |
38 | #include "llassoclist.h" | ||
39 | #include "llbboxlocal.h" | 39 | #include "llbboxlocal.h" |
40 | #include "llhandmotion.h" | 40 | #include "llhandmotion.h" |
41 | #include "lljointstate.h" | 41 | #include "lljointstate.h" |
@@ -405,11 +405,12 @@ public: | |||
405 | LLJoint::JointPriority mBasePriority; | 405 | LLJoint::JointPriority mBasePriority; |
406 | LLHandMotion::eHandPose mHandPose; | 406 | LLHandMotion::eHandPose mHandPose; |
407 | LLJoint::JointPriority mMaxPriority; | 407 | LLJoint::JointPriority mMaxPriority; |
408 | LLLinkedList<JointConstraintSharedData> mConstraints; | 408 | typedef std::list<JointConstraintSharedData*> constraint_list_t; |
409 | constraint_list_t mConstraints; | ||
409 | LLBBoxLocal mPelvisBBox; | 410 | LLBBoxLocal mPelvisBBox; |
410 | public: | 411 | public: |
411 | JointMotionList() : mNumJointMotions(0), mJointMotionArray(NULL) {}; | 412 | JointMotionList(); |
412 | ~JointMotionList() { mConstraints.deleteAllData(); delete [] mJointMotionArray; } | 413 | ~JointMotionList(); |
413 | U32 dumpDiagInfo(); | 414 | U32 dumpDiagInfo(); |
414 | }; | 415 | }; |
415 | 416 | ||
@@ -425,7 +426,8 @@ protected: | |||
425 | LLJoint* mPelvisp; | 426 | LLJoint* mPelvisp; |
426 | LLCharacter* mCharacter; | 427 | LLCharacter* mCharacter; |
427 | std::string mEmoteName; | 428 | std::string mEmoteName; |
428 | LLLinkedList<JointConstraint> mConstraints; | 429 | typedef std::list<JointConstraint*> constraint_list_t; |
430 | constraint_list_t mConstraints; | ||
429 | U32 mLastSkeletonSerialNum; | 431 | U32 mLastSkeletonSerialNum; |
430 | F32 mLastUpdateTime; | 432 | F32 mLastUpdateTime; |
431 | F32 mLastLoopedTime; | 433 | F32 mLastLoopedTime; |
@@ -439,8 +441,8 @@ public: | |||
439 | LLKeyframeDataCache(){}; | 441 | LLKeyframeDataCache(){}; |
440 | ~LLKeyframeDataCache(); | 442 | ~LLKeyframeDataCache(); |
441 | 443 | ||
442 | typedef std::map<LLUUID, class LLKeyframeMotion::JointMotionList*> LLKeyframeDataMap; | 444 | typedef std::map<LLUUID, class LLKeyframeMotion::JointMotionList*> keyframe_data_map_t; |
443 | static LLKeyframeDataMap sKeyframeDataMap; | 445 | static keyframe_data_map_t sKeyframeDataMap; |
444 | 446 | ||
445 | static void addKeyframeData(const LLUUID& id, LLKeyframeMotion::JointMotionList*); | 447 | static void addKeyframeData(const LLUUID& id, LLKeyframeMotion::JointMotionList*); |
446 | static LLKeyframeMotion::JointMotionList* getKeyframeData(const LLUUID& id); | 448 | static LLKeyframeMotion::JointMotionList* getKeyframeData(const LLUUID& id); |
diff --git a/linden/indra/llcharacter/llkeyframemotionparam.cpp b/linden/indra/llcharacter/llkeyframemotionparam.cpp index 93df410..5970909 100644 --- a/linden/indra/llcharacter/llkeyframemotionparam.cpp +++ b/linden/indra/llcharacter/llkeyframemotionparam.cpp | |||
@@ -4,6 +4,7 @@ | |||
4 | * | 4 | * |
5 | * Copyright (c) 2001-2007, Linden Research, Inc. | 5 | * Copyright (c) 2001-2007, Linden Research, Inc. |
6 | * | 6 | * |
7 | * Second Life Viewer Source Code | ||
7 | * The source code in this file ("Source Code") is provided by Linden Lab | 8 | * The source code in this file ("Source Code") is provided by Linden Lab |
8 | * to you under the terms of the GNU General Public License, version 2.0 | 9 | * to you under the terms of the GNU General Public License, version 2.0 |
9 | * ("GPL"), unless you have obtained a separate licensing agreement | 10 | * ("GPL"), unless you have obtained a separate licensing agreement |
@@ -348,7 +349,7 @@ BOOL LLKeyframeMotionParam::loadMotions() | |||
348 | // Load data into a buffer to be parsed. | 349 | // Load data into a buffer to be parsed. |
349 | //------------------------------------------------------------------------- | 350 | //------------------------------------------------------------------------- |
350 | char path[LL_MAX_PATH]; /* Flawfinder: ignore */ | 351 | char path[LL_MAX_PATH]; /* Flawfinder: ignore */ |
351 | snprintf( path,sizeof(path), "%s_%s.llp", /* Flawfinder: ignore */ | 352 | snprintf( path,sizeof(path), "%s_%s.llp", |
352 | gDirUtilp->getExpandedFilename(LL_PATH_MOTIONS,mCharacter->getAnimationPrefix()).c_str(), | 353 | gDirUtilp->getExpandedFilename(LL_PATH_MOTIONS,mCharacter->getAnimationPrefix()).c_str(), |
353 | getName().c_str() ); | 354 | getName().c_str() ); |
354 | 355 | ||
diff --git a/linden/indra/llcharacter/llkeyframemotionparam.h b/linden/indra/llcharacter/llkeyframemotionparam.h index 33dd094..e0885c1 100644 --- a/linden/indra/llcharacter/llkeyframemotionparam.h +++ b/linden/indra/llcharacter/llkeyframemotionparam.h | |||
@@ -4,6 +4,7 @@ | |||
4 | * | 4 | * |
5 | * Copyright (c) 2002-2007, Linden Research, Inc. | 5 | * Copyright (c) 2002-2007, Linden Research, Inc. |
6 | * | 6 | * |
7 | * Second Life Viewer Source Code | ||
7 | * The source code in this file ("Source Code") is provided by Linden Lab | 8 | * The source code in this file ("Source Code") is provided by Linden Lab |
8 | * to you under the terms of the GNU General Public License, version 2.0 | 9 | * to you under the terms of the GNU General Public License, version 2.0 |
9 | * ("GPL"), unless you have obtained a separate licensing agreement | 10 | * ("GPL"), unless you have obtained a separate licensing agreement |
diff --git a/linden/indra/llcharacter/llkeyframestandmotion.cpp b/linden/indra/llcharacter/llkeyframestandmotion.cpp index 4fcb76c..9b423c5 100644 --- a/linden/indra/llcharacter/llkeyframestandmotion.cpp +++ b/linden/indra/llcharacter/llkeyframestandmotion.cpp | |||
@@ -4,6 +4,7 @@ | |||
4 | * | 4 | * |
5 | * Copyright (c) 2001-2007, Linden Research, Inc. | 5 | * Copyright (c) 2001-2007, Linden Research, Inc. |
6 | * | 6 | * |
7 | * Second Life Viewer Source Code | ||
7 | * The source code in this file ("Source Code") is provided by Linden Lab | 8 | * The source code in this file ("Source Code") is provided by Linden Lab |
8 | * to you under the terms of the GNU General Public License, version 2.0 | 9 | * to you under the terms of the GNU General Public License, version 2.0 |
9 | * ("GPL"), unless you have obtained a separate licensing agreement | 10 | * ("GPL"), unless you have obtained a separate licensing agreement |
diff --git a/linden/indra/llcharacter/llkeyframestandmotion.h b/linden/indra/llcharacter/llkeyframestandmotion.h index f569498..e7c54c5 100644 --- a/linden/indra/llcharacter/llkeyframestandmotion.h +++ b/linden/indra/llcharacter/llkeyframestandmotion.h | |||
@@ -4,6 +4,7 @@ | |||
4 | * | 4 | * |
5 | * Copyright (c) 2001-2007, Linden Research, Inc. | 5 | * Copyright (c) 2001-2007, Linden Research, Inc. |
6 | * | 6 | * |
7 | * Second Life Viewer Source Code | ||
7 | * The source code in this file ("Source Code") is provided by Linden Lab | 8 | * The source code in this file ("Source Code") is provided by Linden Lab |
8 | * to you under the terms of the GNU General Public License, version 2.0 | 9 | * to you under the terms of the GNU General Public License, version 2.0 |
9 | * ("GPL"), unless you have obtained a separate licensing agreement | 10 | * ("GPL"), unless you have obtained a separate licensing agreement |
diff --git a/linden/indra/llcharacter/llkeyframewalkmotion.cpp b/linden/indra/llcharacter/llkeyframewalkmotion.cpp index b1838d8..bf347a6 100644 --- a/linden/indra/llcharacter/llkeyframewalkmotion.cpp +++ b/linden/indra/llcharacter/llkeyframewalkmotion.cpp | |||
@@ -4,6 +4,7 @@ | |||
4 | * | 4 | * |
5 | * Copyright (c) 2001-2007, Linden Research, Inc. | 5 | * Copyright (c) 2001-2007, Linden Research, Inc. |
6 | * | 6 | * |
7 | * Second Life Viewer Source Code | ||
7 | * The source code in this file ("Source Code") is provided by Linden Lab | 8 | * The source code in this file ("Source Code") is provided by Linden Lab |
8 | * to you under the terms of the GNU General Public License, version 2.0 | 9 | * to you under the terms of the GNU General Public License, version 2.0 |
9 | * ("GPL"), unless you have obtained a separate licensing agreement | 10 | * ("GPL"), unless you have obtained a separate licensing agreement |
diff --git a/linden/indra/llcharacter/llkeyframewalkmotion.h b/linden/indra/llcharacter/llkeyframewalkmotion.h index 3367b64..d2c9cd8 100644 --- a/linden/indra/llcharacter/llkeyframewalkmotion.h +++ b/linden/indra/llcharacter/llkeyframewalkmotion.h | |||
@@ -4,6 +4,7 @@ | |||
4 | * | 4 | * |
5 | * Copyright (c) 2001-2007, Linden Research, Inc. | 5 | * Copyright (c) 2001-2007, Linden Research, Inc. |
6 | * | 6 | * |
7 | * Second Life Viewer Source Code | ||
7 | * The source code in this file ("Source Code") is provided by Linden Lab | 8 | * The source code in this file ("Source Code") is provided by Linden Lab |
8 | * to you under the terms of the GNU General Public License, version 2.0 | 9 | * to you under the terms of the GNU General Public License, version 2.0 |
9 | * ("GPL"), unless you have obtained a separate licensing agreement | 10 | * ("GPL"), unless you have obtained a separate licensing agreement |
diff --git a/linden/indra/llcharacter/llmotion.cpp b/linden/indra/llcharacter/llmotion.cpp index d2343ab..b13ea60 100644 --- a/linden/indra/llcharacter/llmotion.cpp +++ b/linden/indra/llcharacter/llmotion.cpp | |||
@@ -4,6 +4,7 @@ | |||
4 | * | 4 | * |
5 | * Copyright (c) 2001-2007, Linden Research, Inc. | 5 | * Copyright (c) 2001-2007, Linden Research, Inc. |
6 | * | 6 | * |
7 | * Second Life Viewer Source Code | ||
7 | * The source code in this file ("Source Code") is provided by Linden Lab | 8 | * The source code in this file ("Source Code") is provided by Linden Lab |
8 | * to you under the terms of the GNU General Public License, version 2.0 | 9 | * to you under the terms of the GNU General Public License, version 2.0 |
9 | * ("GPL"), unless you have obtained a separate licensing agreement | 10 | * ("GPL"), unless you have obtained a separate licensing agreement |
diff --git a/linden/indra/llcharacter/llmotion.h b/linden/indra/llcharacter/llmotion.h index 2e302cf..48d402a 100644 --- a/linden/indra/llcharacter/llmotion.h +++ b/linden/indra/llcharacter/llmotion.h | |||
@@ -4,6 +4,7 @@ | |||
4 | * | 4 | * |
5 | * Copyright (c) 2001-2007, Linden Research, Inc. | 5 | * Copyright (c) 2001-2007, Linden Research, Inc. |
6 | * | 6 | * |
7 | * Second Life Viewer Source Code | ||
7 | * The source code in this file ("Source Code") is provided by Linden Lab | 8 | * The source code in this file ("Source Code") is provided by Linden Lab |
8 | * to you under the terms of the GNU General Public License, version 2.0 | 9 | * to you under the terms of the GNU General Public License, version 2.0 |
9 | * ("GPL"), unless you have obtained a separate licensing agreement | 10 | * ("GPL"), unless you have obtained a separate licensing agreement |
diff --git a/linden/indra/llcharacter/llmotioncontroller.cpp b/linden/indra/llcharacter/llmotioncontroller.cpp index 3e1456b..5545841 100644 --- a/linden/indra/llcharacter/llmotioncontroller.cpp +++ b/linden/indra/llcharacter/llmotioncontroller.cpp | |||
@@ -4,6 +4,7 @@ | |||
4 | * | 4 | * |
5 | * Copyright (c) 2001-2007, Linden Research, Inc. | 5 | * Copyright (c) 2001-2007, Linden Research, Inc. |
6 | * | 6 | * |
7 | * Second Life Viewer Source Code | ||
7 | * The source code in this file ("Source Code") is provided by Linden Lab | 8 | * The source code in this file ("Source Code") is provided by Linden Lab |
8 | * to you under the terms of the GNU General Public License, version 2.0 | 9 | * to you under the terms of the GNU General Public License, version 2.0 |
9 | * ("GPL"), unless you have obtained a separate licensing agreement | 10 | * ("GPL"), unless you have obtained a separate licensing agreement |
@@ -180,9 +181,9 @@ LLMotionController::~LLMotionController() | |||
180 | //----------------------------------------------------------------------------- | 181 | //----------------------------------------------------------------------------- |
181 | void LLMotionController::deleteAllMotions() | 182 | void LLMotionController::deleteAllMotions() |
182 | { | 183 | { |
183 | mLoadingMotions.removeAllNodes(); | 184 | mLoadingMotions.clear(); |
184 | mLoadedMotions.clear(); | 185 | mLoadedMotions.clear(); |
185 | mActiveMotions.removeAllNodes(); | 186 | mActiveMotions.clear(); |
186 | 187 | ||
187 | for_each(mAllMotions.begin(), mAllMotions.end(), DeletePairedPointer()); | 188 | for_each(mAllMotions.begin(), mAllMotions.end(), DeletePairedPointer()); |
188 | mAllMotions.clear(); | 189 | mAllMotions.clear(); |
@@ -234,16 +235,16 @@ void LLMotionController::setTimeStep(F32 step) | |||
234 | if (step != 0.f) | 235 | if (step != 0.f) |
235 | { | 236 | { |
236 | // make sure timestamps conform to new quantum | 237 | // make sure timestamps conform to new quantum |
237 | for( LLMotion* motionp = mActiveMotions.getFirstData(); | 238 | for (motion_list_t::iterator iter = mActiveMotions.begin(); |
238 | motionp != NULL; | 239 | iter != mActiveMotions.end(); ++iter) |
239 | motionp = mActiveMotions.getNextData() ) | 240 | { |
240 | { | 241 | LLMotion* motionp = *iter; |
241 | motionp->mActivationTimestamp = (F32)llfloor(motionp->mActivationTimestamp / step) * step; | 242 | motionp->mActivationTimestamp = (F32)llfloor(motionp->mActivationTimestamp / step) * step; |
242 | BOOL stopped = motionp->isStopped(); | 243 | BOOL stopped = motionp->isStopped(); |
243 | motionp->setStopTime((F32)llfloor(motionp->getStopTime() / step) * step); | 244 | motionp->setStopTime((F32)llfloor(motionp->getStopTime() / step) * step); |
244 | motionp->setStopped(stopped); | 245 | motionp->setStopped(stopped); |
245 | motionp->mSendStopTimestamp = (F32)llfloor(motionp->mSendStopTimestamp / step) * step; | 246 | motionp->mSendStopTimestamp = (F32)llfloor(motionp->mSendStopTimestamp / step) * step; |
246 | } | 247 | } |
247 | } | 248 | } |
248 | } | 249 | } |
249 | 250 | ||
@@ -257,23 +258,6 @@ void LLMotionController::setTimeFactor(F32 time_factor) | |||
257 | } | 258 | } |
258 | 259 | ||
259 | //----------------------------------------------------------------------------- | 260 | //----------------------------------------------------------------------------- |
260 | // getFirstActiveMotion() | ||
261 | //----------------------------------------------------------------------------- | ||
262 | LLMotion* LLMotionController::getFirstActiveMotion() | ||
263 | { | ||
264 | return mActiveMotions.getFirstData(); | ||
265 | } | ||
266 | |||
267 | //----------------------------------------------------------------------------- | ||
268 | // getNextActiveMotion() | ||
269 | //----------------------------------------------------------------------------- | ||
270 | LLMotion* LLMotionController::getNextActiveMotion() | ||
271 | { | ||
272 | return mActiveMotions.getNextData(); | ||
273 | } | ||
274 | |||
275 | |||
276 | //----------------------------------------------------------------------------- | ||
277 | // setCharacter() | 261 | // setCharacter() |
278 | //----------------------------------------------------------------------------- | 262 | //----------------------------------------------------------------------------- |
279 | void LLMotionController::setCharacter(LLCharacter *character) | 263 | void LLMotionController::setCharacter(LLCharacter *character) |
@@ -300,17 +284,9 @@ void LLMotionController::removeMotion( const LLUUID& id) | |||
300 | { | 284 | { |
301 | stopMotionLocally(id, TRUE); | 285 | stopMotionLocally(id, TRUE); |
302 | 286 | ||
303 | mLoadingMotions.deleteData(motionp); | 287 | mLoadingMotions.erase(motionp); |
304 | std::deque<LLMotion*>::iterator motion_it; | 288 | mLoadedMotions.remove(motionp); |
305 | for (motion_it = mLoadedMotions.begin(); motion_it != mLoadedMotions.end(); ++motion_it) | 289 | mActiveMotions.remove(motionp); |
306 | { | ||
307 | if(*motion_it == motionp) | ||
308 | { | ||
309 | mLoadedMotions.erase(motion_it); | ||
310 | break; | ||
311 | } | ||
312 | } | ||
313 | mActiveMotions.deleteData(motionp); | ||
314 | mAllMotions.erase(id); | 290 | mAllMotions.erase(id); |
315 | delete motionp; | 291 | delete motionp; |
316 | } | 292 | } |
@@ -351,7 +327,7 @@ LLMotion* LLMotionController::createMotion( const LLUUID &id ) | |||
351 | delete motion; | 327 | delete motion; |
352 | return NULL; | 328 | return NULL; |
353 | case LLMotion::STATUS_HOLD: | 329 | case LLMotion::STATUS_HOLD: |
354 | mLoadingMotions.addData(motion); | 330 | mLoadingMotions.insert(motion); |
355 | break; | 331 | break; |
356 | case LLMotion::STATUS_SUCCESS: | 332 | case LLMotion::STATUS_SUCCESS: |
357 | // add motion to our list | 333 | // add motion to our list |
@@ -470,10 +446,11 @@ void LLMotionController::updateMotionsByType(LLMotion::LLMotionBlendType anim_ty | |||
470 | memset(&last_joint_signature, 0, sizeof(U8) * LL_CHARACTER_MAX_JOINTS); | 446 | memset(&last_joint_signature, 0, sizeof(U8) * LL_CHARACTER_MAX_JOINTS); |
471 | 447 | ||
472 | // iterate through active motions in chronological order | 448 | // iterate through active motions in chronological order |
473 | for(LLMotion* motionp = mActiveMotions.getFirstData(); | 449 | for (motion_list_t::iterator iter = mActiveMotions.begin(); |
474 | motionp != NULL; | 450 | iter != mActiveMotions.end(); ) |
475 | motionp = mActiveMotions.getNextData()) | ||
476 | { | 451 | { |
452 | motion_list_t::iterator curiter = iter++; | ||
453 | LLMotion* motionp = *curiter; | ||
477 | if (motionp->getBlendType() != anim_type) | 454 | if (motionp->getBlendType() != anim_type) |
478 | { | 455 | { |
479 | continue; | 456 | continue; |
@@ -487,9 +464,8 @@ void LLMotionController::updateMotionsByType(LLMotion::LLMotionBlendType anim_ty | |||
487 | } | 464 | } |
488 | else | 465 | else |
489 | { | 466 | { |
490 | S32 i; | ||
491 | // NUM_JOINT_SIGNATURE_STRIDES should be multiple of 4 | 467 | // NUM_JOINT_SIGNATURE_STRIDES should be multiple of 4 |
492 | for (i = 0; i < NUM_JOINT_SIGNATURE_STRIDES; i++) | 468 | for (S32 i = 0; i < NUM_JOINT_SIGNATURE_STRIDES; i++) |
493 | { | 469 | { |
494 | U32 *current_signature = (U32*)&(mJointSignature[0][i * 4]); | 470 | U32 *current_signature = (U32*)&(mJointSignature[0][i * 4]); |
495 | U32 test_signature = *(U32*)&(motionp->mJointSignature[0][i * 4]); | 471 | U32 test_signature = *(U32*)&(motionp->mJointSignature[0][i * 4]); |
@@ -745,16 +721,15 @@ void LLMotionController::updateMotion() | |||
745 | } | 721 | } |
746 | 722 | ||
747 | // query pending motions for completion | 723 | // query pending motions for completion |
748 | LLMotion* motionp; | 724 | for (motion_set_t::iterator iter = mLoadingMotions.begin(); |
749 | 725 | iter != mLoadingMotions.end(); ) | |
750 | for ( motionp = mLoadingMotions.getFirstData(); | ||
751 | motionp != NULL; | ||
752 | motionp = mLoadingMotions.getNextData() ) | ||
753 | { | 726 | { |
727 | motion_set_t::iterator curiter = iter++; | ||
728 | LLMotion* motionp = *curiter; | ||
754 | LLMotion::LLMotionInitStatus status = motionp->onInitialize(mCharacter); | 729 | LLMotion::LLMotionInitStatus status = motionp->onInitialize(mCharacter); |
755 | if (status == LLMotion::STATUS_SUCCESS) | 730 | if (status == LLMotion::STATUS_SUCCESS) |
756 | { | 731 | { |
757 | mLoadingMotions.removeCurrentData(); | 732 | mLoadingMotions.erase(curiter); |
758 | // add motion to our loaded motion list | 733 | // add motion to our loaded motion list |
759 | addLoadedMotion(motionp); | 734 | addLoadedMotion(motionp); |
760 | // this motion should be playing | 735 | // this motion should be playing |
@@ -767,7 +742,7 @@ void LLMotionController::updateMotion() | |||
767 | { | 742 | { |
768 | llinfos << "Motion " << motionp->getID() << " init failed." << llendl; | 743 | llinfos << "Motion " << motionp->getID() << " init failed." << llendl; |
769 | sRegistry.markBad(motionp->getID()); | 744 | sRegistry.markBad(motionp->getID()); |
770 | mLoadingMotions.removeCurrentData(); | 745 | mLoadingMotions.erase(curiter); |
771 | mAllMotions.erase(motionp->getID()); | 746 | mAllMotions.erase(motionp->getID()); |
772 | delete motionp; | 747 | delete motionp; |
773 | } | 748 | } |
@@ -804,7 +779,7 @@ void LLMotionController::updateMotion() | |||
804 | //----------------------------------------------------------------------------- | 779 | //----------------------------------------------------------------------------- |
805 | BOOL LLMotionController::activateMotion(LLMotion *motion, F32 time) | 780 | BOOL LLMotionController::activateMotion(LLMotion *motion, F32 time) |
806 | { | 781 | { |
807 | if (mLoadingMotions.checkData(motion)) | 782 | if (mLoadingMotions.find(motion) != mLoadingMotions.end()) |
808 | { | 783 | { |
809 | // we want to start this motion, but we can't yet, so flag it as started | 784 | // we want to start this motion, but we can't yet, so flag it as started |
810 | motion->setStopped(FALSE); | 785 | motion->setStopped(FALSE); |
@@ -835,7 +810,8 @@ BOOL LLMotionController::activateMotion(LLMotion *motion, F32 time) | |||
835 | motion->mSendStopTimestamp = F32_MAX; | 810 | motion->mSendStopTimestamp = F32_MAX; |
836 | } | 811 | } |
837 | 812 | ||
838 | mActiveMotions.addData(motion); | 813 | mActiveMotions.remove(motion); // in case it is already in the active list |
814 | mActiveMotions.push_front(motion); | ||
839 | 815 | ||
840 | motion->activate(); | 816 | motion->activate(); |
841 | motion->onUpdate(0.f, mJointSignature[1]); | 817 | motion->onUpdate(0.f, mJointSignature[1]); |
@@ -849,7 +825,7 @@ BOOL LLMotionController::activateMotion(LLMotion *motion, F32 time) | |||
849 | BOOL LLMotionController::deactivateMotion(LLMotion *motion) | 825 | BOOL LLMotionController::deactivateMotion(LLMotion *motion) |
850 | { | 826 | { |
851 | motion->deactivate(); | 827 | motion->deactivate(); |
852 | mActiveMotions.removeData(motion); | 828 | mActiveMotions.remove(motion); |
853 | 829 | ||
854 | return TRUE; | 830 | return TRUE; |
855 | } | 831 | } |
@@ -857,22 +833,17 @@ BOOL LLMotionController::deactivateMotion(LLMotion *motion) | |||
857 | //----------------------------------------------------------------------------- | 833 | //----------------------------------------------------------------------------- |
858 | // isMotionActive() | 834 | // isMotionActive() |
859 | //----------------------------------------------------------------------------- | 835 | //----------------------------------------------------------------------------- |
860 | BOOL LLMotionController::isMotionActive(LLMotion *motion) | 836 | bool LLMotionController::isMotionActive(LLMotion *motion) |
861 | { | 837 | { |
862 | if (motion && motion->isActive()) | 838 | return (motion && motion->isActive()); |
863 | { | ||
864 | return TRUE; | ||
865 | } | ||
866 | |||
867 | return FALSE; | ||
868 | } | 839 | } |
869 | 840 | ||
870 | //----------------------------------------------------------------------------- | 841 | //----------------------------------------------------------------------------- |
871 | // isMotionLoading() | 842 | // isMotionLoading() |
872 | //----------------------------------------------------------------------------- | 843 | //----------------------------------------------------------------------------- |
873 | BOOL LLMotionController::isMotionLoading(LLMotion* motion) | 844 | bool LLMotionController::isMotionLoading(LLMotion* motion) |
874 | { | 845 | { |
875 | return mLoadingMotions.checkData(motion); | 846 | return (mLoadingMotions.find(motion) != mLoadingMotions.end()); |
876 | } | 847 | } |
877 | 848 | ||
878 | 849 | ||
@@ -890,15 +861,15 @@ LLMotion *LLMotionController::findMotion(const LLUUID& id) | |||
890 | //----------------------------------------------------------------------------- | 861 | //----------------------------------------------------------------------------- |
891 | void LLMotionController::flushAllMotions() | 862 | void LLMotionController::flushAllMotions() |
892 | { | 863 | { |
893 | LLDynamicArray<LLUUID> active_motions; | 864 | std::vector<std::pair<LLUUID,F32> > active_motions; |
894 | LLDynamicArray<F32> active_motion_times; | 865 | active_motions.reserve(mActiveMotions.size()); |
895 | 866 | for (motion_list_t::iterator iter = mActiveMotions.begin(); | |
896 | for (LLMotion* motionp = mActiveMotions.getFirstData(); | 867 | iter != mActiveMotions.end(); ) |
897 | motionp; | ||
898 | motionp = mActiveMotions.getNextData()) | ||
899 | { | 868 | { |
900 | active_motions.put(motionp->getID()); | 869 | motion_list_t::iterator curiter = iter++; |
901 | active_motion_times.put(mTime - motionp->mActivationTimestamp); | 870 | LLMotion* motionp = *curiter; |
871 | F32 dtime = mTime - motionp->mActivationTimestamp; | ||
872 | active_motions.push_back(std::make_pair(motionp->getID(),dtime)); | ||
902 | motionp->deactivate(); | 873 | motionp->deactivate(); |
903 | } | 874 | } |
904 | 875 | ||
@@ -910,9 +881,10 @@ void LLMotionController::flushAllMotions() | |||
910 | mCharacter->removeAnimationData("Hand Pose"); | 881 | mCharacter->removeAnimationData("Hand Pose"); |
911 | 882 | ||
912 | // restart motions | 883 | // restart motions |
913 | for (S32 i = 0; i < active_motions.count(); i++) | 884 | for (std::vector<std::pair<LLUUID,F32> >::iterator iter = active_motions.begin(); |
885 | iter != active_motions.end(); ++iter) | ||
914 | { | 886 | { |
915 | startMotion(active_motions[i], active_motion_times[i]); | 887 | startMotion(iter->first, iter->second); |
916 | } | 888 | } |
917 | } | 889 | } |
918 | 890 | ||
diff --git a/linden/indra/llcharacter/llmotioncontroller.h b/linden/indra/llcharacter/llmotioncontroller.h index c9ee7c4..e4c7b3f 100644 --- a/linden/indra/llcharacter/llmotioncontroller.h +++ b/linden/indra/llcharacter/llmotioncontroller.h | |||
@@ -4,6 +4,7 @@ | |||
4 | * | 4 | * |
5 | * Copyright (c) 2001-2007, Linden Research, Inc. | 5 | * Copyright (c) 2001-2007, Linden Research, Inc. |
6 | * | 6 | * |
7 | * Second Life Viewer Source Code | ||
7 | * The source code in this file ("Source Code") is provided by Linden Lab | 8 | * The source code in this file ("Source Code") is provided by Linden Lab |
8 | * to you under the terms of the GNU General Public License, version 2.0 | 9 | * to you under the terms of the GNU General Public License, version 2.0 |
9 | * ("GPL"), unless you have obtained a separate licensing agreement | 10 | * ("GPL"), unless you have obtained a separate licensing agreement |
@@ -35,7 +36,6 @@ | |||
35 | #include <map> | 36 | #include <map> |
36 | #include <deque> | 37 | #include <deque> |
37 | 38 | ||
38 | #include "linked_lists.h" | ||
39 | #include "lluuidhashmap.h" | 39 | #include "lluuidhashmap.h" |
40 | #include "llmotion.h" | 40 | #include "llmotion.h" |
41 | #include "llpose.h" | 41 | #include "llpose.h" |
@@ -109,6 +109,10 @@ protected: | |||
109 | class LLMotionController | 109 | class LLMotionController |
110 | { | 110 | { |
111 | public: | 111 | public: |
112 | typedef std::list<LLMotion*> motion_list_t; | ||
113 | typedef std::set<LLMotion*> motion_set_t; | ||
114 | |||
115 | public: | ||
112 | // Constructor | 116 | // Constructor |
113 | LLMotionController(); | 117 | LLMotionController(); |
114 | 118 | ||
@@ -164,12 +168,11 @@ public: | |||
164 | void setTimeFactor(F32 time_factor); | 168 | void setTimeFactor(F32 time_factor); |
165 | F32 getTimeFactor() { return mTimeFactor; } | 169 | F32 getTimeFactor() { return mTimeFactor; } |
166 | 170 | ||
167 | LLMotion* getFirstActiveMotion(); | 171 | motion_list_t& getActiveMotions() { return mActiveMotions; } |
168 | LLMotion* getNextActiveMotion(); | ||
169 | 172 | ||
170 | //protected: | 173 | //protected: |
171 | BOOL isMotionActive( LLMotion *motion ); | 174 | bool isMotionActive( LLMotion *motion ); |
172 | BOOL isMotionLoading( LLMotion *motion ); | 175 | bool isMotionLoading( LLMotion *motion ); |
173 | LLMotion *findMotion( const LLUUID& id ); | 176 | LLMotion *findMotion( const LLUUID& id ); |
174 | 177 | ||
175 | protected: | 178 | protected: |
@@ -199,9 +202,9 @@ protected: | |||
199 | 202 | ||
200 | std::map<LLUUID, LLMotion*> mAllMotions; | 203 | std::map<LLUUID, LLMotion*> mAllMotions; |
201 | 204 | ||
202 | LLLinkedList<LLMotion> mLoadingMotions; | 205 | motion_set_t mLoadingMotions; |
203 | std::deque<LLMotion*> mLoadedMotions; | 206 | motion_list_t mLoadedMotions; |
204 | LLLinkedList<LLMotion> mActiveMotions; | 207 | motion_list_t mActiveMotions; |
205 | 208 | ||
206 | LLFrameTimer mTimer; | 209 | LLFrameTimer mTimer; |
207 | F32 mTime; | 210 | F32 mTime; |
diff --git a/linden/indra/llcharacter/llmultigesture.cpp b/linden/indra/llcharacter/llmultigesture.cpp index 80cbacb..0a4d99a 100644 --- a/linden/indra/llcharacter/llmultigesture.cpp +++ b/linden/indra/llcharacter/llmultigesture.cpp | |||
@@ -4,6 +4,7 @@ | |||
4 | * | 4 | * |
5 | * Copyright (c) 2004-2007, Linden Research, Inc. | 5 | * Copyright (c) 2004-2007, Linden Research, Inc. |
6 | * | 6 | * |
7 | * Second Life Viewer Source Code | ||
7 | * The source code in this file ("Source Code") is provided by Linden Lab | 8 | * The source code in this file ("Source Code") is provided by Linden Lab |
8 | * to you under the terms of the GNU General Public License, version 2.0 | 9 | * to you under the terms of the GNU General Public License, version 2.0 |
9 | * ("GPL"), unless you have obtained a separate licensing agreement | 10 | * ("GPL"), unless you have obtained a separate licensing agreement |
@@ -469,7 +470,7 @@ std::string LLGestureStepWait::getLabel() const | |||
469 | if (mFlags & WAIT_FLAG_TIME) | 470 | if (mFlags & WAIT_FLAG_TIME) |
470 | { | 471 | { |
471 | char buffer[64]; /* Flawfinder: ignore */ | 472 | char buffer[64]; /* Flawfinder: ignore */ |
472 | snprintf(buffer, sizeof(buffer), "%.1f seconds", (double)mWaitSeconds); /* Flawfinder: ignore */ | 473 | snprintf(buffer, sizeof(buffer), "%.1f seconds", (double)mWaitSeconds); /* Flawfinder: ignore */ |
473 | label += buffer; | 474 | label += buffer; |
474 | } | 475 | } |
475 | else if (mFlags & WAIT_FLAG_ALL_ANIM) | 476 | else if (mFlags & WAIT_FLAG_ALL_ANIM) |
diff --git a/linden/indra/llcharacter/llmultigesture.h b/linden/indra/llcharacter/llmultigesture.h index aeb7c04..75e5db8 100644 --- a/linden/indra/llcharacter/llmultigesture.h +++ b/linden/indra/llcharacter/llmultigesture.h | |||
@@ -4,6 +4,7 @@ | |||
4 | * | 4 | * |
5 | * Copyright (c) 2004-2007, Linden Research, Inc. | 5 | * Copyright (c) 2004-2007, Linden Research, Inc. |
6 | * | 6 | * |
7 | * Second Life Viewer Source Code | ||
7 | * The source code in this file ("Source Code") is provided by Linden Lab | 8 | * The source code in this file ("Source Code") is provided by Linden Lab |
8 | * to you under the terms of the GNU General Public License, version 2.0 | 9 | * to you under the terms of the GNU General Public License, version 2.0 |
9 | * ("GPL"), unless you have obtained a separate licensing agreement | 10 | * ("GPL"), unless you have obtained a separate licensing agreement |
diff --git a/linden/indra/llcharacter/llpose.cpp b/linden/indra/llcharacter/llpose.cpp index ebf6a67..ccedc1e 100644 --- a/linden/indra/llcharacter/llpose.cpp +++ b/linden/indra/llcharacter/llpose.cpp | |||
@@ -4,6 +4,7 @@ | |||
4 | * | 4 | * |
5 | * Copyright (c) 2001-2007, Linden Research, Inc. | 5 | * Copyright (c) 2001-2007, Linden Research, Inc. |
6 | * | 6 | * |
7 | * Second Life Viewer Source Code | ||
7 | * The source code in this file ("Source Code") is provided by Linden Lab | 8 | * The source code in this file ("Source Code") is provided by Linden Lab |
8 | * to you under the terms of the GNU General Public License, version 2.0 | 9 | * to you under the terms of the GNU General Public License, version 2.0 |
9 | * ("GPL"), unless you have obtained a separate licensing agreement | 10 | * ("GPL"), unless you have obtained a separate licensing agreement |
@@ -34,6 +35,7 @@ | |||
34 | 35 | ||
35 | #include "llmotion.h" | 36 | #include "llmotion.h" |
36 | #include "llmath.h" | 37 | #include "llmath.h" |
38 | #include "llstl.h" | ||
37 | 39 | ||
38 | //----------------------------------------------------------------------------- | 40 | //----------------------------------------------------------------------------- |
39 | // Static | 41 | // Static |
@@ -457,7 +459,7 @@ LLPoseBlender::LLPoseBlender() | |||
457 | 459 | ||
458 | LLPoseBlender::~LLPoseBlender() | 460 | LLPoseBlender::~LLPoseBlender() |
459 | { | 461 | { |
460 | mJointStateBlenderPool.deleteAllData(); | 462 | for_each(mJointStateBlenderPool.begin(), mJointStateBlenderPool.end(), DeletePairedPointer()); |
461 | } | 463 | } |
462 | 464 | ||
463 | //----------------------------------------------------------------------------- | 465 | //----------------------------------------------------------------------------- |
@@ -471,15 +473,16 @@ BOOL LLPoseBlender::addMotion(LLMotion* motion) | |||
471 | { | 473 | { |
472 | LLJoint *jointp = jsp->getJoint(); | 474 | LLJoint *jointp = jsp->getJoint(); |
473 | LLJointStateBlender* joint_blender; | 475 | LLJointStateBlender* joint_blender; |
474 | if (!mJointStateBlenderPool.checkData(jointp)) | 476 | if (mJointStateBlenderPool.find(jointp) == mJointStateBlenderPool.end()) |
475 | { | 477 | { |
476 | // this is the first time we are animating this joint | 478 | // this is the first time we are animating this joint |
477 | // so create new jointblender and add it to our pool | 479 | // so create new jointblender and add it to our pool |
478 | joint_blender = new LLJointStateBlender(); | 480 | joint_blender = new LLJointStateBlender(); |
479 | mJointStateBlenderPool.addData(jointp, joint_blender); | 481 | mJointStateBlenderPool[jointp] = joint_blender; |
480 | } else | 482 | } |
483 | else | ||
481 | { | 484 | { |
482 | joint_blender = mJointStateBlenderPool.getData(jointp); | 485 | joint_blender = mJointStateBlenderPool[jointp]; |
483 | } | 486 | } |
484 | 487 | ||
485 | if (jsp->getPriority() == LLJoint::USE_MOTION_PRIORITY) | 488 | if (jsp->getPriority() == LLJoint::USE_MOTION_PRIORITY) |
@@ -492,9 +495,9 @@ BOOL LLPoseBlender::addMotion(LLMotion* motion) | |||
492 | } | 495 | } |
493 | 496 | ||
494 | // add it to our list of active blenders | 497 | // add it to our list of active blenders |
495 | if(!mActiveBlenders.checkData(joint_blender)) | 498 | if (std::find(mActiveBlenders.begin(), mActiveBlenders.end(), joint_blender) == mActiveBlenders.end()) |
496 | { | 499 | { |
497 | mActiveBlenders.addData(joint_blender); | 500 | mActiveBlenders.push_front(joint_blender); |
498 | } | 501 | } |
499 | } | 502 | } |
500 | return TRUE; | 503 | return TRUE; |
@@ -505,15 +508,15 @@ BOOL LLPoseBlender::addMotion(LLMotion* motion) | |||
505 | //----------------------------------------------------------------------------- | 508 | //----------------------------------------------------------------------------- |
506 | void LLPoseBlender::blendAndApply() | 509 | void LLPoseBlender::blendAndApply() |
507 | { | 510 | { |
508 | for (LLJointStateBlender* jsbp = mActiveBlenders.getFirstData(); | 511 | for (blender_list_t::iterator iter = mActiveBlenders.begin(); |
509 | jsbp; | 512 | iter != mActiveBlenders.end(); ++iter) |
510 | jsbp = mActiveBlenders.getNextData()) | ||
511 | { | 513 | { |
514 | LLJointStateBlender* jsbp = *iter; | ||
512 | jsbp->blendJointStates(); | 515 | jsbp->blendJointStates(); |
513 | } | 516 | } |
514 | 517 | ||
515 | // we're done now so there are no more active blenders for this frame | 518 | // we're done now so there are no more active blenders for this frame |
516 | mActiveBlenders.removeAllNodes(); | 519 | mActiveBlenders.clear(); |
517 | } | 520 | } |
518 | 521 | ||
519 | //----------------------------------------------------------------------------- | 522 | //----------------------------------------------------------------------------- |
@@ -521,10 +524,10 @@ void LLPoseBlender::blendAndApply() | |||
521 | //----------------------------------------------------------------------------- | 524 | //----------------------------------------------------------------------------- |
522 | void LLPoseBlender::blendAndCache(BOOL reset_cached_joints) | 525 | void LLPoseBlender::blendAndCache(BOOL reset_cached_joints) |
523 | { | 526 | { |
524 | for (LLJointStateBlender* jsbp = mActiveBlenders.getFirstData(); | 527 | for (blender_list_t::iterator iter = mActiveBlenders.begin(); |
525 | jsbp; | 528 | iter != mActiveBlenders.end(); ++iter) |
526 | jsbp = mActiveBlenders.getNextData()) | ||
527 | { | 529 | { |
530 | LLJointStateBlender* jsbp = *iter; | ||
528 | if (reset_cached_joints) | 531 | if (reset_cached_joints) |
529 | { | 532 | { |
530 | jsbp->resetCachedJoint(); | 533 | jsbp->resetCachedJoint(); |
@@ -538,10 +541,10 @@ void LLPoseBlender::blendAndCache(BOOL reset_cached_joints) | |||
538 | //----------------------------------------------------------------------------- | 541 | //----------------------------------------------------------------------------- |
539 | void LLPoseBlender::interpolate(F32 u) | 542 | void LLPoseBlender::interpolate(F32 u) |
540 | { | 543 | { |
541 | for (LLJointStateBlender* jsbp = mActiveBlenders.getFirstData(); | 544 | for (blender_list_t::iterator iter = mActiveBlenders.begin(); |
542 | jsbp; | 545 | iter != mActiveBlenders.end(); ++iter) |
543 | jsbp = mActiveBlenders.getNextData()) | ||
544 | { | 546 | { |
547 | LLJointStateBlender* jsbp = *iter; | ||
545 | jsbp->interpolate(u); | 548 | jsbp->interpolate(u); |
546 | } | 549 | } |
547 | } | 550 | } |
@@ -551,13 +554,13 @@ void LLPoseBlender::interpolate(F32 u) | |||
551 | //----------------------------------------------------------------------------- | 554 | //----------------------------------------------------------------------------- |
552 | void LLPoseBlender::clearBlenders() | 555 | void LLPoseBlender::clearBlenders() |
553 | { | 556 | { |
554 | for (LLJointStateBlender* jsbp = mActiveBlenders.getFirstData(); | 557 | for (blender_list_t::iterator iter = mActiveBlenders.begin(); |
555 | jsbp; | 558 | iter != mActiveBlenders.end(); ++iter) |
556 | jsbp = mActiveBlenders.getNextData()) | ||
557 | { | 559 | { |
560 | LLJointStateBlender* jsbp = *iter; | ||
558 | jsbp->clear(); | 561 | jsbp->clear(); |
559 | } | 562 | } |
560 | 563 | ||
561 | mActiveBlenders.removeAllNodes(); | 564 | mActiveBlenders.clear(); |
562 | } | 565 | } |
563 | 566 | ||
diff --git a/linden/indra/llcharacter/llpose.h b/linden/indra/llcharacter/llpose.h index 12d1640..f57f7de 100644 --- a/linden/indra/llcharacter/llpose.h +++ b/linden/indra/llcharacter/llpose.h | |||
@@ -4,6 +4,7 @@ | |||
4 | * | 4 | * |
5 | * Copyright (c) 2001-2007, Linden Research, Inc. | 5 | * Copyright (c) 2001-2007, Linden Research, Inc. |
6 | * | 6 | * |
7 | * Second Life Viewer Source Code | ||
7 | * The source code in this file ("Source Code") is provided by Linden Lab | 8 | * The source code in this file ("Source Code") is provided by Linden Lab |
8 | * to you under the terms of the GNU General Public License, version 2.0 | 9 | * to you under the terms of the GNU General Public License, version 2.0 |
9 | * ("GPL"), unless you have obtained a separate licensing agreement | 10 | * ("GPL"), unless you have obtained a separate licensing agreement |
@@ -106,8 +107,10 @@ class LLMotion; | |||
106 | class LLPoseBlender | 107 | class LLPoseBlender |
107 | { | 108 | { |
108 | protected: | 109 | protected: |
109 | LLMap<LLJoint*,LLJointStateBlender*> mJointStateBlenderPool; | 110 | typedef std::list<LLJointStateBlender*> blender_list_t; |
110 | LLLinkedList<LLJointStateBlender> mActiveBlenders; | 111 | typedef std::map<LLJoint*,LLJointStateBlender*> blender_map_t; |
112 | blender_map_t mJointStateBlenderPool; | ||
113 | blender_list_t mActiveBlenders; | ||
111 | 114 | ||
112 | S32 mNextPoseSlot; | 115 | S32 mNextPoseSlot; |
113 | LLPose mBlendedPose; | 116 | LLPose mBlendedPose; |
diff --git a/linden/indra/llcharacter/llstatemachine.cpp b/linden/indra/llcharacter/llstatemachine.cpp index 6920bcf..1ad81be 100644 --- a/linden/indra/llcharacter/llstatemachine.cpp +++ b/linden/indra/llcharacter/llstatemachine.cpp | |||
@@ -4,6 +4,7 @@ | |||
4 | * | 4 | * |
5 | * Copyright (c) 2001-2007, Linden Research, Inc. | 5 | * Copyright (c) 2001-2007, Linden Research, Inc. |
6 | * | 6 | * |
7 | * Second Life Viewer Source Code | ||
7 | * The source code in this file ("Source Code") is provided by Linden Lab | 8 | * The source code in this file ("Source Code") is provided by Linden Lab |
8 | * to you under the terms of the GNU General Public License, version 2.0 | 9 | * to you under the terms of the GNU General Public License, version 2.0 |
9 | * ("GPL"), unless you have obtained a separate licensing agreement | 10 | * ("GPL"), unless you have obtained a separate licensing agreement |
diff --git a/linden/indra/llcharacter/llstatemachine.h b/linden/indra/llcharacter/llstatemachine.h index 0f986bd..091662e 100644 --- a/linden/indra/llcharacter/llstatemachine.h +++ b/linden/indra/llcharacter/llstatemachine.h | |||
@@ -4,6 +4,7 @@ | |||
4 | * | 4 | * |
5 | * Copyright (c) 2001-2007, Linden Research, Inc. | 5 | * Copyright (c) 2001-2007, Linden Research, Inc. |
6 | * | 6 | * |
7 | * Second Life Viewer Source Code | ||
7 | * The source code in this file ("Source Code") is provided by Linden Lab | 8 | * The source code in this file ("Source Code") is provided by Linden Lab |
8 | * to you under the terms of the GNU General Public License, version 2.0 | 9 | * to you under the terms of the GNU General Public License, version 2.0 |
9 | * ("GPL"), unless you have obtained a separate licensing agreement | 10 | * ("GPL"), unless you have obtained a separate licensing agreement |
diff --git a/linden/indra/llcharacter/lltargetingmotion.cpp b/linden/indra/llcharacter/lltargetingmotion.cpp index 799e4d0..9e8b8df 100644 --- a/linden/indra/llcharacter/lltargetingmotion.cpp +++ b/linden/indra/llcharacter/lltargetingmotion.cpp | |||
@@ -4,6 +4,7 @@ | |||
4 | * | 4 | * |
5 | * Copyright (c) 2001-2007, Linden Research, Inc. | 5 | * Copyright (c) 2001-2007, Linden Research, Inc. |
6 | * | 6 | * |
7 | * Second Life Viewer Source Code | ||
7 | * The source code in this file ("Source Code") is provided by Linden Lab | 8 | * The source code in this file ("Source Code") is provided by Linden Lab |
8 | * to you under the terms of the GNU General Public License, version 2.0 | 9 | * to you under the terms of the GNU General Public License, version 2.0 |
9 | * ("GPL"), unless you have obtained a separate licensing agreement | 10 | * ("GPL"), unless you have obtained a separate licensing agreement |
diff --git a/linden/indra/llcharacter/lltargetingmotion.h b/linden/indra/llcharacter/lltargetingmotion.h index 9fd8391..a6a6b03 100644 --- a/linden/indra/llcharacter/lltargetingmotion.h +++ b/linden/indra/llcharacter/lltargetingmotion.h | |||
@@ -4,6 +4,7 @@ | |||
4 | * | 4 | * |
5 | * Copyright (c) 2002-2007, Linden Research, Inc. | 5 | * Copyright (c) 2002-2007, Linden Research, Inc. |
6 | * | 6 | * |
7 | * Second Life Viewer Source Code | ||
7 | * The source code in this file ("Source Code") is provided by Linden Lab | 8 | * The source code in this file ("Source Code") is provided by Linden Lab |
8 | * to you under the terms of the GNU General Public License, version 2.0 | 9 | * to you under the terms of the GNU General Public License, version 2.0 |
9 | * ("GPL"), unless you have obtained a separate licensing agreement | 10 | * ("GPL"), unless you have obtained a separate licensing agreement |
diff --git a/linden/indra/llcharacter/llvisualparam.cpp b/linden/indra/llcharacter/llvisualparam.cpp index ed8a034..de163eb 100644 --- a/linden/indra/llcharacter/llvisualparam.cpp +++ b/linden/indra/llcharacter/llvisualparam.cpp | |||
@@ -4,6 +4,7 @@ | |||
4 | * | 4 | * |
5 | * Copyright (c) 2001-2007, Linden Research, Inc. | 5 | * Copyright (c) 2001-2007, Linden Research, Inc. |
6 | * | 6 | * |
7 | * Second Life Viewer Source Code | ||
7 | * The source code in this file ("Source Code") is provided by Linden Lab | 8 | * The source code in this file ("Source Code") is provided by Linden Lab |
8 | * to you under the terms of the GNU General Public License, version 2.0 | 9 | * to you under the terms of the GNU General Public License, version 2.0 |
9 | * ("GPL"), unless you have obtained a separate licensing agreement | 10 | * ("GPL"), unless you have obtained a separate licensing agreement |
diff --git a/linden/indra/llcharacter/llvisualparam.h b/linden/indra/llcharacter/llvisualparam.h index 74774b8..ec19fa0 100644 --- a/linden/indra/llcharacter/llvisualparam.h +++ b/linden/indra/llcharacter/llvisualparam.h | |||
@@ -4,6 +4,7 @@ | |||
4 | * | 4 | * |
5 | * Copyright (c) 2001-2007, Linden Research, Inc. | 5 | * Copyright (c) 2001-2007, Linden Research, Inc. |
6 | * | 6 | * |
7 | * Second Life Viewer Source Code | ||
7 | * The source code in this file ("Source Code") is provided by Linden Lab | 8 | * The source code in this file ("Source Code") is provided by Linden Lab |
8 | * to you under the terms of the GNU General Public License, version 2.0 | 9 | * to you under the terms of the GNU General Public License, version 2.0 |
9 | * ("GPL"), unless you have obtained a separate licensing agreement | 10 | * ("GPL"), unless you have obtained a separate licensing agreement |