diff --git a/qglview/glprimitives.cpp b/qglview/glprimitives.cpp index 1c20be1..4c5bdbb 100644 --- a/qglview/glprimitives.cpp +++ b/qglview/glprimitives.cpp @@ -59,7 +59,6 @@ void GLPrimitiveCube::init() { d_vertices.clear(); d_normals.clear(); d_uvs.clear(); - for (int i = 0; i < 4; ++i) d_normals << 0. << -1. << 0.; d_vertices << -hw << -hl << -hh; @@ -67,7 +66,6 @@ void GLPrimitiveCube::init() { d_vertices << hw << -hl << hh; d_vertices << -hw << -hl << hh; d_uvs << 0. << 0. << 1. << 0. << 1. << 1. << 0. << 1.; - for (int i = 0; i < 4; ++i) d_normals << 0. << 1. << 0.; d_vertices << -hw << hl << -hh; @@ -75,7 +73,6 @@ void GLPrimitiveCube::init() { d_vertices << hw << hl << hh; d_vertices << hw << hl << -hh; d_uvs << 0. << 0. << 1. << 0. << 1. << 1. << 0. << 1.; - for (int i = 0; i < 4; ++i) d_normals << -1. << 0. << 0.; d_vertices << -hw << -hl << -hh; @@ -83,7 +80,6 @@ void GLPrimitiveCube::init() { d_vertices << -hw << hl << hh; d_vertices << -hw << hl << -hh; d_uvs << 0. << 0. << 1. << 0. << 1. << 1. << 0. << 1.; - for (int i = 0; i < 4; ++i) d_normals << 1. << 0. << 0.; d_vertices << hw << -hl << -hh; @@ -91,7 +87,6 @@ void GLPrimitiveCube::init() { d_vertices << hw << hl << hh; d_vertices << hw << -hl << hh; d_uvs << 0. << 0. << 1. << 0. << 1. << 1. << 0. << 1.; - for (int i = 0; i < 4; ++i) d_normals << 0. << 0. << -1.; d_vertices << -hw << -hl << -hh; @@ -99,7 +94,6 @@ void GLPrimitiveCube::init() { d_vertices << hw << hl << -hh; d_vertices << hw << -hl << -hh; d_uvs << 0. << 0. << 1. << 0. << 1. << 1. << 0. << 1.; - for (int i = 0; i < 4; ++i) d_normals << 0. << 0. << 1.; d_vertices << -hw << -hl << hh; @@ -107,7 +101,6 @@ void GLPrimitiveCube::init() { d_vertices << hw << hl << hh; d_vertices << -hw << hl << hh; d_uvs << 0. << 0. << 1. << 0. << 1. << 1. << 0. << 1.; - is_init = true; vbo.rebuffer(); } @@ -142,8 +135,8 @@ void GLPrimitiveEllipsoid::init() { QVector points; vbo.clear(); vbo.init(); - - int ret = 0, hseg = sh + 1, wlseg = swl + 1; + uint ret = 0; + int hseg = sh + 1, wlseg = swl + 1; double crw, crl, a, ch, twl; QVector3D cp(0., 0., -h / 2.); points << cp; @@ -179,7 +172,6 @@ void GLPrimitiveEllipsoid::init() { putTriangle(points[ret - 1], points[ret - wlseg * 2], points[ret]); for (int j = 1; j < wlseg * 2; j++) if (j > 0) putTriangle(points[ret - wlseg * 2 + j - 1], points[ret - wlseg * 2 + j], points[ret]); - is_init = true; vbo.rebuffer(); }