--- ray/src/gen/mkillum.c 1991/07/25 10:59:05 1.6 +++ ray/src/gen/mkillum.c 1991/08/13 14:43:49 1.11 @@ -15,9 +15,10 @@ static char SCCSid[] = "$SunId$ LBL"; #include /* default parameters */ -#define SAMPDENS 128 /* points per projected steradian */ +#define SAMPDENS 48 /* points per projected steradian */ #define NSAMPS 32 /* samples per point */ #define DFLMAT "illum_mat" /* material name */ +#define DFLDAT "illum" /* data file name */ /* selection options */ #define S_NONE 0 /* select none */ #define S_ELEM 1 /* select specified element */ @@ -36,7 +37,7 @@ struct rtproc rt; /* our rtrace process */ struct illum_args thisillum = { /* our illum and default values */ 0, DFLMAT, - DFLMAT, + DFLDAT, 0, VOIDID, SAMPDENS, @@ -89,6 +90,7 @@ char *argv[]; rtargv[rtargc] = NULL; /* just asking for defaults? */ if (!strcmp(argv[gargc-1], "-defaults")) { + printopts(); fflush(stdout); rtpath = getpath(rtargv[0], getenv("PATH"), X_OK); if (rtpath == NULL) { eputs(rtargv[0]); @@ -256,6 +258,7 @@ char *nm; break; if (!*++cp) { strcpy(thisillum.datafile,thisillum.matname); + thisillum.dfnum = 0; thisillum.flags &= ~IL_DATCLB; continue; } @@ -268,8 +271,9 @@ char *nm; case 'e': /* exclude material */ if (cp[1] != '=') break; - matselect = (*++cp == 'i') ? S_ELEM : S_COMPL; - atos(matcheck, MAXSTR, ++cp); + matselect = (*cp == 'i') ? S_ELEM : S_COMPL; + cp += 2; + atos(matcheck, MAXSTR, cp); cp = sskip(cp); continue; case 'a': /* use everything */ @@ -340,9 +344,9 @@ char *nm; doneheader = 0; continue; case '!': /* processed file! */ - sprintf(errmsg, "(%s): processed by mkillum already!", - nm); + sprintf(errmsg, "(%s): already processed!", nm); error(WARNING, errmsg); + matselect = S_NONE; return; } opterr: /* skip faulty option */ @@ -362,6 +366,16 @@ char *nm; } /* print pure comment */ printf("# %s", s+2); +} + + +printopts() /* print out option default values */ +{ + printf("m=%-15s\t\t# material name\n", thisillum.matname); + printf("f=%-15s\t\t# data file name\n", thisillum.datafile); + printf("c=n\t\t\t\t# color none\n"); + printf("d=%d\t\t\t\t# density of points\n", thisillum.sampdens); + printf("s=%d\t\t\t\t# samples per point\n", thisillum.nsamps); }