ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/util/rpiece.c
(Generate patch)

Comparing ray/src/util/rpiece.c (file contents):
Revision 2.38 by schorsch, Sun Jun 8 12:03:11 2003 UTC vs.
Revision 2.41 by schorsch, Sun Jul 27 22:12:04 2003 UTC

# Line 20 | Line 20 | char *argv[];
20   #else
21  
22   #include <signal.h>
23 +
24   #include "color.h"
25   #include "view.h"
26 + #include "rtprocess.h"
27  
28   #ifndef NFS
29   #define  NFS                    1
# Line 49 | Line 51 | extern char  *strerror();
51                                  /* rpict command */
52   char  *rpargv[128] = {"rpict", "-S", "1"};
53   int  rpargc = 3;
52 int  rpd[3];
54   FILE  *torp, *fromrp;
55   COLR  *pbuf;
56                                  /* our view parameters */
# Line 210 | Line 211 | char  **av;
211          char  *err;
212          FILE  *fp;
213          int  hr, vr;
214 +        SUBPROC  rpd; /* since we don't close_process(), this can be local */
215                                          /* set up view */
216          if ((err = setview(&ourview)) != NULL) {
217                  fprintf(stderr, "%s: %s\n", progname, err);
# Line 268 | Line 270 | char  **av;
270                  goto filerr;
271          dolock(outfd, F_UNLCK);
272                                          /* start rpict process */
273 <        if (open_process(rpd, rpargv) <= 0) {
273 >        if (open_process(&rpd, rpargv) <= 0) {
274                  fprintf(stderr, "%s: cannot start %s\n", progname, rpargv[0]);
275                  exit(1);
276          }
277 <        if ((fromrp = fdopen(rpd[0], "r")) == NULL ||
278 <                        (torp = fdopen(rpd[1], "w")) == NULL) {
277 >        if ((fromrp = fdopen(rpd.r, "r")) == NULL ||
278 >                        (torp = fdopen(rpd.w, "w")) == NULL) {
279                  fprintf(stderr, "%s: cannot open stream to %s\n",
280                                  progname, rpargv[0]);
281                  exit(1);
# Line 399 | Line 401 | rpiece()                       /* render picture piece by piece */
401          VIEW  pview;
402          int  xorg, yorg;
403                                          /* compute view parameters */
404 <        copystruct(&pview, &ourview);
404 >        pview = ourview;
405          switch (ourview.type) {
406          case VT_PER:
407                  pview.horiz = 2.*180./PI*atan(
# Line 450 | Line 452 | int  xpos, ypos;
452          int  hr, vr;
453          register int  y;
454                                  /* check bounds */
455 <        if (xpos < 0 | ypos < 0 | xpos >= hmult | ypos >= vmult) {
455 >        if ((xpos < 0) | (ypos < 0) | (xpos >= hmult) | (ypos >= vmult)) {
456                  fprintf(stderr, "%s: requested piece (%d,%d) out of range\n",
457                                  progname, xpos, ypos);
458                  exit(cleanup(1));
# Line 458 | Line 460 | int  xpos, ypos;
460                                  /* check header from rpict */
461          guard_io();
462          getheader(fromrp, NULL, NULL);
463 <        if (!fscnresolu(&hr, &vr, fromrp) || hr != hres | vr != vres) {
463 >        if (!fscnresolu(&hr, &vr, fromrp) || (hr != hres) | (vr != vres)) {
464                  fprintf(stderr, "%s: resolution mismatch from %s\n",
465                                  progname, rpargv[0]);
466                  exit(cleanup(1));

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines