diff options
author | tavianator <tavianator@antimatter.localdomain> | 2009-12-27 13:12:56 -0700 |
---|---|---|
committer | tavianator <tavianator@antimatter.localdomain> | 2009-12-27 13:12:56 -0700 |
commit | 2fab7d7ff6b926e79c35be3e59b42e733f8bf33c (patch) | |
tree | aab6809540e05b97844dec8cfac89415af9aa8c2 /dimension | |
parent | a9ce26a1cd786690b4b8f4b54fc7077b3d3569e5 (diff) | |
download | dimension-2fab7d7ff6b926e79c35be3e59b42e733f8bf33c.tar.xz |
Clean up finish combination allocation semantics.
Diffstat (limited to 'dimension')
-rw-r--r-- | dimension/realize.c | 18 |
1 files changed, 4 insertions, 14 deletions
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; } |