summaryrefslogtreecommitdiff
path: root/indra/llcharacter
diff options
context:
space:
mode:
authorBrad Payne (Vir Linden) <vir@lindenlab.com>2021-03-08 13:56:16 +0000
committerBrad Payne (Vir Linden) <vir@lindenlab.com>2021-03-08 13:56:16 +0000
commitc83e740ef94e16ba85574454f3138905edecb029 (patch)
tree6e10779ff7b2df5194a3df9d100ba28d53883166 /indra/llcharacter
parent2b385841f3031d599bdb226f0f859e51b09870f8 (diff)
Revert "Merge branch 'master' of https://bitbucket.org/lindenlab/viewer into DRTVWR-519"
This reverts commit e61f485a04dc8c8ac6bcf6a24848359092884d14, reversing changes made to 00c47d079f7e958e473ed4083a7f7691fa02dcd5.
Diffstat (limited to 'indra/llcharacter')
-rw-r--r--indra/llcharacter/CMakeLists.txt18
-rw-r--r--indra/llcharacter/llkeyframefallmotion.cpp5
-rw-r--r--indra/llcharacter/llkeyframemotion.cpp21
-rw-r--r--indra/llcharacter/llkeyframemotion.h12
4 files changed, 40 insertions, 16 deletions
diff --git a/indra/llcharacter/CMakeLists.txt b/indra/llcharacter/CMakeLists.txt
index d90ffb5543..a17a5b0aa6 100644
--- a/indra/llcharacter/CMakeLists.txt
+++ b/indra/llcharacter/CMakeLists.txt
@@ -6,14 +6,14 @@ include(00-Common)
include(LLCommon)
include(LLMath)
include(LLMessage)
-include(LLFileSystem)
+include(LLVFS)
include(LLXML)
include_directories(
${LLCOMMON_INCLUDE_DIRS}
${LLMATH_INCLUDE_DIRS}
${LLMESSAGE_INCLUDE_DIRS}
- ${LLFILESYSTEM_INCLUDE_DIRS}
+ ${LLVFS_INCLUDE_DIRS}
${LLXML_INCLUDE_DIRS}
)
include_directories(SYSTEM
@@ -85,6 +85,18 @@ target_link_libraries(
${LLCOMMON_LIBRARIES}
${LLMATH_LIBRARIES}
${LLMESSAGE_LIBRARIES}
- ${LLFILESYSTEM_LIBRARIES}
+ ${LLVFS_LIBRARIES}
${LLXML_LIBRARIES}
)
+
+
+# Add tests
+#if (LL_TESTS)
+# include(LLAddBuildTest)
+# # UNIT TESTS
+# SET(llcharacter_TEST_SOURCE_FILES
+# lljoint.cpp
+# )
+# LL_ADD_PROJECT_UNIT_TESTS(llcharacter "${llcharacter_TEST_SOURCE_FILES}")
+#endif (LL_TESTS)
+
diff --git a/indra/llcharacter/llkeyframefallmotion.cpp b/indra/llcharacter/llkeyframefallmotion.cpp
index 7842f0e5fb..60ab2e9929 100644
--- a/indra/llcharacter/llkeyframefallmotion.cpp
+++ b/indra/llcharacter/llkeyframefallmotion.cpp
@@ -70,11 +70,6 @@ LLMotion::LLMotionInitStatus LLKeyframeFallMotion::onInitialize(LLCharacter *cha
// load keyframe data, setup pose and joint states
LLMotion::LLMotionInitStatus result = LLKeyframeMotion::onInitialize(character);
- if (result != LLMotion::STATUS_SUCCESS)
- {
- return result;
- }
-
for (U32 jm=0; jm<mJointMotionList->getNumJointMotions(); jm++)
{
if (!mJointStates[jm]->getJoint())
diff --git a/indra/llcharacter/llkeyframemotion.cpp b/indra/llcharacter/llkeyframemotion.cpp
index fe9de30f0a..cde38c8091 100644
--- a/indra/llcharacter/llkeyframemotion.cpp
+++ b/indra/llcharacter/llkeyframemotion.cpp
@@ -39,13 +39,14 @@
#include "llendianswizzle.h"
#include "llkeyframemotion.h"
#include "llquantize.h"
+#include "llvfile.h"
#include "m3math.h"
#include "message.h"
-#include "llfilesystem.h"
//-----------------------------------------------------------------------------
// Static Definitions
//-----------------------------------------------------------------------------
+LLVFS* LLKeyframeMotion::sVFS = NULL;
LLKeyframeDataCache::keyframe_data_map_t LLKeyframeDataCache::sKeyframeDataMap;
//-----------------------------------------------------------------------------
@@ -514,7 +515,7 @@ LLMotion::LLMotionInitStatus LLKeyframeMotion::onInitialize(LLCharacter *charact
return STATUS_SUCCESS;
default:
// we don't know what state the asset is in yet, so keep going
- // check keyframe cache first then file cache then asset request
+ // check keyframe cache first then static vfs then asset request
break;
}
@@ -558,8 +559,13 @@ LLMotion::LLMotionInitStatus LLKeyframeMotion::onInitialize(LLCharacter *charact
U8 *anim_data;
S32 anim_file_size;
+ if (!sVFS)
+ {
+ LL_ERRS() << "Must call LLKeyframeMotion::setVFS() first before loading a keyframe file!" << LL_ENDL;
+ }
+
BOOL success = FALSE;
- LLFileSystem* anim_file = new LLFileSystem(mID, LLAssetType::AT_ANIMATION);
+ LLVFile* anim_file = new LLVFile(sVFS, mID, LLAssetType::AT_ANIMATION);
if (!anim_file || !anim_file->getSize())
{
delete anim_file;
@@ -2290,9 +2296,10 @@ void LLKeyframeMotion::setLoopOut(F32 out_point)
//-----------------------------------------------------------------------------
// onLoadComplete()
//-----------------------------------------------------------------------------
-void LLKeyframeMotion::onLoadComplete(const LLUUID& asset_uuid,
- LLAssetType::EType type,
- void* user_data, S32 status, LLExtStat ext_status)
+void LLKeyframeMotion::onLoadComplete(LLVFS *vfs,
+ const LLUUID& asset_uuid,
+ LLAssetType::EType type,
+ void* user_data, S32 status, LLExtStat ext_status)
{
LLUUID* id = (LLUUID*)user_data;
@@ -2324,7 +2331,7 @@ void LLKeyframeMotion::onLoadComplete(const LLUUID& asset_uuid,
// asset already loaded
return;
}
- LLFileSystem file(asset_uuid, type, LLFileSystem::READ);
+ LLVFile file(vfs, asset_uuid, type, LLVFile::READ);
S32 size = file.getSize();
U8* buffer = new U8[size];
diff --git a/indra/llcharacter/llkeyframemotion.h b/indra/llcharacter/llkeyframemotion.h
index d640556090..15c5c7c6c0 100644
--- a/indra/llcharacter/llkeyframemotion.h
+++ b/indra/llcharacter/llkeyframemotion.h
@@ -44,6 +44,7 @@
#include "llbvhconsts.h"
class LLKeyframeDataCache;
+class LLVFS;
class LLDataPacker;
#define MIN_REQUIRED_PIXEL_AREA_KEYFRAME (40.f)
@@ -140,7 +141,10 @@ public:
virtual void setStopTime(F32 time);
- static void onLoadComplete(const LLUUID& asset_uuid,
+ static void setVFS(LLVFS* vfs) { sVFS = vfs; }
+
+ static void onLoadComplete(LLVFS *vfs,
+ const LLUUID& asset_uuid,
LLAssetType::EType type,
void* user_data, S32 status, LLExtStat ext_status);
@@ -412,7 +416,13 @@ public:
U32 getNumJointMotions() const { return mJointMotionArray.size(); }
};
+
protected:
+ static LLVFS* sVFS;
+
+ //-------------------------------------------------------------------------
+ // Member Data
+ //-------------------------------------------------------------------------
JointMotionList* mJointMotionList;
std::vector<LLPointer<LLJointState> > mJointStates;
LLJoint* mPelvisp;