diff options
author | Brad Linden <brad@lindenlab.com> | 2024-06-10 16:22:12 -0700 |
---|---|---|
committer | Brad Linden <brad@lindenlab.com> | 2024-06-10 16:22:12 -0700 |
commit | 7c42711ca3a4e67b95473aa5129dce5ff19bea15 (patch) | |
tree | 593c0bedf07bffc79ec4640b157839edf61260f5 /indra/newview/llgltfmateriallist.cpp | |
parent | e0e6e7fd747121442370fc811c84aa34ed612f64 (diff) | |
parent | 9f6b8484dfb7dfa981d8a8ac3693d3f68e32bc12 (diff) |
Merge remote-tracking branch 'origin/DRTVWR-600-maint-A' into project/gltf_development
Diffstat (limited to 'indra/newview/llgltfmateriallist.cpp')
-rw-r--r-- | indra/newview/llgltfmateriallist.cpp | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/indra/newview/llgltfmateriallist.cpp b/indra/newview/llgltfmateriallist.cpp index 133e8e8599..215f3dd3a7 100644 --- a/indra/newview/llgltfmateriallist.cpp +++ b/indra/newview/llgltfmateriallist.cpp @@ -73,7 +73,7 @@ static bool is_valid_update(const LLSD& data) ++count; } else - { + { LL_WARNS() << "Missing required parameter: object_id" << LL_ENDL; return false; } @@ -93,7 +93,7 @@ static bool is_valid_update(const LLSD& data) ++count; } else - { + { LL_WARNS() << "Missing required parameter: side" << LL_ENDL; return false; } @@ -119,7 +119,7 @@ static bool is_valid_update(const LLSD& data) } if (count < 3) - { + { LL_WARNS() << "Only specified object_id and side, update won't actually change anything and is just noise" << LL_ENDL; return false; } @@ -173,7 +173,7 @@ void LLGLTFMaterialList::applyOverrideMessage(LLMessageSystem* msg, const std::s LLSDSerialize::fromNotation(data, str, data_in.length()); const LLHost& host = msg->getSender(); - + LLViewerRegion* region = LLWorld::instance().getRegion(host); llassert(region); @@ -199,14 +199,14 @@ void LLGLTFMaterialList::applyOverrideMessage(LLMessageSystem* msg, const std::s bool has_te[MAX_TES] = { false }; if (tes.isArray()) // NOTE: if no "te" array exists, this is a malformed message (null out all overrides will come in as an empty te array) - { + { LLGLTFOverrideCacheEntry cache; cache.mLocalId = local_id; cache.mObjectId = id; cache.mRegionHandle = region->getHandle(); - U32 count = llmin(tes.size(), MAX_TES); - for (U32 i = 0; i < count; ++i) + auto count = llmin(tes.size(), MAX_TES); + for (size_t i = 0; i < count; ++i) { LLGLTFMaterial* mat = new LLGLTFMaterial(); // setTEGLTFMaterialOverride and cache will take ownership mat->applyOverrideLLSD(od[i]); @@ -252,7 +252,7 @@ void LLGLTFMaterialList::queueOverrideUpdate(const LLUUID& id, S32 side, LLGLTFM { #if 0 override_list_t& overrides = mQueuedOverrides[id]; - + if (overrides.size() < side + 1) { overrides.resize(side + 1); @@ -372,7 +372,7 @@ void LLGLTFMaterialList::queueUpdate(const LLSD& data) { sUpdates = LLSD::emptyArray(); } - + sUpdates[sUpdates.size()] = data; } @@ -380,7 +380,7 @@ void LLGLTFMaterialList::flushUpdates(void(*done_callback)(bool)) { LLSD& data = sUpdates; - S32 i = data.size(); + auto i = data.size(); for (ModifyMaterialData& e : sModifyQueue) { @@ -392,7 +392,7 @@ void LLGLTFMaterialList::flushUpdates(void(*done_callback)(bool)) data[i]["object_id"] = e.object_id; data[i]["side"] = e.side; - + if (e.has_override) { data[i]["gltf_json"] = e.override_data.asJSON(); @@ -491,7 +491,7 @@ void LLGLTFMaterialList::onAssetLoadComplete(const LLUUID& id, LLAssetType::ETyp } buffer.resize(size); - file.read((U8*)&buffer[0], buffer.size()); + file.read((U8*)&buffer[0], static_cast<S32>(buffer.size())); } { @@ -500,7 +500,7 @@ void LLGLTFMaterialList::onAssetLoadComplete(const LLUUID& id, LLAssetType::ETyp LLSD asset; // read file into buffer - std::istrstream str(&buffer[0], buffer.size()); + std::istrstream str(&buffer[0], static_cast<S32>(buffer.size())); if (LLSDSerialize::deserialize(asset, str, buffer.size())) { @@ -517,7 +517,7 @@ void LLGLTFMaterialList::onAssetLoadComplete(const LLUUID& id, LLAssetType::ETyp LL_PROFILE_ZONE_SCOPED; tinygltf::TinyGLTF gltf; - if (!gltf.LoadASCIIFromString(&asset_data->mModelIn, &error_msg, &warn_msg, data.c_str(), data.length(), "")) + if (!gltf.LoadASCIIFromString(&asset_data->mModelIn, &error_msg, &warn_msg, data.c_str(), static_cast<U32>(data.length()), "")) { LL_WARNS("GLTF") << "Failed to decode material asset: " << LL_NEWLINE @@ -578,7 +578,7 @@ LLFetchedGLTFMaterial* LLGLTFMaterialList::getMaterial(const LLUUID& id) gAssetStorage->getAssetData(id, LLAssetType::AT_MATERIAL, onAssetLoadComplete, (void*)user_data); } - + return mat; } |