diff options
author | Brad Linden <46733234+brad-linden@users.noreply.github.com> | 2023-04-19 09:41:07 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-04-19 09:41:07 -0700 |
commit | 45fdba8fd96ed714cbc0120b0a10a4c5b63ea706 (patch) | |
tree | 4b6704fd38b3355c10fd643409e6281487c85156 | |
parent | fcf9db88230a54b980a354faae9c2905b3b29582 (diff) |
Implement SL-19605 handling of batched material overrides in LargeGenericMessage (#177)
-rw-r--r-- | indra/newview/llgltfmateriallist.cpp | 56 |
1 files changed, 25 insertions, 31 deletions
diff --git a/indra/newview/llgltfmateriallist.cpp b/indra/newview/llgltfmateriallist.cpp index 08ce43434f..151d7fa969 100644 --- a/indra/newview/llgltfmateriallist.cpp +++ b/indra/newview/llgltfmateriallist.cpp @@ -162,49 +162,43 @@ public: LLSD message; - - sparam_t::const_iterator it = strings.begin(); - if (it != strings.end()) + bool success = true; + for(const std::string& llsdRaw : strings) { - const std::string& llsdRaw = *it++; std::istringstream llsdData(llsdRaw); if (!LLSDSerialize::deserialize(message, llsdData, llsdRaw.length())) { LL_WARNS() << "LLGLTFMaterialOverrideDispatchHandler: Attempted to read parameter data into LLSD but failed:" << llsdRaw << LL_ENDL; + success = false; + continue; } - } - else - { - // malformed message, nothing we can do to handle it - LL_DEBUGS("GLTF") << "Empty message" << LL_ENDL; - return false; - } - - LLGLTFOverrideCacheEntry object_override; - if (!object_override.fromLLSD(message)) - { - // malformed message, nothing we can do to handle it - LL_DEBUGS("GLTF") << "Message without id:" << message << LL_ENDL; - return false; - } - - // Cache the data - { - LL_DEBUGS("GLTF") << "material overrides cache" << LL_ENDL; - - LLViewerRegion * region = LLWorld::instance().getRegionFromHandle(object_override.mRegionHandle); - if (region) + LLGLTFOverrideCacheEntry object_override; + if (!object_override.fromLLSD(message)) { - region->cacheFullUpdateGLTFOverride(object_override); + // malformed message, nothing we can do to handle it + LL_DEBUGS("GLTF") << "Message without id:" << message << LL_ENDL; + success = false; + continue; } - else + + // Cache the data { - LL_WARNS("GLTF") << "could not access region for material overrides message cache, region_handle: " << LL_ENDL; + LLViewerRegion * region = LLWorld::instance().getRegionFromHandle(object_override.mRegionHandle); + + if (region) + { + region->cacheFullUpdateGLTFOverride(object_override); + } + else + { + LL_WARNS("GLTF") << "could not access region for material overrides message cache, region_handle: " << LL_ENDL; + } } + applyData(object_override); } - applyData(object_override); - return true; + + return success; } void doSelectionCallbacks(const LLUUID& object_id, S32 side) |