From df17e52a0598d1555c52004aa6da23129a1e30b6 Mon Sep 17 00:00:00 2001 From: cutealien Date: Thu, 21 Apr 2022 21:11:48 +0000 Subject: [PATCH] CXMeshFileLoader: initialize normals (and other S3DVertex values ) to 0 when loading Thanks @sfan5 for patch in Minetest: https://github.com/minetest/irrlicht/commit/0500a7798bf2cb4d405dc792e1110ab3340124c1 Changed it slightly as more value were not initialized than just normals. Forum: https://irrlicht.sourceforge.io/forum/viewtopic.php?f=2&t=52819&p=306518#p306518 git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6354 dfc29bdd-3216-0410-991c-e03cc46cb475 --- source/Irrlicht/CXMeshFileLoader.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/source/Irrlicht/CXMeshFileLoader.cpp b/source/Irrlicht/CXMeshFileLoader.cpp index 30a043e2..4678c854 100644 --- a/source/Irrlicht/CXMeshFileLoader.cpp +++ b/source/Irrlicht/CXMeshFileLoader.cpp @@ -760,10 +760,12 @@ bool CXMeshFileLoader::parseDataObjectMesh(SXMesh &mesh) // read vertices mesh.Vertices.set_used(nVertices); + irr::video::S3DVertex vertex; // set_used doesn't call constructor, so we initalize it explicit here + vertex.Color = 0xFFFFFFFF; for (u32 n=0; n