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

Comparing ray/src/rt/rpict.c (file contents):
Revision 2.25 by greg, Fri May 28 18:59:50 1993 UTC vs.
Revision 2.26 by greg, Fri Jul 30 10:31:09 1993 UTC

# Line 153 | Line 153 | char  *pout, *zout, *prvr;
153   {
154          extern char  *rindex(), *strncpy(), *strcat(), *strcpy();
155          char  fbuf[128], fbuf2[128];
156 +        int  npicts;
157          register char  *cp;
158          RESOLU  rs;
159          double  pa;
# Line 197 | Line 198 | char  *pout, *zout, *prvr;
198                          }
199                  }
200          }
201 <                                        /* render sequence */
201 >        npicts = 0;                     /* render sequence */
202          do {
203                  if (seq && nextview(stdin) == EOF)
204                          break;
205                  pctdone = 0.0;
206                  if (pout != NULL) {
207                          sprintf(fbuf, pout, seq);
208 +                        if (prvr == NULL && access(fbuf, F_OK) == 0)
209 +                                continue;               /* don't clobber */
210                          if (freopen(fbuf, "w", stdout) == NULL) {
211                                  sprintf(errmsg,
212                                          "cannot open output file \"%s\"", fbuf);
# Line 251 | Line 254 | char  *pout, *zout, *prvr;
254                          cp = NULL;
255                  render(cp, prvr);
256                  prvr = NULL;
257 +                npicts++;
258          } while (seq++);
259 +                                        /* check that we did something */
260 +        if (npicts == 0)
261 +                error(WARNING, "no output produced");
262   }
263  
264  
# Line 297 | Line 304 | char  *zfile, *oldfile;
304                          sampdens[i] = hstep;
305          } else
306                  sampdens = NULL;
307 <                                        /* open z file */
307 >                                        /* open z-file */
308          if (zfile != NULL) {
309                  if ((zfd = open(zfile, O_WRONLY|O_CREAT, 0666)) == -1) {
310 <                        sprintf(errmsg, "cannot open z file \"%s\"", zfile);
310 >                        sprintf(errmsg, "cannot open z-file \"%s\"", zfile);
311                          error(SYSTEM, errmsg);
312                  }
313   #ifdef MSDOS
# Line 322 | Line 329 | char  *zfile, *oldfile;
329          i = salvage(oldfile);
330          if (zfd != -1 && i > 0 &&
331                          lseek(zfd, (long)i*hres*sizeof(float), 0) == -1)
332 <                error(SYSTEM, "z file seek error in render");
332 >                error(SYSTEM, "z-file seek error in render");
333          pctdone = 100.0*i/vres;
334          if (ralrm > 0)                  /* report init stats */
335                  report();

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines