--- ray/src/common/image.c 2005/01/18 00:33:16 2.29 +++ ray/src/common/image.c 2006/07/12 01:37:40 2.32 @@ -1,5 +1,5 @@ #ifndef lint -static const char RCSid[] = "$Id: image.c,v 2.29 2005/01/18 00:33:16 greg Exp $"; +static const char RCSid[] = "$Id: image.c,v 2.32 2006/07/12 01:37:40 greg Exp $"; #endif /* * image.c - routines for image generation. @@ -9,6 +9,7 @@ static const char RCSid[] = "$Id: image.c,v 2.29 2005/ #include "copyright.h" +#include #include "rtio.h" #include "rtmath.h" #include "paths.h" @@ -34,6 +35,8 @@ register VIEW *v; if (v->vaft < -FTINY || (v->vaft > FTINY && v->vaft <= v->vfore)) return("illegal fore/aft clipping plane"); + if (v->vdist <= FTINY) + return("illegal view distance"); v->vdist *= normalize(v->vdir); /* normalize direction */ if (v->vdist == 0.0) return("zero view direction"); @@ -349,6 +352,7 @@ register char *av[]; v->vdir[0] = atof(av[1]); v->vdir[1] = atof(av[2]); v->vdir[2] = atof(av[3]); + v->vdist = 1.; return(3); case 'u': /* up */ check(3,"fff"); @@ -397,18 +401,17 @@ register char *s; int na; int nvopts = 0; - while (*s == ' ') - s++; - if (*s != '-') - s = sskip2(s,1); + while (isspace(*s)) + if (!*s++) + return(0); while (*s) { ac = 0; do { if (ac || *s == '-') av[ac++] = s; - while (*s && *s != ' ') + while (*s && !isspace(*s)) s++; - while (*s == ' ') + while (isspace(*s)) s++; } while (*s && ac < 4); if ((na = getviewopt(vp, ac, av)) >= 0) {