diff options
author | Andrey Lihatskiy <alihatskiy@productengine.com> | 2022-01-10 23:51:52 +0200 |
---|---|---|
committer | Andrey Lihatskiy <alihatskiy@productengine.com> | 2022-01-10 23:51:52 +0200 |
commit | 469ce7f7f6828aa8ed8d45fdff82cb33c1ec655d (patch) | |
tree | 6ec74d5dbe9c278663a99212cddf808e87d4e6c6 /indra/llmath/llvolume.cpp | |
parent | 83b4ea59fc8793ccbfb6b40ffff111de14ebd4d3 (diff) | |
parent | ee2d618706a8803372b92dbe47a165c70be6cef9 (diff) |
Merge branch 'DRTVWR-530-maint' into DRTVWR-553-maint-mix-JK
# Conflicts:
# indra/newview/app_settings/key_bindings.xml
# indra/newview/llappviewer.cpp
# indra/newview/llkeyconflict.cpp
Diffstat (limited to 'indra/llmath/llvolume.cpp')
-rw-r--r-- | indra/llmath/llvolume.cpp | 29 |
1 files changed, 15 insertions, 14 deletions
diff --git a/indra/llmath/llvolume.cpp b/indra/llmath/llvolume.cpp index 62b39d29a4..13b65dfaa0 100644 --- a/indra/llmath/llvolume.cpp +++ b/indra/llmath/llvolume.cpp @@ -5316,22 +5316,23 @@ bool LLVolumeFace::cacheOptimize() { triangle_data.resize(mNumIndices / 3); vertex_data.resize(mNumVertices); - } - catch (std::bad_alloc&) - { - LL_WARNS("LLVOLUME") << "Resize failed" << LL_ENDL; - return false; - } - for (U32 i = 0; i < mNumIndices; i++) - { //populate vertex data and triangle data arrays - U16 idx = mIndices[i]; - U32 tri_idx = i/3; + for (U32 i = 0; i < mNumIndices; i++) + { //populate vertex data and triangle data arrays + U16 idx = mIndices[i]; + U32 tri_idx = i / 3; - vertex_data[idx].mTriangles.push_back(&(triangle_data[tri_idx])); - vertex_data[idx].mIdx = idx; - triangle_data[tri_idx].mVertex[i%3] = &(vertex_data[idx]); - } + vertex_data[idx].mTriangles.push_back(&(triangle_data[tri_idx])); + vertex_data[idx].mIdx = idx; + triangle_data[tri_idx].mVertex[i % 3] = &(vertex_data[idx]); + } + } + catch (std::bad_alloc&) + { + // resize or push_back failed + LL_WARNS("LLVOLUME") << "Resize for " << mNumVertices << " vertices failed" << LL_ENDL; + return false; + } /*F32 pre_acmr = 1.f; //measure cache misses from before rebuild |