summaryrefslogtreecommitdiffstats
path: root/dimension/realize.c
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@gmail.com>2009-11-26 13:51:20 -0500
committerTavian Barnes <tavianator@gmail.com>2009-11-26 13:51:20 -0500
commitc0a0ee5ae71b97b1400efddb4c374e1d13701fa3 (patch)
tree4a121e6b3069442444e54d83fcf3fa69f08cd30c /dimension/realize.c
parent02c0213ab823a0c838d295017298cf8cd3493342 (diff)
downloaddimension-c0a0ee5ae71b97b1400efddb4c374e1d13701fa3.tar.xz
Implement background colors.
Diffstat (limited to 'dimension/realize.c')
-rw-r--r--dimension/realize.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/dimension/realize.c b/dimension/realize.c
index ac0231b..8d811fc 100644
--- a/dimension/realize.c
+++ b/dimension/realize.c
@@ -356,9 +356,7 @@ dmnsn_realize(const dmnsn_array *astree)
scene->default_texture->finish->ambient = 0.1;
/* Background color */
- dmnsn_sRGB background_sRGB = { .R = 0.0, .G = 0.0, .B = 0.1 };
- scene->background = dmnsn_color_from_sRGB(background_sRGB);
- scene->background.filter = 0.1;
+ scene->background = dmnsn_black;
/* Allocate a canvas */
scene->canvas = dmnsn_new_canvas(768, 480);
@@ -403,6 +401,11 @@ dmnsn_realize(const dmnsn_array *astree)
dmnsn_light *light;
dmnsn_object *object;
switch (astnode.type) {
+ case DMNSN_AST_BACKGROUND:
+ dmnsn_array_get(astnode.children, 0, &astnode);
+ scene->background = dmnsn_realize_color(astnode);
+ break;
+
case DMNSN_AST_BOX:
object = dmnsn_realize_box(astnode);
dmnsn_array_push(scene->objects, &object);