diff options
| author | Dave Parks <davep@lindenlab.com> | 2011-03-22 17:23:48 -0500 | 
|---|---|---|
| committer | Dave Parks <davep@lindenlab.com> | 2011-03-22 17:23:48 -0500 | 
| commit | 6ff87e2840c585711e2927028a11ba5ce78a192a (patch) | |
| tree | ef91c0fe1d81a9e338ee16dd98d759f6980d113a /indra/llmath | |
| parent | 51a4867ae6bcf0ec71882ba77b1c995d98834126 (diff) | |
SH-1169 Import from slm instead of dae when appropriate.
Diffstat (limited to 'indra/llmath')
| -rw-r--r-- | indra/llmath/llvolume.cpp | 34 | 
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);
 | 
