From 18b0aa03717cd8209b6c239457bcf69f0d39ecf7 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Thu, 16 Jun 2022 16:16:53 -0500 Subject: SL-17619 Add support for embedded textures to GLTF importer --- indra/llimage/llimage.cpp | 9 +++++++++ indra/llimage/llimage.h | 1 + 2 files changed, 10 insertions(+) (limited to 'indra/llimage') diff --git a/indra/llimage/llimage.cpp b/indra/llimage/llimage.cpp index 0fa027c9c3..ad7124b5aa 100644 --- a/indra/llimage/llimage.cpp +++ b/indra/llimage/llimage.cpp @@ -815,6 +815,15 @@ LLImageRaw::LLImageRaw(U16 width, U16 height, S8 components) ++sRawImageCount; } +LLImageRaw::LLImageRaw(const U8* data, U16 width, U16 height, S8 components) + : LLImageBase() +{ + if (allocateDataSize(width, height, components)) + { + memcpy(getData(), data, width * height * components); + } +} + LLImageRaw::LLImageRaw(U8 *data, U16 width, U16 height, S8 components, bool no_copy) : LLImageBase() { diff --git a/indra/llimage/llimage.h b/indra/llimage/llimage.h index 7a588cfb03..59c192d9f8 100644 --- a/indra/llimage/llimage.h +++ b/indra/llimage/llimage.h @@ -184,6 +184,7 @@ protected: public: LLImageRaw(); LLImageRaw(U16 width, U16 height, S8 components); + LLImageRaw(const U8* data, U16 width, U16 height, S8 components); LLImageRaw(U8 *data, U16 width, U16 height, S8 components, bool no_copy = false); // Construct using createFromFile (used by tools) //LLImageRaw(const std::string& filename, bool j2c_lowest_mip_only = false); -- cgit v1.2.3