summaryrefslogtreecommitdiffstats
path: root/dimension/parse.c
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@gmail.com>2010-04-10 22:09:45 -0400
committerTavian Barnes <tavianator@gmail.com>2010-04-10 22:27:56 -0400
commit26a6f5d017be9ec0ec03cd20d082546a4e435746 (patch)
tree75dc9e989945e5b15909328d5a910646bf72abaa /dimension/parse.c
parent0f356fe6d666b7f43b5b6f4565fe0b890228a75d (diff)
downloaddimension-26a6f5d017be9ec0ec03cd20d082546a4e435746.tar.xz
Improve CSG and light handling.
- Lights can be inside CSG objects - Lights can be modified by transformations - CSG objects can contain only one object
Diffstat (limited to 'dimension/parse.c')
-rw-r--r--dimension/parse.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/dimension/parse.c b/dimension/parse.c
index 19ba24c..2f717f9 100644
--- a/dimension/parse.c
+++ b/dimension/parse.c
@@ -536,12 +536,7 @@ dmnsn_vector_promote(dmnsn_astnode astnode, dmnsn_symbol_table *symtable)
while (dmnsn_array_size(promoted.children) < DMNSN_VECTOR_NELEM) {
component = dmnsn_copy_astnode(component);
- component.type = DMNSN_AST_INTEGER;
-
- long *val = dmnsn_malloc(sizeof(long));
- *val = 0;
-
- component.ptr = val;
+ dmnsn_make_ast_integer(&component, 0);
dmnsn_array_push(promoted.children, &component);
}
} else {
@@ -1759,6 +1754,8 @@ dmnsn_print_astnode(FILE *file, dmnsn_astnode astnode)
case DMNSN_AST_FLOAT:
dvalue = *(double *)astnode.ptr;
+ /* Don't print -0 */
+ if (dvalue == 0.0) dvalue = 0.0;
fprintf(file, "(%s %g)", dmnsn_astnode_string(astnode.type), dvalue);
break;