diff --git a/Source/Engine/Graphics/View.cpp b/Source/Engine/Graphics/View.cpp index 8e1d6462b..39b606772 100644 --- a/Source/Engine/Graphics/View.cpp +++ b/Source/Engine/Graphics/View.cpp @@ -853,8 +853,6 @@ void View::GetBatches() Drawable* drawable = *k; if (!drawable->IsInView(frame_, true)) { - // May be called from multiple threads, so don't manipulate the Drawable's viewCameras set, - // just update the frame number drawable->MarkInView(frame_.frameNumber_, 0); shadowGeometries_.Push(drawable); } diff --git a/Source/Tools/OgreImporter/OgreImporter.cpp b/Source/Tools/OgreImporter/OgreImporter.cpp index f40155fa5..cfacb7284 100644 --- a/Source/Tools/OgreImporter/OgreImporter.cpp +++ b/Source/Tools/OgreImporter/OgreImporter.cpp @@ -1057,15 +1057,18 @@ void OptimizeIndices(ModelSubGeometryLodLevel* subGeom, ModelVertexBuffer* vb, M PODVector oldTriangles; PODVector newTriangles; + if (subGeom->indexCount_ % 3) + { + PrintLine("Index count is not divisible by 3, skipping index optimization"); + return; + } + for (unsigned i = 0; i < vb->vertices_.Size(); ++i) { vb->vertices_[i].useCount_ = 0; vb->vertices_[i].cachePosition_ = -1; } - if (subGeom->indexCount_ % 3) - ErrorExit("Index count is not divisible by 3"); - for (unsigned i = subGeom->indexStart_; i < subGeom->indexStart_ + subGeom->indexCount_; i += 3) { Triangle triangle; @@ -1105,7 +1108,10 @@ void OptimizeIndices(ModelSubGeometryLodLevel* subGeom, ModelVertexBuffer* vb, M } if (bestTriangle == M_MAX_UNSIGNED) - ErrorExit("Could not find next triangle"); + { + PrintLine("Could not find next triangle, aborting index optimization"); + return; + } // Add the best triangle Triangle triangleCopy = oldTriangles[bestTriangle];