ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/Development/ray/src/rt/rmain.c
(Generate patch)

Comparing ray/src/rt/rmain.c (file contents):
Revision 2.6 by greg, Thu May 21 10:52:17 1992 UTC vs.
Revision 2.7 by greg, Fri Jul 10 14:57:53 1992 UTC

# Line 1 | Line 1
1 < /* Copyright (c) 1991 Regents of the University of California */
1 > /* Copyright (c) 1992 Regents of the University of California */
2  
3   #ifndef lint
4   static char SCCSid[] = "$SunId$ LBL";
# Line 126 | Line 126 | char  *argv[];
126          extern char  *getenv();
127          char  *err;
128          char  *recover = NULL;
129 +        char  *outfile = NULL;
130          char  *zfile = NULL;
131          char  *errfile = NULL;
132          char  *ambfile = NULL;
133          char  **amblp = amblist;
134          int  loadflags = ~IO_FILES;
135 <        int  rval, gotvfile = 0;
136 <        RESOLU  rs;
135 >        int  seqstart = 0;
136 >        int  rval;
137          int  i;
138                                          /* record start time */
139          tstart = time((long *)0);
# Line 186 | Line 187 | char  *argv[];
187                                          "bad view file \"%s\"",
188                                                  argv[i]);
189                                  error(USER, errmsg);
190 <                        } else
190 <                                gotvfile += rval;
190 >                        }
191                          break;
192   #endif
193                  case 'd':                               /* direct */
# Line 301 | Line 301 | char  *argv[];
301                          bool(2,do_irrad);
302                          break;
303   #if  RPICT
304 +                case 'S':                               /* slave index */
305 +                        check(2,"i");
306 +                        seqstart = atoi(argv[++i]);
307 +                        break;
308 +                case 'o':                               /* output file */
309 +                        check(2,"s");
310 +                        outfile = argv[++i];
311 +                        break;
312                  case 'z':                               /* z file */
313                          check(2,"s");
314                          zfile = argv[++i];
# Line 308 | Line 316 | char  *argv[];
316                  case 'r':                               /* recover file */
317                          check(2,"s");
318                          recover = argv[++i];
311                        rval = viewfile(recover, &ourview, &rs);
312                        if (rval <= 0 || rs.or != PIXSTANDARD) {
313                                sprintf(errmsg,
314                        "cannot recover view parameters from \"%s\"", recover);
315                                error(WARNING, errmsg);
316                        } else {
317                                gotvfile += rval;
318                                pixaspect = 0.0;
319                                hresolu = rs.xr;
320                                vresolu = rs.yr;
321                        }
319                          break;
320                  case 't':                               /* timer */
321                          check(2,"i");
# Line 421 | Line 418 | char  *argv[];
418                          case 'a':                               /* ascii */
419                          case 'f':                               /* float */
420                          case 'd':                               /* double */
421 +                        case 'c':                               /* color */
422                                  check(4,"");
423                                  outform = argv[i][3];
424                                  break;
# Line 457 | Line 455 | char  *argv[];
455          if (err != NULL)
456                  error(USER, err);
457   #endif
460 #if  RPICT
461        normaspect(viewaspect(&ourview), &pixaspect, &hresolu, &vresolu);
462 #endif
458                                          /* set up signal handling */
459          sigdie(SIGINT, "Interrupt");
460          sigdie(SIGHUP, "Hangup");
# Line 493 | Line 488 | char  *argv[];
488                  octname = argv[i];
489          else
490                  goto badopt;
491 < #if  RVIEW|RTRACE
492 <        if (octname == NULL)
491 >        if (
492 > #if  RPICT
493 >                seqstart > 0 &&
494 > #endif
495 >                        octname == NULL)
496                  error(USER, "missing octree argument");
497 + #if  RPICT
498 +        if (outfile != NULL)
499 +                openheader();
500   #endif
501          readoct(octname, loadflags, &thescene, NULL);
502  
503          if (loadflags & IO_INFO) {      /* print header */
504                  printargs(i, argv, stdout);
505                  printf("SOFTWARE= %s\n", VersionID);
505 #if  RPICT
506                if (gotvfile) {
507                        printf(VIEWSTR);
508                        fprintview(&ourview, stdout);
509                        printf("\n");
510                }
511                if (pixaspect < .99 || pixaspect > 1.01)
512                        fputaspect(pixaspect, stdout);
513                fputformat(COLRFMT, stdout);
514 #endif
515 #if  RTRACE
516                fputformat(     outform=='a' ? "ascii" :
517                                outform=='f' ? "float" :
518                                "double",       stdout  );
519 #endif
520                printf("\n");
506          }
507  
508          marksources();                  /* find and mark sources */
# Line 525 | Line 510 | char  *argv[];
510          setambient(ambfile);            /* initialize ambient calculation */
511  
512   #if  RPICT
513 <        render(zfile, recover);         /* render the scene */
513 >        rpict(seqstart, outfile, zfile, recover);
514   #endif
515   #if  RTRACE
516          rtrace(NULL);                   /* trace rays from stdin */
# Line 620 | Line 605 | char  *msg;
605  
606   printdefaults()                 /* print default values to stdout */
607   {
608 +        extern char  *formstr();
609          register char  *cp;
610  
611   #if  RTRACE
# Line 690 | Line 676 | printdefaults()                        /* print default values to stdout */
676   #endif
677   #if  RTRACE
678          printf("-f%c%c\t\t\t\t# format input/output = %s/%s\n",
679 <                        inform, outform,
694 <                        inform=='a' ? "ascii" :
695 <                        inform=='f' ? "float" : "double",
696 <                        outform=='a' ? "ascii" :
697 <                        outform=='f' ? "float" : "double");
679 >                        inform, outform, formstr(inform), formstr(outform));
680          printf("-o%s\t\t\t\t# output", outvals);
681          for (cp = outvals; *cp; cp++)
682                  switch (*cp) {
# Line 709 | Line 691 | printdefaults()                        /* print default values to stdout */
691                  case 'w': printf(" weight"); break;
692                  case 'm': printf(" modifier"); break;
693                  }
694 <        printf("\n");
694 >        putchar('\n');
695   #endif
696          printf(wrnvec != NULL ? "-w+\t\t\t\t# warning messages on\n" :
697                          "-w-\t\t\t\t# warning messages off\n");

Diff Legend

Removed lines
+ Added lines
< Changed lines (old)
> Changed lines (new)