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.18 by greg, Fri Apr 16 12:03:59 1993 UTC vs.
Revision 2.20 by greg, Tue May 4 09:30:27 1993 UTC

# Line 1 | Line 1
1 < /* Copyright (c) 1992 Regents of the University of California */
1 > /* Copyright (c) 1993 Regents of the University of California */
2  
3   #ifndef lint
4   static char SCCSid[] = "$SunId$ LBL";
# Line 336 | Line 336 | rpiece()                       /* render picture piece by piece */
336                  putc('\n', torp);
337                  fflush(torp);                   /* assigns piece to rpict */
338                  putpiece(xorg, yorg);           /* place piece in output */
339                if (verbose) {                  /* notify caller */
340                        printf("%d %d done\n", xorg, yorg);
341                        fflush(stdout);
342                }
339          }
340   }
341  
# Line 391 | Line 387 | int  xpos, ypos;
387   #else
388          pid = -1;               /* no forking */
389   #endif
390 <        fls.l_len = (long)vres*hmult*hres*sizeof(COLR);
391 <        fls.l_start = scanorig + (vmult-1-ypos)*fls.l_len;
390 >        fls.l_start = scanorig +
391 >                ((long)(vmult-1-ypos)*vres*hmult+xpos)*hres*sizeof(COLR);
392   #if NFS
393 +        fls.l_len = ((long)(vres-1)*hmult+1)*hres*sizeof(COLR);
394                                  /* lock file section so NFS doesn't mess up */
395          fls.l_whence = 0;
396          fls.l_type = F_WRLCK;
397          fcntl(outfd, F_SETLKW, &fls);
398   #endif
399                                  /* write new piece to file */
400 <        if (lseek(outfd, fls.l_start+(long)xpos*hres*sizeof(COLR), 0) == -1)
400 >        if (lseek(outfd, fls.l_start, 0) == -1)
401                  goto seekerr;
402          if (hmult == 1) {
403                  if (writebuf(outfd, (char *)pbuf,
# Line 416 | Line 413 | int  xpos, ypos;
413                                          1) == -1)
414                                  goto seekerr;
415                  }
416 <        if (pid == -1) {        /* fork failed */
416 >        if (verbose) {                          /* notify caller */
417 >                printf("%d %d done\n", xpos, ypos);
418 >                fflush(stdout);
419 >        }
420 >        if (pid == -1) {        /* didn't fork or fork failed */
421   #if NFS
422                  fls.l_type = F_UNLCK;           /* release lock */
423                  fcntl(outfd, F_SETLKW, &fls);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines