Commit 990410fc authored by Rogerborg's avatar Rogerborg

Bug #2318880: in CCubeSceneNode::setSize(), add vertices from index 0 to...

Bug #2318880: in CCubeSceneNode::setSize(), add vertices from index 0 to prevent multiple calls of setSize() adding new vertices, but re-sizing the first 12.

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@1806 dfc29bdd-3216-0410-991c-e03cc46cb475
parent 1c0fab0d
...@@ -61,7 +61,10 @@ void CCubeSceneNode::setSize() ...@@ -61,7 +61,10 @@ void CCubeSceneNode::setSize()
video::SColor clr(255,255,255,255); video::SColor clr(255,255,255,255);
SMeshBuffer* buf = (SMeshBuffer*)Mesh.getMeshBuffer(0); SMeshBuffer* buf = (SMeshBuffer*)Mesh.getMeshBuffer(0);
buf->Vertices.reallocate(12); buf->Vertices.reallocate(12);
// Start setting vertices from index 0 to deal with this method being called multiple times.
buf->Vertices.set_used(0);
buf->Vertices.push_back(video::S3DVertex(0,0,0, -1,-1,-1, clr, 0, 1)); buf->Vertices.push_back(video::S3DVertex(0,0,0, -1,-1,-1, clr, 0, 1));
buf->Vertices.push_back(video::S3DVertex(1,0,0, 1,-1,-1, clr, 1, 1)); buf->Vertices.push_back(video::S3DVertex(1,0,0, 1,-1,-1, clr, 1, 1));
buf->Vertices.push_back(video::S3DVertex(1,1,0, 1, 1,-1, clr, 1, 0)); buf->Vertices.push_back(video::S3DVertex(1,1,0, 1, 1,-1, clr, 1, 0));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment