summaryrefslogtreecommitdiff
path: root/indra/llprimitive
diff options
context:
space:
mode:
Diffstat (limited to 'indra/llprimitive')
-rw-r--r--indra/llprimitive/lldaeloader.cpp22
-rw-r--r--indra/llprimitive/llprimitive.cpp2
2 files changed, 20 insertions, 4 deletions
diff --git a/indra/llprimitive/lldaeloader.cpp b/indra/llprimitive/lldaeloader.cpp
index d73bdd7693..8401cb976e 100644
--- a/indra/llprimitive/lldaeloader.cpp
+++ b/indra/llprimitive/lldaeloader.cpp
@@ -305,6 +305,8 @@ LLModel::EModelStatus load_face_from_dom_triangles(std::vector<LLVolumeFace>& fa
}
face = LLVolumeFace();
+ face.mExtents[0].set(v[0], v[1], v[2]);
+ face.mExtents[1].set(v[0], v[1], v[2]);
point_map.clear();
}
}
@@ -549,6 +551,8 @@ LLModel::EModelStatus load_face_from_dom_polylist(std::vector<LLVolumeFace>& fac
}
face = LLVolumeFace();
+ face.mExtents[0].set(v[0], v[1], v[2]);
+ face.mExtents[1].set(v[0], v[1], v[2]);
verts.clear();
indices.clear();
point_map.clear();
@@ -855,17 +859,29 @@ struct ModelSort
bool LLDAELoader::OpenFile(const std::string& filename)
{
+ setLoadState( READING_FILE );
+
//no suitable slm exists, load from the .dae file
+
+ // Collada expects file and folder names to be escaped
+ // Note: cdom::nativePathToUri()
+ const char* allowed =
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
+ "abcdefghijklmnopqrstuvwxyz"
+ "0123456789"
+ "%-._~:\"|\\/";
+ std::string uri_filename = LLURI::escape(filename, allowed);
+
DAE dae;
domCOLLADA* dom;
if (mPreprocessDAE)
{
- dom = dae.openFromMemory(filename, preprocessDAE(filename).c_str());
+ dom = dae.openFromMemory(uri_filename, preprocessDAE(filename).c_str());
}
else
{
LL_INFOS() << "Skipping dae preprocessing" << LL_ENDL;
- dom = dae.open(filename);
+ dom = dae.open(uri_filename);
}
if (!dom)
@@ -894,7 +910,7 @@ bool LLDAELoader::OpenFile(const std::string& filename)
daeInt count = db->getElementCount(NULL, COLLADA_TYPE_MESH);
- daeDocument* doc = dae.getDoc(filename);
+ daeDocument* doc = dae.getDoc(uri_filename);
if (!doc)
{
LL_WARNS() << "can't find internal doc" << LL_ENDL;
diff --git a/indra/llprimitive/llprimitive.cpp b/indra/llprimitive/llprimitive.cpp
index 186716609c..bfa65666b5 100644
--- a/indra/llprimitive/llprimitive.cpp
+++ b/indra/llprimitive/llprimitive.cpp
@@ -172,7 +172,7 @@ LLPrimitive::~LLPrimitive()
{
clearTextureList();
// Cleanup handled by volume manager
- if (mVolumep)
+ if (mVolumep && sVolumeManager)
{
sVolumeManager->unrefVolume(mVolumep);
}