summaryrefslogtreecommitdiff
path: root/indra/newview/gltf/asset.cpp
diff options
context:
space:
mode:
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 24df41c6b3..a399a59f40 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);
}