summaryrefslogtreecommitdiff
path: root/indra/llmath
diff options
context:
space:
mode:
authorRye Mutt <rye@alchemyviewer.org>2022-09-27 14:42:53 -0400
committerRye Mutt <rye@alchemyviewer.org>2022-09-27 17:59:21 -0400
commit1b31ab5c5279829ace4144c7495ad4f961c2f202 (patch)
treebe6e7e1684bae08cffb44605aeaa55a76e1b0f72 /indra/llmath
parente980999fb6d76089e224f32668cc4bde8f88dbaa (diff)
Introduce a U8* based interface to unzip_llsd and unpackVolumeFaces
Diffstat (limited to 'indra/llmath')
-rw-r--r--indra/llmath/llvolume.cpp20
-rw-r--r--indra/llmath/llvolume.h6
2 files changed, 24 insertions, 2 deletions
diff --git a/indra/llmath/llvolume.cpp b/indra/llmath/llvolume.cpp
index 93f1d508f3..91457fbebe 100644
--- a/indra/llmath/llvolume.cpp
+++ b/indra/llmath/llvolume.cpp
@@ -2391,7 +2391,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;
return false;
}
-
+ return unpackVolumeFacesInternal(mdl);
+}
+
+bool LLVolume::unpackVolumeFaces(U8* in_data, S32 size)
+{
+ //input data 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();
diff --git a/indra/llmath/llvolume.h b/indra/llmath/llvolume.h
index 9697952f5b..b53b0fd1cc 100644
--- a/indra/llmath/llvolume.h
+++ b/indra/llmath/llvolume.h
@@ -1096,8 +1096,12 @@ protected:
BOOL generate();
void createVolumeFaces();
public:
- virtual 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:
virtual void setMeshAssetLoaded(BOOL loaded);
virtual BOOL isMeshAssetLoaded();