summaryrefslogtreecommitdiff
path: root/indra/llmath
diff options
context:
space:
mode:
Diffstat (limited to 'indra/llmath')
-rw-r--r--indra/llmath/llvolume.cpp34
1 files changed, 9 insertions, 25 deletions
diff --git a/indra/llmath/llvolume.cpp b/indra/llmath/llvolume.cpp
index c4be176353..7a2f06da8f 100644
--- a/indra/llmath/llvolume.cpp
+++ b/indra/llmath/llvolume.cpp
@@ -2162,7 +2162,7 @@ BOOL LLVolume::createVolumeFacesFromStream(std::istream& is)
LLSD header;
{
- if (!LLSDSerialize::deserialize(header, is, 1024*1024*1024))
+ if (!LLSDSerialize::fromBinary(header, is, 1024*1024*1024))
{
llwarns << "Mesh header parse error. Not a valid mesh asset!" << llendl;
return FALSE;
@@ -2174,34 +2174,18 @@ BOOL LLVolume::createVolumeFacesFromStream(std::istream& is)
"lowest_lod",
"low_lod",
"medium_lod",
- "high_lod"
+ "high_lod",
+ "physics_shape",
};
- S32 lod = llclamp((S32) mDetail, 0, 3);
+ const S32 MODEL_LODS = 5;
- while (lod < 4 &&
- (header[nm[lod]]["offset"].asInteger() == -1 ||
- header[nm[lod]]["size"].asInteger() == 0 ))
- {
- ++lod;
- }
-
- if (lod >= 4)
- {
- lod = llclamp((S32) mDetail, 0, 3);
+ S32 lod = llclamp((S32) mDetail, 0, MODEL_LODS);
- while (lod >= 0 &&
- (header[nm[lod]]["offset"].asInteger() == -1 ||
- header[nm[lod]]["size"].asInteger() == 0) )
- {
- --lod;
- }
-
- if (lod < 0)
- {
- llwarns << "Mesh header missing LOD offsets. Not a valid mesh asset!" << llendl;
- return FALSE;
- }
+ if (header[nm[lod]]["offset"].asInteger() == -1 ||
+ header[nm[lod]]["size"].asInteger() == 0 )
+ { //cannot load requested LOD
+ return FALSE;
}
is.seekg(header[nm[lod]]["offset"].asInteger(), std::ios_base::cur);