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.34 by gregl, Wed May 28 17:22:52 1997 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 193 | Line 198 | int  fd;
198   int  ltyp;
199   {
200          static struct flock  fls;       /* static so initialized to zeroes */
196        extern char  *sys_errlist[];
201  
202          fls.l_type = ltyp;
203          if (fcntl(fd, F_SETLKW, &fls) < 0) {
# Line 415 | Line 419 | rpiece()                       /* render picture piece by piece */
419                  pview.horiz = ourview.horiz / hmult;
420                  pview.vert = ourview.vert / vmult;
421                  break;
422 +        case VT_CYL:
423 +                pview.horiz = ourview.horiz / hmult;
424 +                pview.vert = 2.*180./PI*atan(
425 +                                tan(PI/180./2.*ourview.vert)/vmult );
426 +                break;
427          case VT_HEM:
428                  pview.horiz = 2.*180./PI*asin(
429                                  sin(PI/180./2.*ourview.horiz)/hmult );
# Line 428 | Line 437 | rpiece()                       /* render picture piece by piece */
437          }
438                                          /* render each piece */
439          while (nextpiece(&xorg, &yorg)) {
440 <                pview.hoff = ourview.hoff + xorg - 0.5*(hmult-1);
441 <                pview.voff = ourview.voff + yorg - 0.5*(vmult-1);
440 >                pview.hoff = ourview.hoff*hmult + xorg - 0.5*(hmult-1);
441 >                pview.voff = ourview.voff*vmult + yorg - 0.5*(vmult-1);
442                  fputs(VIEWSTR, torp);
443                  fprintview(&pview, torp);
444                  putc('\n', torp);
# Line 522 | Line 531 | int  xpos, ypos;
531          if (fcntl(outfd, F_SETLKW, &fls) < 0)
532                  filerr("lock");
533   #endif
534 +        if (verbose) {                          /* notify caller */
535 +                printf("%d %d done\n", xpos, ypos);
536 +                fflush(stdout);
537 +        }
538          if (syncfp != NULL) {                   /* record what's been done */
539                  sflock(F_WRLCK);
540                  fseek(syncfp, 0L, 2);           /* append index */
# Line 530 | Line 543 | int  xpos, ypos;
543                                  /*** Unlock not necessary, since
544                  sflock(F_UNLCK);        _exit() or nextpiece() is next ***/
545          }
533        if (verbose) {                          /* notify caller */
534                printf("%d %d done\n", xpos, ypos);
535                fflush(stdout);
536        }
546          if (pid == -1)          /* didn't fork or fork failed */
547                  return(0);
548          _exit(0);               /* else exit child process (releasing locks) */
# Line 543 | Line 552 | int  xpos, ypos;
552   filerr(t)                       /* report file error and exit */
553   char  *t;
554   {
546        extern char  *sys_errlist[];
547
555          fprintf(stderr, "%s: %s error on file \"%s\": %s\n",
556                          progname, t, outfile, sys_errlist[errno]);
557          _exit(1);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines