diff options
author | Tavian Barnes <tavianator@gmail.com> | 2011-06-15 13:53:29 -0600 |
---|---|---|
committer | Tavian Barnes <tavianator@gmail.com> | 2011-06-15 13:53:29 -0600 |
commit | 7ecc68172b00ef429ebde05064c8dfe39c25ecb9 (patch) | |
tree | 412f0ad0259b476485580508f10d509821b6e8a5 /libdimension | |
parent | 531e63071a4d86edf45bf745e7e594de4df3db9d (diff) | |
download | dimension-7ecc68172b00ef429ebde05064c8dfe39c25ecb9.tar.xz |
Add .pigment and .finish properties to Textures.
Diffstat (limited to 'libdimension')
-rw-r--r-- | libdimension/dimension/finish.h | 6 | ||||
-rw-r--r-- | libdimension/finish.c | 18 |
2 files changed, 24 insertions, 0 deletions
diff --git a/libdimension/dimension/finish.h b/libdimension/dimension/finish.h index a163496..a16ea1b 100644 --- a/libdimension/dimension/finish.h +++ b/libdimension/dimension/finish.h @@ -162,6 +162,12 @@ dmnsn_finish dmnsn_new_finish(void); void dmnsn_delete_finish(dmnsn_finish finish); /** + * Increment a finish's reference count. + * @param[in,out] finish The finish to acquire. + */ +void dmnsn_finish_incref(dmnsn_finish *finish); + +/** * Fill missing finish properties from a default finish. * @param[in] default_finish The default finish. * @param[in,out] finish The finish to fill. diff --git a/libdimension/finish.c b/libdimension/finish.c index d356676..6c30646 100644 --- a/libdimension/finish.c +++ b/libdimension/finish.c @@ -130,6 +130,24 @@ dmnsn_delete_finish(dmnsn_finish finish) } void +dmnsn_finish_incref(dmnsn_finish *finish) +{ + if (finish->ambient) { + DMNSN_INCREF(finish->ambient); + } + if (finish->diffuse) { + DMNSN_INCREF(finish->diffuse); + } + if (finish->specular) { + DMNSN_INCREF(finish->specular); + } + if (finish->reflection) { + DMNSN_INCREF(finish->reflection); + } + +} + +void dmnsn_finish_cascade(const dmnsn_finish *default_finish, dmnsn_finish *finish) { if (!finish->ambient) { |