summaryrefslogtreecommitdiffstats
path: root/libdimension/finish.c
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@gmail.com>2011-12-14 19:27:22 -0500
committerTavian Barnes <tavianator@gmail.com>2011-12-14 19:52:36 -0500
commitbfbe9e43e108f6816c17b9b7764b75284ac78313 (patch)
tree189f85eeec18a76ccb626e45455fa7e45406db7c /libdimension/finish.c
parent7db5342a36341b061a8785a3b349cf0fcad69ebf (diff)
downloaddimension-bfbe9e43e108f6816c17b9b7764b75284ac78313.tar.xz
Re-think colors.
Color is a property of light, and thus doesn't include information about transparency. But canvas pixels and object pigments represent a color and a degree of transparency. The new type dmnsn_tcolor/ TColor encapsulates that information. Also, fix the transparent shadow implementation.
Diffstat (limited to 'libdimension/finish.c')
-rw-r--r--libdimension/finish.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/libdimension/finish.c b/libdimension/finish.c
index 90f41ae..cd922ff 100644
--- a/libdimension/finish.c
+++ b/libdimension/finish.c
@@ -26,11 +26,10 @@
#include "dimension-internal.h"
dmnsn_ambient *
-dmnsn_new_ambient(void)
+dmnsn_new_ambient(dmnsn_color ambient_light)
{
dmnsn_ambient *ambient = dmnsn_malloc(sizeof(dmnsn_ambient));
- ambient->free_fn = NULL;
- ambient->ptr = NULL;
+ ambient->ambient = ambient_light;
ambient->refcount = 1;
return ambient;
}
@@ -39,9 +38,6 @@ void
dmnsn_delete_ambient(dmnsn_ambient *ambient)
{
if (DMNSN_DECREF(ambient)) {
- if (ambient->free_fn) {
- ambient->free_fn(ambient->ptr);
- }
dmnsn_free(ambient);
}
}