--- ray/src/util/dctimestep.c 2011/04/11 03:47:46 2.16 +++ ray/src/util/dctimestep.c 2012/02/21 20:09:25 2.19 @@ -1,5 +1,5 @@ #ifndef lint -static const char RCSid[] = "$Id: dctimestep.c,v 2.16 2011/04/11 03:47:46 greg Exp $"; +static const char RCSid[] = "$Id: dctimestep.c,v 2.19 2012/02/21 20:09:25 greg Exp $"; #endif /* * Compute time-step result using Daylight Coefficient method. @@ -300,13 +300,11 @@ cm_bsdf(const COLOR bsdfLamb, const COLOR specCol, con CMATRIX *cm = cm_alloc(bsdf->nout, bsdf->ninc); int nbadohm = 0; int nneg = 0; - float dom; - int doforward; int r, c; /* reciprocity is "transparent" */ for (c = 0; c < cm->ncols; c++) { - /* get projected solid angle */ - dom = mBSDF_incohm(bsdf,c); + const double dom = mBSDF_incohm(bsdf,c); + /* projected solid angle */ nbadohm += (dom <= 0); for (r = 0; r < cm->nrows; r++) { @@ -384,7 +382,8 @@ sum_images(const char *fspec, const CMATRIX *cv, FILE int dt, xr, yr; COLORV *psp; /* check for zero */ - if ((scv[RED] == 0) & (scv[GRN] == 0) & (scv[BLU] == 0)) + if ((scv[RED] == 0) & (scv[GRN] == 0) & (scv[BLU] == 0) && + (myDT != DTfromHeader) | (i < cv->nrows-1)) continue; /* open next picture */ sprintf(fname, fspec, i); @@ -446,16 +445,22 @@ sum_images(const char *fspec, const CMATRIX *cv, FILE static int hasNumberFormat(const char *s) { - while (*s && *s != '%') - s++; - if (!*s) - return(0); - do - ++s; - while (isdigit(*s)); - - return((*s == 'd') | (*s == 'i') | (*s == 'o') | - (*s == 'x') | (*s == 'X')); + while (*s) { + while (*s != '%') + if (!*s++) + return(0); + if (*++s == '%') { /* ignore "%%" */ + ++s; + continue; + } + while (isdigit(*s)) /* field length */ + ++s; + /* field we'll use? */ + if ((*s == 'd') | (*s == 'i') | (*s == 'o') | + (*s == 'x') | (*s == 'X')) + return(1); + } + return(0); /* didn't find one */ } int