diff options
author | xleroy <xleroy@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e> | 2010-03-03 12:34:43 +0000 |
---|---|---|
committer | xleroy <xleroy@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e> | 2010-03-03 12:34:43 +0000 |
commit | 6c196ec8a41d6ed506c133c8b33dba9684f9a7a6 (patch) | |
tree | 4e1422ea2a810520d0d9b0fbb78c0014ba9f8443 /test/raytracer/object.c | |
parent | 93d89c2b5e8497365be152fb53cb6cd4c5764d34 (diff) | |
download | compcert-6c196ec8a41d6ed506c133c8b33dba9684f9a7a6.tar.gz compcert-6c196ec8a41d6ed506c133c8b33dba9684f9a7a6.zip |
Updated raytracer test. Added SPASS test.
git-svn-id: https://yquem.inria.fr/compcert/svn/compcert/trunk@1271 fca1b0fc-160b-0410-b1d3-a4f43f01ea2e
Diffstat (limited to 'test/raytracer/object.c')
-rw-r--r-- | test/raytracer/object.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/test/raytracer/object.c b/test/raytracer/object.c index 3dd6e77e..c7e5f53f 100644 --- a/test/raytracer/object.c +++ b/test/raytracer/object.c @@ -6,30 +6,30 @@ #include "object.h" #include "matrix.h" -static struct object * new_object(int kind, struct closure * c) +static struct object * new_object(int kind, struct closure c) { struct object * o = arena_alloc(sizeof(struct object)); o->kind = kind; - ASSIGN(o->surf, *c); + o->surf = c; o->world2obj = o->obj2world = mid; o->max_scale_applied = 1.0; o->radius = BS_NOT_COMPUTED; return o; } -struct object * cone(struct closure * c) +struct object * cone(struct closure c) { return new_object(Cone, c); } -struct object * cube(struct closure * c) +struct object * cube(struct closure c) { return new_object(Cube, c); } -struct object * cylinder(struct closure * c) +struct object * cylinder(struct closure c) { return new_object(Cylinder, c); } -struct object * plane(struct closure * c) +struct object * plane(struct closure c) { return new_object(Plane, c); } -struct object * sphere(struct closure * c) +struct object * sphere(struct closure c) { return new_object(Sphere, c); } static struct object * transform(struct object * o, @@ -47,7 +47,7 @@ static struct object * transform(struct object * o, no->o2 = transform(o->o2, t, tinv, scale); break; default: - ASSIGN(no->surf, o->surf); + no->surf = o->surf; no->world2obj = mcompose(o->world2obj, tinv); no->obj2world = mcompose(t, o->obj2world); no->max_scale_applied = o->max_scale_applied * scale; @@ -212,3 +212,4 @@ void normal_vector(struct object * obj, struct point * p, int face, product(&tang_world1, &tang_world2, n); vnormalize(n, n); } + |