--- ray/src/rt/raypcalls.c 2005/04/15 04:44:51 2.10 +++ ray/src/rt/raypcalls.c 2005/12/17 22:17:51 2.12 @@ -1,5 +1,5 @@ #ifndef lint -static const char RCSid[] = "$Id: raypcalls.c,v 2.10 2005/04/15 04:44:51 greg Exp $"; +static const char RCSid[] = "$Id: raypcalls.c,v 2.12 2005/12/17 22:17:51 greg Exp $"; #endif /* * raypcalls.c - interface for parallel rendering using Radiance @@ -43,7 +43,7 @@ static const char RCSid[] = "$Id: raypcalls.c,v 2.10 2 * myRay.rorg = ( ray origin point ) * myRay.rdir = ( normalized ray direction ) * myRay.rmax = ( maximum length, or zero for no limit ) - * rayorigin(&myRay, NULL, PRIMARY, 1.0); + * rayorigin(&myRay, PRIMARY, NULL, NULL); * myRay.rno = ( my personal ray identifier ) * if (ray_pqueue(&myRay) == 1) * { do something with results } @@ -402,20 +402,19 @@ ray_pchild( /* process rays (never returns) */ /* read each ray request set */ while ((n = read(fd_in, (char *)r_queue, sizeof(r_queue))) > 0) { int n2; - if (n % sizeof(RAY)) + if (n < sizeof(RAY)) break; - n /= sizeof(RAY); /* get smuggled set length */ - n2 = r_queue[0].crtype - n; + n2 = sizeof(RAY)*r_queue[0].crtype - n; if (n2 < 0) error(INTERNAL, "buffer over-read in ray_pchild"); if (n2 > 0) { /* read the rest of the set */ - i = readbuf(fd_in, (char *)(r_queue+n), - sizeof(RAY)*n2); - if (i != sizeof(RAY)*n2) + i = readbuf(fd_in, (char *)r_queue + n, n2); + if (i != n2) break; n += n2; } + n /= sizeof(RAY); /* evaluate rays */ for (i = 0; i < n; i++) { r_queue[i].crtype = r_queue[i].rtype;