Преглед изворни кода

Properly check for valid vertex descriptor for morph meshes

BearishSun пре 9 година
родитељ
комит
e26feb2393
1 измењених фајлова са 3 додато и 1 уклоњено
  1. 3 1
      Source/RenderBeast/Source/BsRenderBeast.cpp

+ 3 - 1
Source/RenderBeast/Source/BsRenderBeast.cpp

@@ -187,11 +187,13 @@ namespace BansheeEngine
 							// If using morph shapes ignore POSITION1 and NORMAL1 missing since we assign them from within the renderer
 							if(animType == RenderableAnimType::Morph || animType == RenderableAnimType::SkinnedMorph)
 							{
-								std::remove_if(missingElements.begin(), missingElements.end(), [](const VertexElement& x)
+								auto removeIter = std::remove_if(missingElements.begin(), missingElements.end(), [](const VertexElement& x)
 								{
 									return (x.getSemantic() == VES_POSITION && x.getSemanticIdx() == 1) ||
 										(x.getSemantic() == VES_NORMAL && x.getSemanticIdx() == 1);
 								});
+
+								missingElements.erase(removeIter, missingElements.end());
 							}
 
 							if (!missingElements.empty())