Skip to content
Snippets Groups Projects
Commit d87d8338 authored by Rye Mutt's avatar Rye Mutt :bread:
Browse files

Add variant of unpackVolumeFaces that accepts a char* buffer to avoid...

Add variant of unpackVolumeFaces that accepts a char* buffer to avoid additional malloc for input/output
parent 62740169
No related branches found
No related tags found
No related merge requests found
...@@ -2374,7 +2374,25 @@ bool LLVolume::unpackVolumeFaces(std::istream& is, S32 size) ...@@ -2374,7 +2374,25 @@ bool LLVolume::unpackVolumeFaces(std::istream& is, S32 size)
LL_DEBUGS("MeshStreaming") << "Failed to unzip LLSD blob for LoD with code " << uzip_result << " , will probably fetch from sim again." << LL_ENDL; LL_DEBUGS("MeshStreaming") << "Failed to unzip LLSD blob for LoD with code " << uzip_result << " , will probably fetch from sim again." << LL_ENDL;
return false; return false;
} }
return unpackVolumeFacesInternal(mdl);
}
bool LLVolume::unpackVolumeFaces(U8* in_data, S32 size)
{
//input stream is now pointing at a zlib compressed block of LLSD
//decompress block
LLSD mdl;
U32 uzip_result = LLUZipHelper::unzip_llsd(mdl, in_data, size);
if (uzip_result != LLUZipHelper::ZR_OK)
{
LL_DEBUGS("MeshStreaming") << "Failed to unzip LLSD blob for LoD with code " << uzip_result << " , will probably fetch from sim again." << LL_ENDL;
return false;
}
return unpackVolumeFacesInternal(mdl);
}
bool LLVolume::unpackVolumeFacesInternal(const LLSD& mdl)
{
{ {
U32 face_count = mdl.size(); U32 face_count = mdl.size();
......
...@@ -1086,6 +1086,11 @@ class LLVolume : public LLRefCount ...@@ -1086,6 +1086,11 @@ class LLVolume : public LLRefCount
void createVolumeFaces(); void createVolumeFaces();
public: public:
bool unpackVolumeFaces(std::istream& is, S32 size); bool unpackVolumeFaces(std::istream& is, S32 size);
bool unpackVolumeFaces(U8* in_data, S32 size);
private:
bool unpackVolumeFacesInternal(const LLSD& mdl);
public:
void setMeshAssetLoaded(BOOL loaded); void setMeshAssetLoaded(BOOL loaded);
BOOL isMeshAssetLoaded(); BOOL isMeshAssetLoaded();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment