24 |
|
|
25 |
|
#define CTRL(c) ((c)-'@') |
26 |
|
|
27 |
+ |
#ifdef SMLFLT |
28 |
+ |
#define sscanvec(s,v) (sscanf(s,"%f %f %f",v,v+1,v+2)==3) |
29 |
+ |
#else |
30 |
+ |
#define sscanvec(s,v) (sscanf(s,"%lf %lf %lf",v,v+1,v+2)==3) |
31 |
+ |
#endif |
32 |
+ |
|
33 |
+ |
|
34 |
|
extern char VersionID[]; |
35 |
|
extern char *progname; |
36 |
|
extern char *octname; |
93 |
|
(*dev->comout)(buf); |
94 |
|
(*dev->comin)(buf, NULL); |
95 |
|
if (buf[0] == CTRL('C')) return; |
96 |
< |
if (sscanf(buf, "%lf %lf %lf", &nv.vp[0], &nv.vp[1], &nv.vp[2]) == 3) |
96 |
> |
if (sscanvec(buf, nv.vp)) |
97 |
|
change++; |
98 |
|
else |
99 |
|
VCOPY(nv.vp, ourview.vp); |
102 |
|
(*dev->comout)(buf); |
103 |
|
(*dev->comin)(buf, NULL); |
104 |
|
if (buf[0] == CTRL('C')) return; |
105 |
< |
if (sscanf(buf,"%lf %lf %lf",&nv.vdir[0],&nv.vdir[1],&nv.vdir[2]) == 3) |
105 |
> |
if (sscanvec(buf, nv.vdir)) |
106 |
|
change++; |
107 |
|
else |
108 |
|
VCOPY(nv.vdir, ourview.vdir); |
111 |
|
(*dev->comout)(buf); |
112 |
|
(*dev->comin)(buf, NULL); |
113 |
|
if (buf[0] == CTRL('C')) return; |
114 |
< |
if (sscanf(buf,"%lf %lf %lf",&nv.vup[0],&nv.vup[1],&nv.vup[2]) == 3) |
114 |
> |
if (sscanvec(buf, nv.vup)) |
115 |
|
change++; |
116 |
|
else |
117 |
|
VCOPY(nv.vup, ourview.vup); |
297 |
|
e *= atof(cp); |
298 |
|
} |
299 |
|
if (p != NULL) { /* relative setting */ |
300 |
< |
if (bright(p->v) <= FTINY) { |
300 |
> |
if (bright(p->v) < 1e-25) { |
301 |
|
error(COMMAND, "cannot normalize to zero"); |
302 |
|
return; |
303 |
|
} |
516 |
|
int x, y; |
517 |
|
RAY thisray; |
518 |
|
|
519 |
< |
if (sscanf(s, "%lf %lf %lf %lf %lf %lf", |
520 |
< |
&thisray.rorg[0], &thisray.rorg[1], &thisray.rorg[2], |
514 |
< |
&thisray.rdir[0], &thisray.rdir[1], &thisray.rdir[2]) != 6) { |
519 |
> |
if (!sscanvec(s, thisray.rorg) || |
520 |
> |
!sscanvec(sskip(sskip(sskip(s))), thisray.rdir)) { |
521 |
|
|
522 |
|
if (dev->getcur == NULL) |
523 |
|
return; |