summaryrefslogtreecommitdiffstats
path: root/libdimension/bench
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@gmail.com>2011-06-12 02:37:51 -0600
committerTavian Barnes <tavianator@gmail.com>2011-06-13 00:16:06 -0600
commit7acd8ea6673b7a90ed4041408ccf1b024b8a007a (patch)
treed52199dd7c58e0217bfd1a74e7601d739ad333f5 /libdimension/bench
parent066261810c2fca192677c5c1c01c91d6ecec65a0 (diff)
downloaddimension-7acd8ea6673b7a90ed4041408ccf1b024b8a007a.tar.xz
Vast libdimension API and internals improvements.
Couldn't really do these while I was trying to be POV-Ray compatible, 'cause they would've broken compatibility.
Diffstat (limited to 'libdimension/bench')
-rw-r--r--libdimension/bench/prtree.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/libdimension/bench/prtree.c b/libdimension/bench/prtree.c
index b6f778a..05fc1ce 100644
--- a/libdimension/bench/prtree.c
+++ b/libdimension/bench/prtree.c
@@ -76,8 +76,12 @@ main(void)
}
dmnsn_array *objects = dmnsn_new_array(sizeof(dmnsn_object *));
+ dmnsn_texture *texture = dmnsn_new_texture();
+ texture->pigment = dmnsn_new_pigment();
for (size_t i = 0; i < nobjects; ++i) {
dmnsn_object *object = dmnsn_new_fake_object();
+ object->texture = texture;
+ DMNSN_INCREF(object->texture);
dmnsn_initialize_object(object);
dmnsn_array_push(objects, &object);
}
@@ -108,12 +112,10 @@ main(void)
/* Cleanup */
dmnsn_delete_prtree(tree);
- for (size_t i = 0; i < nobjects; ++i) {
- dmnsn_object *object;
- dmnsn_array_get(objects, i, &object);
- dmnsn_delete_object(object);
+ DMNSN_ARRAY_FOREACH (dmnsn_object **, object, objects) {
+ dmnsn_delete_object(*object);
}
-
+ dmnsn_delete_texture(texture);
dmnsn_delete_array(objects);
return EXIT_SUCCESS;
}