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

Comparing ray/src/cv/mgflib/context.c (file contents):
Revision 1.20 by greg, Wed Apr 12 17:16:33 1995 UTC vs.
Revision 1.23 by greg, Mon Aug 28 16:44:12 1995 UTC

# Line 105 | Line 105 | register char  **av;
105                          c_ccname = NULL;
106                          return(MG_OK);
107                  }
108 +                if (!isname(av[1]))
109 +                        return(MG_EILL);
110                  lp = lu_find(&clr_tab, av[1]);  /* lookup context */
111                  if (lp == NULL)
112                          return(MG_EMEM);
# Line 221 | Line 223 | register char  **av;
223                          c_cmname = NULL;
224                          return(MG_OK);
225                  }
226 +                if (!isname(av[1]))
227 +                        return(MG_EILL);
228                  lp = lu_find(&mat_tab, av[1]);  /* lookup context */
229                  if (lp == NULL)
230                          return(MG_EMEM);
# Line 259 | Line 263 | register char  **av;
263                  *c_cmaterial = *(C_MATERIAL *)lp->data;
264                  c_cmaterial->clock = i + 1;
265                  return(MG_OK);
266 +        case MG_E_IR:           /* set index of refraction */
267 +                if (ac != 3)
268 +                        return(MG_EARGC);
269 +                if (!isflt(av[1]) | !isflt(av[2]))
270 +                        return(MG_ETYPE);
271 +                c_cmaterial->nr = atof(av[1]);
272 +                c_cmaterial->ni = atof(av[2]);
273 +                if (c_cmaterial->nr <= FTINY)
274 +                        return(MG_EILL);
275 +                c_cmaterial->clock++;
276 +                return(MG_OK);
277          case MG_E_RD:           /* set diffuse reflectance */
278                  if (ac != 2)
279                          return(MG_EARGC);
# Line 355 | Line 370 | register char  **av;
370                          c_cvname = NULL;
371                          return(MG_OK);
372                  }
373 +                if (!isname(av[1]))
374 +                        return(MG_EILL);
375                  lp = lu_find(&vtx_tab, av[1]);  /* lookup context */
376                  if (lp == NULL)
377                          return(MG_EMEM);
# Line 589 | Line 606 | char   **av;
606                  }
607                  if (n > 1)
608                          va[i] /= (double)n;
592                if (va[i] < 0.)
593                        return(MG_EILL);
609                  if (va[i] > scale)
610                          scale = va[i];
611 +                else if (va[i] < -scale)
612 +                        scale = -va[i];
613          }
614          if (scale <= FTINY)
615                  return(MG_EILL);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines