From 045ef96c222b65394921fadff630cdfb7739242c Mon Sep 17 00:00:00 2001 From: Porteries Tristan Date: Thu, 28 Apr 2016 08:30:51 +0000 Subject: [PATCH] UPBGE: Fix alpha sort with modifier. Modifier deformer doesn't create a RAS_DisplayArray which mean that we can't sort polygons with a modifier mesh. --- source/gameengine/Rasterizer/RAS_MeshObject.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/source/gameengine/Rasterizer/RAS_MeshObject.cpp b/source/gameengine/Rasterizer/RAS_MeshObject.cpp index 010cd8b06ad4..728c981df15e 100644 --- a/source/gameengine/Rasterizer/RAS_MeshObject.cpp +++ b/source/gameengine/Rasterizer/RAS_MeshObject.cpp @@ -496,6 +496,11 @@ void RAS_MeshObject::SortPolygons(RAS_MeshSlot *ms, const MT_Transform &transfor RAS_DisplayArray *array = ms->GetDisplayArray(); + // If there's no vertex array it means that the we're using modifier deformer. + if (!array) { + return; + } + unsigned int nvert = 3; unsigned int totpoly = array->m_index.size() / nvert;