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

Comparing ray/src/rt/rv2.c (file contents):
Revision 1.30 by greg, Mon Oct 21 13:30:43 1991 UTC vs.
Revision 1.31 by greg, Tue Oct 22 11:58:17 1991 UTC

# Line 321 | Line 321 | register union {int i; double d; COLOR C;}  *ptr;
321                          (*dev->comout)(buf);
322                          (*dev->comin)(buf, NULL);
323                          if (sscanf(buf, "%d", &i0) != 1)
324 <                                break;
324 >                                return(0);
325                  }
326                  ptr->i = i0;
327 <                break;
327 >                return(1);
328          case 'r':                       /* real */
329                  if (sscanf(str, "%lf", &d0) != 1) {
330                          (*dev->comout)(dsc);
# Line 332 | Line 332 | register union {int i; double d; COLOR C;}  *ptr;
332                          (*dev->comout)(buf);
333                          (*dev->comin)(buf, NULL);
334                          if (sscanf(buf, "%lf", &d0) != 1)
335 <                                break;
335 >                                return(0);
336                  }
337                  ptr->d = d0;
338 <                break;
338 >                return(1);
339          case 'b':                       /* boolean */
340                  if (sscanf(str, "%1s", buf) != 1) {
341                          (*dev->comout)(dsc);
# Line 344 | Line 344 | register union {int i; double d; COLOR C;}  *ptr;
344                          (*dev->comin)(buf, NULL);
345                          if (buf[0] == '\0' ||
346                                          index("yY+1tTnN-0fF", buf[0]) == NULL)
347 <                                break;
347 >                                return(0);
348                  }
349                  ptr->i = index("yY+1tT", buf[0]) != NULL;
350 <                break;
350 >                return(1);
351          case 'C':                       /* color */
352                  if (sscanf(str, "%lf %lf %lf", &d0, &d1, &d2) != 3) {
353                          (*dev->comout)(dsc);
# Line 358 | Line 358 | register union {int i; double d; COLOR C;}  *ptr;
358                          (*dev->comout)(buf);
359                          (*dev->comin)(buf, NULL);
360                          if (sscanf(buf, "%lf %lf %lf", &d0, &d1, &d2) != 3)
361 <                                break;
361 >                                return(0);
362                  }
363                  setcolor(ptr->C, d0, d1, d2);
364 <                break;
364 >                return(1);
365          }
366   }
367  
# Line 390 | Line 390 | register char  *s;
390          
391          if (s[0] == '\0') {
392                  (*dev->comout)(
393 <                        "aa ab ad ar as av b dc di dj dt i lr lw sp st: ");
393 >                        "aa ab ad ar as av b dc di dj ds dt i lr lw sp st: ");
394                  (*dev->comin)(buf, NULL);
395                  s = buf;
396          }
# Line 453 | Line 453 | register char  *s;
453                          getparam(s+2, "ambient bounces", 'i', &ambounce);
454                          break;
455                  case 'r':
456 <                        getparam(s+2, "ambient resolution", 'i', &ambres);
457 <                        minarad = ambres > 0 ? thescene.cusize/ambres : 0.0;
456 >                        if (getparam(s+2, "ambient resolution", 'i', &ambres))
457 >                                minarad = ambres > 0 ?
458 >                                                thescene.cusize/ambres : 0.0;
459                          break;
460                  default:
461                          goto badparam;
# Line 463 | Line 464 | register char  *s;
464          case 's':                       /* sample */
465                  switch (s[1]) {
466                  case 'p':                       /* pixel */
467 <                        getparam(s+2, "sample pixel", 'i', &psample);
468 <                        pdepth = 0;
467 >                        if (getparam(s+2, "sample pixel", 'i', &psample))
468 >                                pdepth = 0;
469                          break;
470                  case 't':                       /* threshold */
471 <                        getparam(s+2, "sample threshold", 'r', &maxdiff);
472 <                        pdepth = 0;
471 >                        if (getparam(s+2, "sample threshold", 'r', &maxdiff))
472 >                                pdepth = 0;
473                          break;
474                  default:
475                          goto badparam;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines