--- ray/src/util/rad.c 2004/03/26 21:36:19 2.76 +++ ray/src/util/rad.c 2005/09/12 14:40:13 2.81 @@ -1,5 +1,5 @@ #ifndef lint -static const char RCSid[] = "$Id: rad.c,v 2.76 2004/03/26 21:36:19 schorsch Exp $"; +static const char RCSid[] = "$Id: rad.c,v 2.81 2005/09/12 14:40:13 schorsch Exp $"; #endif /* * Executive program for oconv, rpict and pfilt @@ -281,8 +281,11 @@ checklast( /* check files and find most recent */ return(0); while ((fnames = nextword(thisfile, PATH_MAX, fnames)) != NULL) { if (thisfile[0] == '!' || - (thisfile[0] == '\\' && thisfile[1] == '!')) + (thisfile[0] == '\\' && thisfile[1] == '!')) { + if (!lastdate) + lastdate = 1; continue; + } if (!(thisdate = fdate(thisfile))) syserr(thisfile); if (thisdate > lastdate) @@ -469,7 +472,7 @@ static void oconv(void) /* run oconv and mkillum if necessary */ { static char illumtmp[] = "ilXXXXXX"; - char combuf[PATH_MAX], ocopts[64], mkopts[64]; + char combuf[PATH_MAX], ocopts[64], mkopts[1024]; oconvopts(ocopts); /* get options */ if (octreedate < scenedate) { /* check date on original octree */ @@ -596,12 +599,17 @@ oconvopts( /* get oconv options */ static void mkillumopts( /* get mkillum options */ - register char *mo + char *mo ) { /* BEWARE: This may be called via setdefaults(), so no assumptions */ - *mo = '\0'; + if (nprocs > 1) { + sprintf(mo, " -n %d", nprocs); + while (*mo) + mo++; + } else + *mo = '\0'; if (vdef(MKILLUM)) addarg(mo, vval(MKILLUM)); } @@ -1137,6 +1145,11 @@ myprintview( /* print out selected view */ VIEW vwr; char buf[128]; register char *cp; +#ifdef _WIN32 +/* XXX Should we allow something like this for all platforms? */ +/* XXX Or is it still required at all? */ +again: +#endif if (vopts == NULL) return(-1); #ifdef _WIN32 @@ -1307,8 +1320,10 @@ rpict( /* run rpict and pfilt for each view */ zopt, oct1name, rawfile); if (pfile != NULL && inchild()) { /* rpict persistent mode */ - if (!silent) + if (!silent) { printf("\t%s\n", combuf); + fflush(stdout); + } sprintf(combuf, "rpict%s %s %s%s%s %s > %s", rep, rppopt, res, po, opts, oct1name, rawfile); @@ -1350,7 +1365,7 @@ rpict( /* run rpict and pfilt for each view */ } wait_process(1); /* wait for children to finish */ if (pfile != NULL) { /* clean up rpict persistent mode */ - int pid; + RT_PID pid; fp = fopen(pfile, "r"); if (fp != NULL) { if (fscanf(fp, "%*s %d", &pid) != 1 || @@ -1429,7 +1444,7 @@ mvfile( /* move a file */ static int next_process(void) /* fork the next process (max. nprocs) */ { - int child_pid; + RT_PID child_pid; if (nprocs <= 1) return(0); /* it's us or no one */ @@ -1460,7 +1475,7 @@ wait_process( /* wait for process(es) to finish */ ) { int ourstatus = 0; - int pid, status; + RT_PID pid, status; if (all) all = children_running; @@ -1497,7 +1512,7 @@ int all; } int kill(pid, sig) /* win|unix_process.c should also wait and kill */ -int pid, sig; +RT_PID pid, sig; { return 0; }