summaryrefslogtreecommitdiff
path: root/indra/llprimitive/lldaeloader.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/llprimitive/lldaeloader.cpp')
-rw-r--r--indra/llprimitive/lldaeloader.cpp48
1 files changed, 24 insertions, 24 deletions
diff --git a/indra/llprimitive/lldaeloader.cpp b/indra/llprimitive/lldaeloader.cpp
index 4f47f16e33..544db36b50 100644
--- a/indra/llprimitive/lldaeloader.cpp
+++ b/indra/llprimitive/lldaeloader.cpp
@@ -935,12 +935,20 @@ bool LLDAELoader::OpenFile(const std::string& filename)
domCOLLADA* dom;
if (mPreprocessDAE)
{
+#if __FreeBSD__ || (LL_USESYSTEMLIBS && LL_LINUX)
+ dom = static_cast<domCOLLADA *>(dae.openFromMemory(uri_filename, preprocessDAE(filename).c_str()));
+#else
dom = dae.openFromMemory(uri_filename, preprocessDAE(filename).c_str());
+#endif
}
else
{
LL_INFOS() << "Skipping dae preprocessing" << LL_ENDL;
+#if __FreeBSD__ || (LL_USESYSTEMLIBS && LL_LINUX)
+ dom = static_cast<domCOLLADA *>(dae.open(uri_filename));
+#else
dom = dae.open(uri_filename);
+#endif
}
if (!dom)
@@ -1114,19 +1122,17 @@ bool LLDAELoader::OpenFile(const std::string& filename)
if (skin)
{
- domGeometry* geom = daeSafeCast<domGeometry>(skin->getSource().getElement());
-
- if (geom)
+ if (domGeometry* geom = daeSafeCast<domGeometry>(skin->getSource().getElement()))
{
- domMesh* mesh = geom->getMesh();
- if (mesh)
+ if (domMesh* mesh = geom->getMesh())
{
- std::vector< LLPointer< LLModel > >::iterator i = mModelsMap[mesh].begin();
- while (i != mModelsMap[mesh].end())
+ dae_model_map::const_iterator it = mModelsMap.find(mesh);
+ if (it != mModelsMap.end())
{
- LLPointer<LLModel> mdl = *i;
- LLDAELoader::processDomModel(mdl, &dae, root, mesh, skin);
- i++;
+ for (const LLPointer<LLModel>& model : it->second)
+ {
+ LLDAELoader::processDomModel(model, &dae, root, mesh, skin);
+ }
}
}
}
@@ -1296,6 +1302,7 @@ void LLDAELoader::processDomModel(LLModel* model, DAE* dae, daeElement* root, do
}
}
else
+ {
//Has one or more skeletons
for (std::vector<domInstance_controller::domSkeleton*>::iterator skel_it = skeletons.begin();
skel_it != skeletons.end(); ++skel_it)
@@ -1380,6 +1387,7 @@ void LLDAELoader::processDomModel(LLModel* model, DAE* dae, daeElement* root, do
}
}//got skeleton?
}
+ }
domSkin::domJoints* joints = skin->getJoints();
@@ -1680,7 +1688,7 @@ void LLDAELoader::processDomModel(LLModel* model, DAE* dae, daeElement* root, do
materials[model->mMaterialList[i]] = LLImportMaterial();
}
mScene[transformation].push_back(LLModelInstance(model, model->mLabel, transformation, materials));
- stretch_extents(model, transformation, mExtents[0], mExtents[1], mFirstTransform);
+ stretch_extents(model, transformation);
}
}
@@ -2073,21 +2081,14 @@ void LLDAELoader::processElement( daeElement* element, bool& badElement, DAE* da
mTransform.condition();
}
- domInstance_geometry* instance_geo = daeSafeCast<domInstance_geometry>(element);
- if (instance_geo)
+ if (domInstance_geometry* instance_geo = daeSafeCast<domInstance_geometry>(element))
{
- domGeometry* geo = daeSafeCast<domGeometry>(instance_geo->getUrl().getElement());
- if (geo)
+ if (domGeometry* geo = daeSafeCast<domGeometry>(instance_geo->getUrl().getElement()))
{
- domMesh* mesh = daeSafeCast<domMesh>(geo->getDescendant(daeElement::matchType(domMesh::ID())));
- if (mesh)
+ if (domMesh* mesh = daeSafeCast<domMesh>(geo->getDescendant(daeElement::matchType(domMesh::ID()))))
{
-
- std::vector< LLPointer< LLModel > >::iterator i = mModelsMap[mesh].begin();
- while (i != mModelsMap[mesh].end())
+ for (LLModel* model : mModelsMap.find(mesh)->second)
{
- LLModel* model = *i;
-
LLMatrix4 transformation = mTransform;
if (mTransform.determinant() < 0)
@@ -2158,8 +2159,7 @@ void LLDAELoader::processElement( daeElement* element, bool& badElement, DAE* da
}
mScene[transformation].push_back(LLModelInstance(model, label, transformation, materials));
- stretch_extents(model, transformation, mExtents[0], mExtents[1], mFirstTransform);
- i++;
+ stretch_extents(model, transformation);
}
}
}