From 2fab7d7ff6b926e79c35be3e59b42e733f8bf33c Mon Sep 17 00:00:00 2001 From: tavianator Date: Sun, 27 Dec 2009 13:12:56 -0700 Subject: Clean up finish combination allocation semantics. --- dimension/realize.c | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) (limited to 'dimension/realize.c') diff --git a/dimension/realize.c b/dimension/realize.c index 6ebcdd1..85a4f5a 100644 --- a/dimension/realize.c +++ b/dimension/realize.c @@ -547,23 +547,13 @@ dmnsn_realize_astree(const dmnsn_astree *astree) } /* 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); - if (!ambient || !diffuse) { - dmnsn_delete_finish(diffuse); - dmnsn_delete_finish(ambient); - dmnsn_delete_scene(scene); - return NULL; - } scene->default_texture->finish = dmnsn_new_finish_combination( - ambient, - diffuse + dmnsn_new_ambient_finish( + dmnsn_color_mul(0.1, dmnsn_white) + ), + dmnsn_new_diffuse_finish(0.6) ); if (!scene->default_texture->finish) { - dmnsn_delete_finish(diffuse); - dmnsn_delete_finish(ambient); dmnsn_delete_scene(scene); return NULL; } -- cgit v1.2.3