summaryrefslogtreecommitdiff
path: root/indra/newview/gltf/asset.cpp
diff options
context:
space:
mode:
authorBrad Linden <brad@lindenlab.com>2024-08-09 17:57:23 -0700
committerBrad Linden <brad@lindenlab.com>2024-08-09 17:57:23 -0700
commita7fde9d79c517bfc6165756c1bc3eb16fa4d935c (patch)
treef0608f7f72f23a447778f8bce6f210eb221ebdf1 /indra/newview/gltf/asset.cpp
parentac330f63fd7ac655bbd06ce5d4ed65430aa2f42a (diff)
parentc106221726c48a4231b7854bff224ae422c0517f (diff)
Merge remote-tracking branch release/2024.06-atlasaurus into 'develop'
Diffstat (limited to 'indra/newview/gltf/asset.cpp')
-rw-r--r--indra/newview/gltf/asset.cpp15
1 files changed, 11 insertions, 4 deletions
diff --git a/indra/newview/gltf/asset.cpp b/indra/newview/gltf/asset.cpp
index a454e68a92..c210b9c61d 100644
--- a/indra/newview/gltf/asset.cpp
+++ b/indra/newview/gltf/asset.cpp
@@ -105,7 +105,7 @@ void Node::updateTransforms(Asset& asset, const mat4& parentMatrix)
mAssetMatrixInv = glm::inverse(mAssetMatrix);
- S32 my_index = this - &asset.mNodes[0];
+ S32 my_index = (S32)(this - &asset.mNodes[0]);
for (auto& childIndex : mChildren)
{
@@ -271,11 +271,11 @@ S32 Asset::lineSegmentIntersect(const LLVector4a& start, const LLVector4a& end,
local_end = p;
// pointer math to get the node index
- node_hit = &node - &mNodes[0];
+ node_hit = (S32)(&node - &mNodes[0]);
llassert(&mNodes[node_hit] == &node);
//pointer math to get the primitive index
- primitive_hit = &primitive - &mesh.mPrimitives[0];
+ primitive_hit = (S32)(&primitive - &mesh.mPrimitives[0]);
llassert(&mesh.mPrimitives[primitive_hit] == &primitive);
}
}
@@ -476,6 +476,7 @@ void Asset::update()
{ // HACK - force texture to be loaded full rez
// TODO: calculate actual vsize
image.mTexture->addTextureStats(2048.f * 2048.f);
+ image.mTexture->setBoostLevel(LLViewerTexture::BOOST_HIGH);
}
}
}
@@ -990,6 +991,12 @@ bool Image::prep(Asset& asset)
return false;
}
+ if (!asset.mFilename.empty())
+ { // local preview, boost image so it doesn't discard and force to save raw image in case we save out or upload
+ mTexture->setBoostLevel(LLViewerTexture::BOOST_PREVIEW);
+ mTexture->forceToSaveRawImage(0, F32_MAX);
+ }
+
return true;
}
@@ -1027,7 +1034,7 @@ bool Image::save(Asset& asset, const std::string& folder)
const std::string& delim = gDirUtilp->getDirDelimiter();
if (name.empty())
{
- S32 idx = this - asset.mImages.data();
+ S32 idx = (S32)(this - asset.mImages.data());
name = llformat("image_%d", idx);
}