summaryrefslogtreecommitdiffstats
path: root/libdimension/tests
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@gmail.com>2011-05-16 23:25:53 -0600
committerTavian Barnes <tavianator@gmail.com>2011-05-16 23:25:53 -0600
commitd374841194f24c7cb1cdc52fc631fcb2982af358 (patch)
treefa92504fb50c6a4195317dad653ed3ab72fa6f27 /libdimension/tests
parent719fea8f97320814835408fad6ce2a4647674c11 (diff)
downloaddimension-d374841194f24c7cb1cdc52fc631fcb2982af358.tar.xz
Add a refcount to objects.
Diffstat (limited to 'libdimension/tests')
-rw-r--r--libdimension/tests/prtree.c2
-rw-r--r--libdimension/tests/render.c8
2 files changed, 5 insertions, 5 deletions
diff --git a/libdimension/tests/prtree.c b/libdimension/tests/prtree.c
index cb36153..86aaa4e 100644
--- a/libdimension/tests/prtree.c
+++ b/libdimension/tests/prtree.c
@@ -69,7 +69,7 @@ main(void)
dmnsn_randomize_bounding_box(object);
object->intersection_fn = dmnsn_fake_intersection_fn;
dmnsn_initialize_object(object);
- dmnsn_array_push(scene->objects, &object);
+ dmnsn_scene_add_object(scene, object);
}
dmnsn_prtree *prtree = dmnsn_new_prtree(scene->objects);
diff --git a/libdimension/tests/render.c b/libdimension/tests/render.c
index 5b03423..a487224 100644
--- a/libdimension/tests/render.c
+++ b/libdimension/tests/render.c
@@ -112,7 +112,7 @@ dmnsn_new_test_scene(void)
sphere->trans = dmnsn_scale_matrix(dmnsn_new_vector(1.25, 1.25, 1.25));
dmnsn_object *csg = dmnsn_new_csg_difference(cube, sphere);
- dmnsn_array_push(scene->objects, &csg);
+ dmnsn_scene_add_object(scene, csg);
dmnsn_array *arrow_array = dmnsn_new_array(sizeof(dmnsn_object *));
@@ -149,7 +149,7 @@ dmnsn_new_test_scene(void)
dmnsn_translation_matrix(dmnsn_new_vector(0.0, -1.25, 0.0)),
dmnsn_scale_matrix(dmnsn_new_vector(1.0, 2.75, 1.0))
);
- dmnsn_array_push(scene->objects, &arrow);
+ dmnsn_scene_add_object(scene, arrow);
dmnsn_delete_array(arrow_array);
dmnsn_array *torus_array = dmnsn_new_array(sizeof(dmnsn_object *));
@@ -172,7 +172,7 @@ dmnsn_new_test_scene(void)
torii->texture = dmnsn_new_texture();
torii->texture->pigment = dmnsn_new_solid_pigment(dmnsn_blue);
torii->texture->finish = dmnsn_new_ambient_finish(dmnsn_white);
- dmnsn_array_push(scene->objects, &torii);
+ dmnsn_scene_add_object(scene, torii);
dmnsn_delete_array(torus_array);
dmnsn_object *plane = dmnsn_new_plane(dmnsn_new_vector(0.0, 1.0, 0.0));
@@ -194,7 +194,7 @@ dmnsn_new_test_scene(void)
plane->texture->pigment
= dmnsn_new_pigment_map_pigment(checker2, checker_pigment_map);
plane->texture->pigment->quick_color = dmnsn_new_color(1.0, 0.5, 0.75);
- dmnsn_array_push(scene->objects, &plane);
+ dmnsn_scene_add_object(scene, plane);
return scene;
}