diff options
author | Tavian Barnes <tavianator@gmail.com> | 2010-04-10 22:09:45 -0400 |
---|---|---|
committer | Tavian Barnes <tavianator@gmail.com> | 2010-04-10 22:27:56 -0400 |
commit | 26a6f5d017be9ec0ec03cd20d082546a4e435746 (patch) | |
tree | 75dc9e989945e5b15909328d5a910646bf72abaa /dimension/parse.c | |
parent | 0f356fe6d666b7f43b5b6f4565fe0b890228a75d (diff) | |
download | dimension-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.c | 9 |
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; |