diff options
author | Tavian Barnes <tavianator@gmail.com> | 2011-07-13 11:36:02 -0600 |
---|---|---|
committer | Tavian Barnes <tavianator@gmail.com> | 2011-07-13 11:36:02 -0600 |
commit | f034b0cba4c028b4b156f7d8824b6ccf84f1f277 (patch) | |
tree | d4f3605f4854e3e77516a41b1005381deab8d910 /libdimension/tests/render.c | |
parent | 784b86f008b5b71380a489fba6eafeb2b933ed9c (diff) | |
download | dimension-f034b0cba4c028b4b156f7d8824b6ccf84f1f277.tar.xz |
Clean up tests a bit.
Diffstat (limited to 'libdimension/tests/render.c')
-rw-r--r-- | libdimension/tests/render.c | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/libdimension/tests/render.c b/libdimension/tests/render.c index a67980b..04897d6 100644 --- a/libdimension/tests/render.c +++ b/libdimension/tests/render.c @@ -139,9 +139,7 @@ dmnsn_new_test_scene(void) dmnsn_array_push(arrow_array, &cone); dmnsn_object *arrow = dmnsn_new_csg_union(arrow_array); - arrow->trans = dmnsn_rotation_matrix( - dmnsn_new_vector(dmnsn_radians(-45.0), 0.0, 0.0) - ); + dmnsn_delete_array(arrow_array); dmnsn_pattern *gradient = dmnsn_new_gradient_pattern(dmnsn_y); dmnsn_map *gradient_color_map = dmnsn_new_color_map(); dmnsn_add_map_entry(gradient_color_map, 0.0, &dmnsn_red); @@ -161,8 +159,6 @@ 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_delete_array(arrow_array); dmnsn_array *torus_array = dmnsn_new_array(sizeof(dmnsn_object *)); @@ -178,15 +174,21 @@ dmnsn_new_test_scene(void) dmnsn_array_push(torus_array, &torus3); dmnsn_object *torii = dmnsn_new_csg_union(torus_array); - torii->trans = dmnsn_rotation_matrix( - dmnsn_new_vector(dmnsn_radians(-45.0), 0.0, 0.0) - ); + dmnsn_delete_array(torus_array); torii->texture = dmnsn_new_texture(); torii->texture->pigment = dmnsn_new_solid_pigment(dmnsn_blue); torii->texture->finish.ambient = dmnsn_new_basic_ambient(dmnsn_white); - dmnsn_array_push(scene->objects, &torii); - dmnsn_delete_array(torus_array); + + dmnsn_array *spike_array = dmnsn_new_array(sizeof(dmnsn_object *)); + dmnsn_array_push(spike_array, &arrow); + dmnsn_array_push(spike_array, &torii); + dmnsn_object *spike = dmnsn_new_csg_union(spike_array); + dmnsn_delete_array(spike_array); + spike->trans = dmnsn_rotation_matrix( + dmnsn_new_vector(dmnsn_radians(-45.0), 0.0, 0.0) + ); + dmnsn_array_push(scene->objects, &spike); dmnsn_object *plane = dmnsn_new_plane(dmnsn_new_vector(0.0, 1.0, 0.0)); plane->trans = dmnsn_translation_matrix(dmnsn_new_vector(0.0, -2.0, 0.0)); |