Skip to content
Snippets Groups Projects
Commit 74a9bf4f authored by David Parks's avatar David Parks
Browse files

Merge branch 'DRTVWR-559' of github.com:secondlife/viewer into DRTVWR-559

parents 8032aa20 77ea8eed
No related branches found
No related tags found
No related merge requests found
...@@ -105,7 +105,7 @@ bool LLGLTFOverrideCacheEntry::fromLLSD(const LLSD& data) ...@@ -105,7 +105,7 @@ bool LLGLTFOverrideCacheEntry::fromLLSD(const LLSD& data)
std::string error, warn; std::string error, warn;
if (override_mat->fromJSON(gltf_json_str, warn, error)) if (override_mat->fromJSON(gltf_json_str, warn, error))
{ {
mGLTFMaterial[i] = override_mat; mGLTFMaterial[side_idx] = override_mat;
} }
else else
{ {
...@@ -126,6 +126,16 @@ bool LLGLTFOverrideCacheEntry::fromLLSD(const LLSD& data) ...@@ -126,6 +126,16 @@ bool LLGLTFOverrideCacheEntry::fromLLSD(const LLSD& data)
LL_WARNS_IF(sides.size() != 0, "GLTF") << "broken override cache entry" << LL_ENDL; LL_WARNS_IF(sides.size() != 0, "GLTF") << "broken override cache entry" << LL_ENDL;
} }
} }
llassert(mSides.size() == mGLTFMaterial.size());
#ifdef SHOW_ASSERT
for (auto const & side : mSides)
{
// check that mSides and mGLTFMaterial have exactly the same keys present
llassert(mGLTFMaterial.count(side.first) == 1);
}
#endif
return true; return true;
} }
...@@ -141,8 +151,11 @@ LLSD LLGLTFOverrideCacheEntry::toLLSD() const ...@@ -141,8 +151,11 @@ LLSD LLGLTFOverrideCacheEntry::toLLSD() const
data["object_id"] = mObjectId; data["object_id"] = mObjectId;
data["local_id"] = (LLSD::Integer) mLocalId; data["local_id"] = (LLSD::Integer) mLocalId;
llassert(mSides.size() == mGLTFMaterial.size());
for (auto const & side : mSides) for (auto const & side : mSides)
{ {
// check that mSides and mGLTFMaterial have exactly the same keys present
llassert(mGLTFMaterial.count(side.first) == 1);
data["sides"].append(LLSD::Integer(side.first)); data["sides"].append(LLSD::Integer(side.first));
data["gltf_json"].append(side.second); data["gltf_json"].append(side.second);
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment