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.31 by greg, Thu Nov 30 09:26:20 1995 UTC vs.
Revision 2.36 by gwlarson, Thu Jun 18 09:23:49 1998 UTC

# Line 47 | Line 47 | char *argv[];
47   #define guard_io()      0
48   #define unguard()       0
49   #endif
50 +
51 + #ifndef linux
52 + extern char  *sys_errlist[];
53 + #endif
54 +
55                                  /* rpict command */
56   char  *rpargv[128] = {"rpict", "-S", "1"};
57   int  rpargc = 3;
# Line 72 | Line 77 | int  verbose = 0;
77   unsigned  timelim = 0;
78   int  rvrlim = -1;
79  
75 extern long  lseek(), ftell();
76
80   int  gotalrm = 0;
81   int  onalrm() { gotalrm++; }
82  
# Line 119 | Line 122 | char  *argv[];
122                          case 'p':               /* pixel aspect ratio? */
123                                  if (argv[i][2] != 'a' || argv[i][3])
124                                          break;
125 <                                pixaspect = atof(argv[i+1]);
125 >                                pixaspect = atof(argv[++i]);
126                                  continue;
127                          case 'T':               /* time limit (hours) */
128                                  if (argv[i][2])
# Line 193 | Line 196 | int  fd;
196   int  ltyp;
197   {
198          static struct flock  fls;       /* static so initialized to zeroes */
196        extern char  *sys_errlist[];
199  
200          fls.l_type = ltyp;
201          if (fcntl(fd, F_SETLKW, &fls) < 0) {
# Line 415 | Line 417 | rpiece()                       /* render picture piece by piece */
417                  pview.horiz = ourview.horiz / hmult;
418                  pview.vert = ourview.vert / vmult;
419                  break;
420 +        case VT_CYL:
421 +                pview.horiz = ourview.horiz / hmult;
422 +                pview.vert = 2.*180./PI*atan(
423 +                                tan(PI/180./2.*ourview.vert)/vmult );
424 +                break;
425          case VT_HEM:
426                  pview.horiz = 2.*180./PI*asin(
427                                  sin(PI/180./2.*ourview.horiz)/hmult );
# Line 428 | Line 435 | rpiece()                       /* render picture piece by piece */
435          }
436                                          /* render each piece */
437          while (nextpiece(&xorg, &yorg)) {
438 <                pview.hoff = ourview.hoff + xorg - 0.5*(hmult-1);
439 <                pview.voff = ourview.voff + yorg - 0.5*(vmult-1);
438 >                pview.hoff = ourview.hoff*hmult + xorg - 0.5*(hmult-1);
439 >                pview.voff = ourview.voff*vmult + yorg - 0.5*(vmult-1);
440                  fputs(VIEWSTR, torp);
441                  fprintview(&pview, torp);
442                  putc('\n', torp);
# Line 501 | Line 508 | int  xpos, ypos;
508                  filerr("lock");
509   #endif
510                                  /* write new piece to file */
511 <        if (lseek(outfd, fls.l_start, 0) == -1)
511 >        if (lseek(outfd, fls.l_start, 0) < 0)
512                  filerr("seek");
513          if (hmult == 1) {
514                  if (writebuf(outfd, (char *)pbuf,
# Line 514 | Line 521 | int  xpos, ypos;
521                                  filerr("write");
522                          if (y < vr-1 && lseek(outfd,
523                                          (long)(hmult-1)*hr*sizeof(COLR),
524 <                                        1) == -1)
524 >                                        1) < 0)
525                                  filerr("seek");
526                  }
527   #if NFS
# Line 522 | Line 529 | int  xpos, ypos;
529          if (fcntl(outfd, F_SETLKW, &fls) < 0)
530                  filerr("lock");
531   #endif
532 +        if (verbose) {                          /* notify caller */
533 +                printf("%d %d done\n", xpos, ypos);
534 +                fflush(stdout);
535 +        }
536          if (syncfp != NULL) {                   /* record what's been done */
537                  sflock(F_WRLCK);
538                  fseek(syncfp, 0L, 2);           /* append index */
# Line 530 | Line 541 | int  xpos, ypos;
541                                  /*** Unlock not necessary, since
542                  sflock(F_UNLCK);        _exit() or nextpiece() is next ***/
543          }
533        if (verbose) {                          /* notify caller */
534                printf("%d %d done\n", xpos, ypos);
535                fflush(stdout);
536        }
544          if (pid == -1)          /* didn't fork or fork failed */
545                  return(0);
546          _exit(0);               /* else exit child process (releasing locks) */
# Line 543 | Line 550 | int  xpos, ypos;
550   filerr(t)                       /* report file error and exit */
551   char  *t;
552   {
546        extern char  *sys_errlist[];
547
553          fprintf(stderr, "%s: %s error on file \"%s\": %s\n",
554                          progname, t, outfile, sys_errlist[errno]);
555          _exit(1);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines