From 0d4112e01c674a5150e724ee7b49593299efbd9b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20R=C3=B8dal?= Date: Wed, 25 Jun 2008 16:50:02 +0200 Subject: Some more cleanup. --- model.cpp | 6 +----- openglscene.cpp | 2 +- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/model.cpp b/model.cpp index e8dddad..5bc38ff 100644 --- a/model.cpp +++ b/model.cpp @@ -18,15 +18,12 @@ Model::Model(const QString &filename) QTextStream in(&file); while (!in.atEnd()) { QString input = in.readLine(); - - // empty or comment? if (input.isEmpty() || input[0] == '#') continue; QTextStream ts(&input); QString id; ts >> id; - if (id == "v") { Point3d p; for (int i = 0; i < 3; ++i) { @@ -41,7 +38,7 @@ Model::Model(const QString &filename) while (!ts.atEnd()) { QString vertex; ts >> vertex; - int vertexIndex = vertex.split('/').value(0).toInt(); + const int vertexIndex = vertex.split('/').value(0).toInt(); if (vertexIndex) p.append(vertexIndex - 1); } @@ -50,7 +47,6 @@ Model::Model(const QString &filename) const int edgeA = p[i]; const int edgeB = p[(i + 1) % p.size()]; - // avoid duplicate edges if (edgeA < edgeB) m_edgeIndices << edgeA << edgeB; } diff --git a/openglscene.cpp b/openglscene.cpp index 51dcf88..bb69f31 100644 --- a/openglscene.cpp +++ b/openglscene.cpp @@ -166,7 +166,7 @@ void OpenGLScene::drawBackground(QPainter *painter, const QRectF &) glPushMatrix(); glLoadIdentity(); - float pos[] = { m_lightPos, 5, 2, 0 }; + const float pos[] = { m_lightPos, 5, 2, 0 }; glLightfv(GL_LIGHT0, GL_POSITION, pos); glColor4f(m_modelColor.redF(), m_modelColor.greenF(), m_modelColor.blueF(), 1.0f); -- cgit v1.2.3