From 97c10ba7d73ed0e7505ad2f804fe79aec4f55239 Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Thu, 2 Dec 2010 17:28:08 -0500 Subject: Split pigments and finishes into their own headers/sources. --- libdimension/texture.c | 64 +------------------------------------------------- 1 file changed, 1 insertion(+), 63 deletions(-) (limited to 'libdimension/texture.c') diff --git a/libdimension/texture.c b/libdimension/texture.c index 0096ce0..4c66c25 100644 --- a/libdimension/texture.c +++ b/libdimension/texture.c @@ -20,72 +20,10 @@ /** * @file - * Textures, pigments, and finishes. + * Textures. */ #include "dimension.h" -#include - -/* Allocate a dummy pigment */ -dmnsn_pigment * -dmnsn_new_pigment(void) -{ - dmnsn_pigment *pigment = dmnsn_malloc(sizeof(dmnsn_pigment)); - pigment->pigment_fn = NULL; - pigment->initialize_fn = NULL; - pigment->free_fn = NULL; - pigment->trans = dmnsn_identity_matrix(); - pigment->quick_color = dmnsn_black; - return pigment; -} - -/* Free a pigment */ -void -dmnsn_delete_pigment(dmnsn_pigment *pigment) -{ - if (pigment) { - if (pigment->free_fn) { - (*pigment->free_fn)(pigment->ptr); - } - dmnsn_free(pigment); - } -} - -/* Precompute pigment properties */ -void -dmnsn_initialize_pigment(dmnsn_pigment *pigment) -{ - if (pigment->initialize_fn) { - (*pigment->initialize_fn)(pigment); - } - - pigment->trans_inv = dmnsn_matrix_inverse(pigment->trans); -} - -/* Allocate a dummy finish */ -dmnsn_finish * -dmnsn_new_finish(void) -{ - dmnsn_finish *finish = dmnsn_malloc(sizeof(dmnsn_finish)); - finish->diffuse_fn = NULL; - finish->specular_fn = NULL; - finish->ambient_fn = NULL; - finish->reflection_fn = NULL; - finish->free_fn = NULL; - return finish; -} - -/* Free a finish */ -void -dmnsn_delete_finish(dmnsn_finish *finish) -{ - if (finish) { - if (finish->free_fn) { - (*finish->free_fn)(finish->ptr); - } - dmnsn_free(finish); - } -} /* Allocate a dummy texture */ dmnsn_texture * -- cgit v1.2.3