diff options
author | Tavian Barnes <tavianator@gmail.com> | 2010-12-02 17:28:08 -0500 |
---|---|---|
committer | Tavian Barnes <tavianator@gmail.com> | 2010-12-02 22:43:14 -0500 |
commit | 97c10ba7d73ed0e7505ad2f804fe79aec4f55239 (patch) | |
tree | 9be685edab9ffb4fef90e948d09446ee03a697b9 /libdimension/texture.c | |
parent | 38f4297a90e1a678a3fddf9be56b589ae656836a (diff) | |
download | dimension-97c10ba7d73ed0e7505ad2f804fe79aec4f55239.tar.xz |
Split pigments and finishes into their own headers/sources.
Diffstat (limited to 'libdimension/texture.c')
-rw-r--r-- | libdimension/texture.c | 64 |
1 files changed, 1 insertions, 63 deletions
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 <stdlib.h> - -/* 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 * |