diff options
author | Tavian Barnes <tavianator@gmail.com> | 2009-07-08 17:12:02 +0000 |
---|---|---|
committer | Tavian Barnes <tavianator@gmail.com> | 2009-07-08 17:12:02 +0000 |
commit | bff7f2b3b440c30d0d6eb692576af57ef42edd1b (patch) | |
tree | 0ba45051db1ee7b7808339cfb587f8f76d8c7c5c /libdimension/canvas.c | |
parent | 14c9cd86e1b7c6ff27c5000d72721c54a718daac (diff) | |
download | dimension-bff7f2b3b440c30d0d6eb692576af57ef42edd1b.tar.xz |
Comments and style adjustments, and a couple fixes.
Diffstat (limited to 'libdimension/canvas.c')
-rw-r--r-- | libdimension/canvas.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/libdimension/canvas.c b/libdimension/canvas.c index 4151a0b..2e4000b 100644 --- a/libdimension/canvas.c +++ b/libdimension/canvas.c @@ -61,7 +61,7 @@ dmnsn_delete_canvas(dmnsn_canvas *canvas) for (i = 0; i < dmnsn_array_size(canvas->optimizers); ++i) { dmnsn_array_get(canvas->optimizers, i, &optimizer); if (optimizer.free_fn) { - optimizer.free_fn(optimizer.ptr); + (*optimizer.free_fn)(optimizer.ptr); } } @@ -76,6 +76,7 @@ int dmnsn_optimize_canvas(dmnsn_canvas *canvas, dmnsn_canvas_optimizer optimizer) { if (canvas->too_late) { + /* Don't set an optimizer if dmnsn_set_pixel() has been called */ return 1; } else { dmnsn_array_push(canvas->optimizers, &optimizer); @@ -100,6 +101,6 @@ dmnsn_set_pixel(dmnsn_canvas *canvas, unsigned int x, unsigned int y, /* Call the optimizers */ for (i = 0; i < dmnsn_array_size(canvas->optimizers); ++i) { dmnsn_array_get(canvas->optimizers, i, &optimizer); - optimizer.optimizer_fn(canvas, optimizer, x, y); + (*optimizer.optimizer_fn)(canvas, optimizer, x, y); } } |