summaryrefslogtreecommitdiffstats
path: root/tests/libdimension
diff options
context:
space:
mode:
authortavianator <tavianator@antimatter.localdomain>2009-12-27 13:12:56 -0700
committertavianator <tavianator@antimatter.localdomain>2009-12-27 13:12:56 -0700
commit2fab7d7ff6b926e79c35be3e59b42e733f8bf33c (patch)
treeaab6809540e05b97844dec8cfac89415af9aa8c2 /tests/libdimension
parenta9ce26a1cd786690b4b8f4b54fc7077b3d3569e5 (diff)
downloaddimension-2fab7d7ff6b926e79c35be3e59b42e733f8bf33c.tar.xz
Clean up finish combination allocation semantics.
Diffstat (limited to 'tests/libdimension')
-rw-r--r--tests/libdimension/tests.c34
1 files changed, 7 insertions, 27 deletions
diff --git a/tests/libdimension/tests.c b/tests/libdimension/tests.c
index bc98cd5..54f506a 100644
--- a/tests/libdimension/tests.c
+++ b/tests/libdimension/tests.c
@@ -29,36 +29,16 @@ dmnsn_new_default_scene()
}
/* Default finish */
- dmnsn_finish *ambient = dmnsn_new_ambient_finish(
- dmnsn_color_mul(0.1, dmnsn_white)
- );
- dmnsn_finish *diffuse = dmnsn_new_diffuse_finish(0.6);
- dmnsn_finish *phong = dmnsn_new_phong_finish(0.2, 40.0);
- if (!ambient || !diffuse || !phong) {
- dmnsn_delete_finish(diffuse);
- dmnsn_delete_finish(ambient);
- dmnsn_delete_finish(phong);
- dmnsn_delete_scene(scene);
- return NULL;
- }
- dmnsn_finish *comb1 = dmnsn_new_finish_combination(
- ambient,
- diffuse
- );
- if (!comb1) {
- dmnsn_delete_finish(diffuse);
- dmnsn_delete_finish(ambient);
- dmnsn_delete_finish(phong);
- dmnsn_delete_scene(scene);
- return NULL;
- }
scene->default_texture->finish = dmnsn_new_finish_combination(
- phong,
- comb1
+ dmnsn_new_finish_combination(
+ dmnsn_new_ambient_finish(
+ dmnsn_color_mul(0.1, dmnsn_white)
+ ),
+ dmnsn_new_diffuse_finish(0.6)
+ ),
+ dmnsn_new_phong_finish(0.2, 40.0)
);
if (!scene->default_texture->finish) {
- dmnsn_delete_finish(comb1);
- dmnsn_delete_finish(phong);
dmnsn_delete_scene(scene);
return NULL;
}