summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSamuel Rødal <sroedal@trolltech.com>2008-06-25 16:50:02 +0200
committerSamuel Rødal <sroedal@trolltech.com>2008-06-25 17:34:38 +0200
commit0d4112e01c674a5150e724ee7b49593299efbd9b (patch)
tree1acb55aa39750a6e5b88b5ad98226753aefbdc62
parent2fe663ef819430735fbadc7a03f9d8f0d630d236 (diff)
Some more cleanup.
-rw-r--r--model.cpp6
-rw-r--r--openglscene.cpp2
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);