summaryrefslogtreecommitdiff
path: root/indra/llprimitive
diff options
context:
space:
mode:
Diffstat (limited to 'indra/llprimitive')
-rw-r--r--indra/llprimitive/CMakeLists.txt22
-rw-r--r--indra/llprimitive/lldaeloader.h2
-rw-r--r--indra/llprimitive/llgltfmaterial.h1
-rw-r--r--indra/llprimitive/llmodel.h2
-rw-r--r--indra/llprimitive/llmodelloader.cpp2
-rw-r--r--indra/llprimitive/llprimitive.cpp4
-rw-r--r--indra/llprimitive/llprimtexturelist.cpp11
-rw-r--r--indra/llprimitive/llprimtexturelist.h2
8 files changed, 33 insertions, 13 deletions
diff --git a/indra/llprimitive/CMakeLists.txt b/indra/llprimitive/CMakeLists.txt
index 3d8e02cb16..e9f9e06e1f 100644
--- a/indra/llprimitive/CMakeLists.txt
+++ b/indra/llprimitive/CMakeLists.txt
@@ -3,6 +3,7 @@
project(llprimitive)
include(00-Common)
+include(Prebuilt)
include(LLCommon)
include(LLCoreHttp)
include(LLPhysicsExtensions)
@@ -10,6 +11,25 @@ include(LLPrimitive)
include(GLM)
include(TinyGLTF)
+if(LINUX OR CMAKE_SYSTEM_NAME MATCHES FreeBSD )
+ prepare_thirdparty(
+ "https://github.com/secondlife/3p-colladadom/archive/refs/tags/v2.3-r7.tar.gz"
+ "colladadom-v2.3-r7.tar.gz"
+ "3p-colladadom-2.3-r7"
+ "collada-dom-v2.3-r7.patch"
+ "0d7a13531eb0de8c617b48af90c3b5b22c2a0b566069d1a0c36f9602dbfeb9ebab1516556e6dda34645d63354c3c6539375d7e5b8c0b36baba11312d18a3c705"
+ )
+ set(OPT_COLLADA14 TRUE)
+ add_subdirectory(
+ "${CMAKE_SOURCE_DIR}/../../3p-colladadom-2.3-r7" "colladadom")
+ target_include_directories(
+ ll::colladadom INTERFACE
+ ${colladadom_SOURCE_DIR}/include
+ ${colladadom_SOURCE_DIR}/include/1.4
+ )
+ target_link_libraries( ll::colladadom INTERFACE collada14dom )
+endif(LINUX OR CMAKE_SYSTEM_NAME MATCHES FreeBSD )
+
set(llprimitive_SOURCE_FILES
lldaeloader.cpp
llgltfloader.cpp
@@ -72,6 +92,8 @@ target_link_libraries(llprimitive
ll::glm
)
+include(LibraryInstall)
+
#add unit tests
if (LL_TESTS)
INCLUDE(LLAddBuildTest)
diff --git a/indra/llprimitive/lldaeloader.h b/indra/llprimitive/lldaeloader.h
index 4531e03474..c6e5ea42fc 100644
--- a/indra/llprimitive/lldaeloader.h
+++ b/indra/llprimitive/lldaeloader.h
@@ -29,6 +29,7 @@
#include "llmodelloader.h"
+#ifndef LL_USESYSTEMLIBS
class DAE;
class daeElement;
class domProfile_COMMON;
@@ -38,6 +39,7 @@ class domTranslate;
class domController;
class domSkin;
class domMesh;
+#endif
class LLDAELoader : public LLModelLoader
{
diff --git a/indra/llprimitive/llgltfmaterial.h b/indra/llprimitive/llgltfmaterial.h
index 10df4c8ee1..b89853c9fd 100644
--- a/indra/llprimitive/llgltfmaterial.h
+++ b/indra/llprimitive/llgltfmaterial.h
@@ -36,6 +36,7 @@
#include <array>
#include <string>
+#include <array>
#include <map>
namespace tinygltf
diff --git a/indra/llprimitive/llmodel.h b/indra/llprimitive/llmodel.h
index fe28926720..309c5df64c 100644
--- a/indra/llprimitive/llmodel.h
+++ b/indra/llprimitive/llmodel.h
@@ -35,8 +35,10 @@
#include <boost/align/aligned_allocator.hpp>
+#ifndef LL_USESYSTEMLIBS
class daeElement;
class domMesh;
+#endif
#define MAX_MODEL_FACES 8
diff --git a/indra/llprimitive/llmodelloader.cpp b/indra/llprimitive/llmodelloader.cpp
index 7facd53a72..84adec4da5 100644
--- a/indra/llprimitive/llmodelloader.cpp
+++ b/indra/llprimitive/llmodelloader.cpp
@@ -58,7 +58,7 @@ static void stretch_extents(const LLModel* model, const LLMatrix4a& mat, LLVecto
center.setAdd(face.mExtents[0], face.mExtents[1]);
center.mul(0.5f);
LLVector4a size;
- size.setSub(face.mExtents[1],face.mExtents[0]);
+ size.setSub(face.mExtents[1], face.mExtents[0]);
size.mul(0.5f);
for (U32 i = 0; i < 8; i++)
diff --git a/indra/llprimitive/llprimitive.cpp b/indra/llprimitive/llprimitive.cpp
index c5d6076b98..c116f69a6d 100644
--- a/indra/llprimitive/llprimitive.cpp
+++ b/indra/llprimitive/llprimitive.cpp
@@ -274,7 +274,7 @@ void LLPrimitive::setAllTETextures(const LLUUID &tex_id)
//===============================================================
void LLPrimitive::setTE(const U8 index, const LLTextureEntry& te)
{
- if(mTextureList.copyTexture(index, te) != TEM_CHANGE_NONE && te.getBumpmap() > 0)
+ if(mTextureList.copyTexture(index, &te) != TEM_CHANGE_NONE && te.getBumpmap() > 0)
{
mNumBumpmapTEs++;
}
@@ -753,7 +753,7 @@ void LLPrimitive::copyTEs(const LLPrimitive *primitivep)
}
for (i = 0; i < num_tes; i++)
{
- mTextureList.copyTexture(i, *(primitivep->getTE(i)));
+ mTextureList.copyTexture(i, primitivep->getTE(i));
}
}
diff --git a/indra/llprimitive/llprimtexturelist.cpp b/indra/llprimitive/llprimtexturelist.cpp
index 68f3f5ffac..7f60d8025a 100644
--- a/indra/llprimitive/llprimtexturelist.cpp
+++ b/indra/llprimitive/llprimtexturelist.cpp
@@ -125,7 +125,7 @@ void LLPrimTextureList::take(LLPrimTextureList& other_list)
// virtual
// copies LLTextureEntry 'te'
// returns TEM_CHANGE_TEXTURE if successful, otherwise TEM_CHANGE_NONE
-S32 LLPrimTextureList::copyTexture(const U8 index, const LLTextureEntry& te)
+S32 LLPrimTextureList::copyTexture(const U8 index, const LLTextureEntry* te)
{
if (size_t(index) >= mEntryList.size())
{
@@ -137,14 +137,7 @@ S32 LLPrimTextureList::copyTexture(const U8 index, const LLTextureEntry& te)
// we're changing an existing entry
llassert(mEntryList[index]);
delete (mEntryList[index]);
- if (&te)
- {
- mEntryList[index] = te.newCopy();
- }
- else
- {
- mEntryList[index] = LLPrimTextureList::newTextureEntry();
- }
+ mEntryList[index] = te->newCopy();
return TEM_CHANGE_TEXTURE;
}
diff --git a/indra/llprimitive/llprimtexturelist.h b/indra/llprimitive/llprimtexturelist.h
index 79744e9f08..b8bdad60b3 100644
--- a/indra/llprimitive/llprimtexturelist.h
+++ b/indra/llprimitive/llprimtexturelist.h
@@ -71,7 +71,7 @@ public:
// copies LLTextureEntry 'te'
// returns TEM_CHANGE_TEXTURE if successful, otherwise TEM_CHANGE_NONE
- S32 copyTexture(const U8 index, const LLTextureEntry& te);
+ S32 copyTexture(const U8 index, const LLTextureEntry* te);
// takes ownership of LLTextureEntry* 'te'
// returns TEM_CHANGE_TEXTURE if successful, otherwise TEM_CHANGE_NONE