summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Romanick <idr@freedesktop.org>2010-10-03 18:46:37 -0700
committerIan Romanick <idr@freedesktop.org>2010-10-03 18:46:37 -0700
commitbf55af4beb9a86bf7556bc3a114a6e3fe7de37b4 (patch)
treecc16039e81cec0aeffcf0741ecec00109e0bee7f
parent17bbb83eaa0abdb0ca9978cdf0c3136376f5b42e (diff)
GLUshape: Fix off-by-one error in mesh generation
-rw-r--r--src/mesh.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/mesh.cpp b/src/mesh.cpp
index c4789a2..76ea46a 100644
--- a/src/mesh.cpp
+++ b/src/mesh.cpp
@@ -72,7 +72,7 @@ GLUmeshProducer::generate(GLUshapeConsumer *consumer) const
EMIT_ELT(e1);
}
- EMIT_ELT((this->width - 1) + ((i + 0) * this->width));
+ EMIT_ELT((this->columns - 1) + ((i + 1) * this->width));
} else {
for (j = this->columns - 1; j >= 0; j--) {
const unsigned e0 = ((i + 0) * this->width) + j;
@@ -82,7 +82,7 @@ GLUmeshProducer::generate(GLUshapeConsumer *consumer) const
EMIT_ELT(e1);
}
- EMIT_ELT((i + 0) * this->width);
+ EMIT_ELT((i + 1) * this->width);
}
}