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

Comparing ray/src/gen/mkillum.c (file contents):
Revision 1.5 by greg, Wed Jul 24 16:48:22 1991 UTC vs.
Revision 1.9 by greg, Thu Jul 25 15:31:30 1991 UTC

# Line 15 | Line 15 | static char SCCSid[] = "$SunId$ LBL";
15   #include  <ctype.h>
16  
17                                  /* default parameters */
18 < #define  SAMPDENS       128             /* points per projected steradian */
18 > #define  SAMPDENS       48              /* points per projected steradian */
19   #define  NSAMPS         32              /* samples per point */
20   #define  DFLMAT         "illum_mat"     /* material name */
21                                  /* selection options */
# Line 58 | Line 58 | int    doneheader = 0;         /* printed header yet? */
58   int     warnings = 1;           /* print warnings? */
59  
60   extern char     *fgetline(), *fgetword(), *sskip(),
61 <                *atos(), *iskip(), *fskip();
61 >                *atos(), *iskip(), *fskip(), *strcpy();
62   extern FILE     *popen();
63  
64  
# Line 89 | Line 89 | char   *argv[];
89          rtargv[rtargc] = NULL;
90                                  /* just asking for defaults? */
91          if (!strcmp(argv[gargc-1], "-defaults")) {
92 +                printopts(); fflush(stdout);
93                  rtpath = getpath(rtargv[0], getenv("PATH"), X_OK);
94                  if (rtpath == NULL) {
95                          eputs(rtargv[0]);
# Line 158 | Line 159 | init()                         /* start rtrace and set up buffers */
159          if (rt.buf == NULL || rt.dest == NULL)
160                  error(SYSTEM, "out of memory in init");
161          rt.nrays = 0;
162 +                                        /* set up urand */
163 +        initurand(2048);
164   }
165  
166  
# Line 253 | Line 256 | char   *nm;
256                          if (*++cp != '=')
257                                  break;
258                          if (!*++cp) {
259 +                                strcpy(thisillum.datafile,thisillum.matname);
260                                  thisillum.flags &= ~IL_DATCLB;
261                                  continue;
262                          }
# Line 263 | Line 267 | char   *nm;
267                          continue;
268                  case 'i':                       /* include material */
269                  case 'e':                       /* exclude material */
270 <                        matselect = (*cp == 'i') ? S_ELEM : S_COMPL;
267 <                        if (*++cp != '=')
270 >                        if (cp[1] != '=')
271                                  break;
272 <                        atos(matcheck, MAXSTR, ++cp);
272 >                        matselect = (*cp == 'i') ? S_ELEM : S_COMPL;
273 >                        cp += 2;
274 >                        atos(matcheck, MAXSTR, cp);
275                          cp = sskip(cp);
276                          continue;
277                  case 'a':                       /* use everything */
# Line 282 | Line 287 | char   *nm;
287                                  break;
288                          switch (*++cp) {
289                          case 'a':                       /* average */
290 <                                thisillum.flags |= IL_COLAVG;
291 <                                thisillum.flags &= ~IL_COLDST;
290 >                                thisillum.flags = (thisillum.flags|IL_COLAVG)
291 >                                                        & ~IL_COLDST;
292                                  break;
293                          case 'd':                       /* distribution */
294                                  thisillum.flags |= (IL_COLDST|IL_COLAVG);
# Line 336 | Line 341 | char   *nm;
341                          }
342                          doneheader = 0;
343                          continue;
344 +                case '!':                       /* processed file! */
345 +                        sprintf(errmsg, "(%s): already processed!", nm);
346 +                        error(WARNING, errmsg);
347 +                        matselect = S_NONE;
348 +                        return;
349                  }
350          opterr:                                 /* skip faulty option */
351                  cp = sskip(cp);
# Line 357 | Line 367 | char   *nm;
367   }
368  
369  
370 + printopts()                     /* print out option default values */
371 + {
372 +        printf("m=%s\t\t\t# material name\n", thisillum.matname);
373 +        printf("f=%s\t\t\t# data file name\n", thisillum.datafile);
374 +        printf("c=n\t\t\t\t# color none\n");
375 +        printf("d=%d\t\t\t\t# density of points\n", thisillum.sampdens);
376 +        printf("s=%d\t\t\t\t# samples per point\n", thisillum.nsamps);
377 + }
378 +
379 +
380   printhead(ac, av)                       /* print out header */
381   register int  ac;
382   register char  **av;
# Line 366 | Line 386 | register char  **av;
386                  putchar(' ');
387                  fputs(*av++, stdout);
388          }
389 <        putchar('\n');
389 >        fputs("\n#@mkillum !\n", stdout);
390   }
391  
392  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines