mirror of
https://github.com/minetest/irrlicht.git
synced 2024-12-25 02:00:30 +01:00
CXMeshFileLoader: initialize normals (and other S3DVertex values ) to 0 when loading
Thanks @sfan5 for patch in Minetest: 0500a7798b
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
This commit is contained in:
parent
8fcc572845
commit
df17e52a05
@ -760,10 +760,12 @@ bool CXMeshFileLoader::parseDataObjectMesh(SXMesh &mesh)
|
|||||||
|
|
||||||
// read vertices
|
// read vertices
|
||||||
mesh.Vertices.set_used(nVertices);
|
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<nVertices; ++n)
|
for (u32 n=0; n<nVertices; ++n)
|
||||||
{
|
{
|
||||||
readVector3(mesh.Vertices[n].Pos);
|
readVector3(vertex.Pos);
|
||||||
mesh.Vertices[n].Color=0xFFFFFFFF;
|
mesh.Vertices[n] = vertex;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!checkForTwoFollowingSemicolons())
|
if (!checkForTwoFollowingSemicolons())
|
||||||
|
Loading…
Reference in New Issue
Block a user