summaryrefslogtreecommitdiff
path: root/dw/types.cc
diff options
context:
space:
mode:
authorcorvid <corvid@lavabit.com>2011-08-04 07:13:13 +0000
committercorvid <corvid@lavabit.com>2011-08-04 07:13:13 +0000
commitbc05ad05cb92d0b67c6354c2ffe96b4957257242 (patch)
tree693ba73943b0e42feccd994c608328ccbe6ae920 /dw/types.cc
parentb0b6145de9007ec837a90121c1af5bc86d5e9dfd (diff)
rm my FLTK2-era points array optimisation for drawPolygon()
(I had made it use that less-clear int[][2] interface because fltk2 let you add all of the vertices in one call.) It feels good to change that nasty-looking pointArray in Polygon::draw().
Diffstat (limited to 'dw/types.cc')
-rw-r--r--dw/types.cc7
1 files changed, 3 insertions, 4 deletions
diff --git a/dw/types.cc b/dw/types.cc
index 9dcedeea..074cb352 100644
--- a/dw/types.cc
+++ b/dw/types.cc
@@ -141,12 +141,11 @@ void Polygon::draw (core::View *view, core::style::Style *style, int x, int y)
if (points->size()) {
int i;
const bool filled = false, convex = false;
- int (*pointArray)[2] =
- (int (*)[2]) malloc(points->size() * sizeof(*pointArray));
+ Point *pointArray = (Point *)malloc(points->size()*sizeof(struct Point));
for (i = 0; i < points->size(); i++) {
- pointArray[i][0] = x + points->getRef(i)->x;
- pointArray[i][1] = y + points->getRef(i)->y;
+ pointArray[i].x = x + points->getRef(i)->x;
+ pointArray[i].y = y + points->getRef(i)->y;
}
view->drawPolygon(style->color, core::style::Color::SHADING_NORMAL,
filled, convex, pointArray, i);