summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@gmail.com>2009-07-16 01:49:40 +0000
committerTavian Barnes <tavianator@gmail.com>2009-07-16 01:49:40 +0000
commit90564274757e489429daf8bcdb92009563fd2efd (patch)
tree854503bb591bcd73b4244cd622a6692a815a16b8 /tests
parent6b4dc860466ce4794b346533162291046a6ee96c (diff)
downloaddimension-90564274757e489429daf8bcdb92009563fd2efd.tar.xz
Render pigments.
Diffstat (limited to 'tests')
-rw-r--r--tests/tests.c29
-rw-r--r--tests/testsxx.cpp3
2 files changed, 27 insertions, 5 deletions
diff --git a/tests/tests.c b/tests/tests.c
index 218fcfd..ed00b64 100644
--- a/tests/tests.c
+++ b/tests/tests.c
@@ -82,6 +82,25 @@ dmnsn_new_default_scene()
return NULL;
}
+ sphere->texture = dmnsn_new_texture();
+ if (!sphere->texture) {
+ dmnsn_delete_object(sphere);
+ dmnsn_delete_camera(scene->camera);
+ dmnsn_delete_canvas(scene->canvas);
+ dmnsn_delete_scene(scene);
+ return NULL;
+ }
+
+ sphere->texture->pigment = dmnsn_new_solid_pigment(dmnsn_white);
+ if (!sphere->texture->pigment) {
+ dmnsn_delete_texture(sphere->texture);
+ dmnsn_delete_object(sphere);
+ dmnsn_delete_camera(scene->camera);
+ dmnsn_delete_canvas(scene->canvas);
+ dmnsn_delete_scene(scene);
+ return NULL;
+ }
+
sphere->trans = dmnsn_matrix_inverse(
dmnsn_scale_matrix(dmnsn_vector_construct(1.25, 1.25, 1.25))
);
@@ -89,6 +108,8 @@ dmnsn_new_default_scene()
cube = dmnsn_new_cube();
if (!cube) {
+ dmnsn_delete_pigment(sphere->texture->pigment);
+ dmnsn_delete_texture(sphere->texture);
dmnsn_delete_object(sphere);
dmnsn_delete_camera(scene->camera);
dmnsn_delete_canvas(scene->canvas);
@@ -101,8 +122,6 @@ dmnsn_new_default_scene()
);
dmnsn_array_push(scene->objects, &cube);
- scene->quality = DMNSN_RENDER_FULL;
-
return scene;
}
@@ -113,8 +132,14 @@ dmnsn_delete_default_scene(dmnsn_scene *scene)
dmnsn_array_get(scene->objects, 0, &sphere);
dmnsn_array_get(scene->objects, 1, &cube);
+// dmnsn_delete_pigment(cube->texture->pigment);
+ dmnsn_delete_texture(cube->texture);
dmnsn_delete_object(cube);
+
+ dmnsn_delete_pigment(sphere->texture->pigment);
+ dmnsn_delete_texture(sphere->texture);
dmnsn_delete_object(sphere);
+
dmnsn_delete_camera(scene->camera);
dmnsn_delete_canvas(scene->canvas);
dmnsn_delete_scene(scene);
diff --git a/tests/testsxx.cpp b/tests/testsxx.cpp
index 114fb4a..a8fa762 100644
--- a/tests/testsxx.cpp
+++ b/tests/testsxx.cpp
@@ -58,9 +58,6 @@ namespace Dimension
background.filter(0.1);
scene.background(background);
- // Quality
- scene.quality(RENDER_FULL);
-
return scene;
}