aboutsummaryrefslogtreecommitdiff
path: root/scene.c
diff options
context:
space:
mode:
authorJulian T <julian@jtle.dk>2020-03-26 15:43:23 +0100
committerJulian T <julian@jtle.dk>2020-03-26 15:43:23 +0100
commit7359b43f9fde19b6911b3ed95c8b31ea5e6a689b (patch)
treefb8c601cb9cc5d96e1a049c25082d026c89de1fa /scene.c
parent7a48ecd394f7b3b8f0f6e18606f681ffac3e3a7c (diff)
Started work on area light, cleaned up ray.c and clamped colors
Diffstat (limited to 'scene.c')
-rw-r--r--scene.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/scene.c b/scene.c
index 730d8c8..6008942 100644
--- a/scene.c
+++ b/scene.c
@@ -90,13 +90,15 @@ object_t *add_object(container_t *cont, unsigned type)
return o;
}
-light_t *add_light(container_t *cont)
+light_t *add_light(container_t *cont, unsigned type)
{
light_t *o = container_lig_space(cont);
if (!o) {
return NULL;
}
+ o->type = type;
+
space_t *s = &cont->space;
if (s) {
o->next = s->lights;
@@ -112,6 +114,7 @@ light_t *add_light(container_t *cont)
material_t *add_material(container_t *cont)
{
material_t *m = container_mat_space(cont);
+ memset(m, 0, sizeof(material_t));
return m;
}