9 |
|
|
10 |
|
#include "copyright.h" |
11 |
|
|
12 |
< |
#include "ray.h" |
12 |
> |
#include <ctype.h> |
13 |
> |
#include <string.h> |
14 |
|
|
15 |
+ |
#include "platform.h" |
16 |
+ |
#include "ray.h" |
17 |
|
#include "otypes.h" |
15 |
– |
|
18 |
|
#include "rpaint.h" |
19 |
|
|
18 |
– |
#include <ctype.h> |
19 |
– |
|
20 |
|
extern int psample; /* pixel sample size */ |
21 |
|
extern double maxdiff; /* max. sample difference */ |
22 |
|
|
69 |
|
while (isspace(*s)) |
70 |
|
s++; |
71 |
|
if (*s == '-') { /* command line parameters */ |
72 |
< |
copystruct(&nv, &ourview); |
72 |
> |
nv = ourview; |
73 |
|
if (sscanview(&nv, s)) |
74 |
|
newview(&nv); |
75 |
|
else |
171 |
|
VIEW nv; |
172 |
|
|
173 |
|
if (sscanf(s, "%s", buf) == 1) { /* get parameters from a file */ |
174 |
< |
copystruct(&nv, &stdview); |
174 |
> |
nv = stdview; |
175 |
|
if ((fname = getpath(buf, "", R_OK)) == NULL || |
176 |
|
(success = viewfile(fname, &nv, NULL)) == -1) { |
177 |
|
sprintf(errmsg, "cannot open \"%s\"", buf); |
188 |
|
error(COMMAND, "no previous view"); |
189 |
|
return; |
190 |
|
} |
191 |
< |
copystruct(&nv, &ourview); |
192 |
< |
copystruct(&ourview, &oldview); |
193 |
< |
copystruct(&oldview, &nv); |
191 |
> |
nv = ourview; |
192 |
> |
ourview = oldview; |
193 |
> |
oldview = nv; |
194 |
|
newimage(); |
195 |
|
} |
196 |
|
|
265 |
|
buf[0] = '\0'; |
266 |
|
fgets(buf, sizeof(buf), fp); |
267 |
|
pclose(fp); |
268 |
< |
copystruct(&nv, &stdview); |
268 |
> |
nv = stdview; |
269 |
|
if (!sscanview(&nv, buf)) { |
270 |
|
error(COMMAND, "rad error -- no such view?"); |
271 |
|
return; |
464 |
|
(*dev->comout)(buf); |
465 |
|
(*dev->comin)(buf, NULL); |
466 |
|
if (buf[0] == '\0' || |
467 |
< |
index("yY+1tTnN-0fF", buf[0]) == NULL) |
467 |
> |
strchr("yY+1tTnN-0fF", buf[0]) == NULL) |
468 |
|
return(0); |
469 |
|
} |
470 |
< |
ptr->i = index("yY+1tT", buf[0]) != NULL; |
470 |
> |
ptr->i = strchr("yY+1tT", buf[0]) != NULL; |
471 |
|
return(1); |
472 |
|
case 'C': /* color */ |
473 |
|
if (sscanf(str, "%lf %lf %lf", &d0, &d1, &d2) != 3) { |
754 |
|
error(COMMAND, errmsg); |
755 |
|
return; |
756 |
|
} |
757 |
< |
#ifdef MSDOS |
758 |
< |
setmode(fileno(fp), O_BINARY); |
759 |
< |
#endif |
757 |
> |
SET_FILE_BINARY(fp); |
758 |
|
(*dev->comout)("writing \""); |
759 |
|
(*dev->comout)(fname); |
760 |
|
(*dev->comout)("\"...\n"); |