diff options
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) { |