--- ray/src/rt/rv2.c 2003/02/25 02:47:23 2.39 +++ ray/src/rt/rv2.c 2003/07/21 22:30:19 2.42 @@ -1,5 +1,5 @@ #ifndef lint -static const char RCSid[] = "$Id: rv2.c,v 2.39 2003/02/25 02:47:23 greg Exp $"; +static const char RCSid[] = "$Id: rv2.c,v 2.42 2003/07/21 22:30:19 schorsch Exp $"; #endif /* * rv2.c - command routines used in tracing a view. @@ -9,14 +9,14 @@ static const char RCSid[] = "$Id: rv2.c,v 2.39 2003/02 #include "copyright.h" -#include "ray.h" +#include +#include +#include "platform.h" +#include "ray.h" #include "otypes.h" - #include "rpaint.h" -#include - extern int psample; /* pixel sample size */ extern double maxdiff; /* max. sample difference */ @@ -69,7 +69,7 @@ char *s; while (isspace(*s)) s++; if (*s == '-') { /* command line parameters */ - copystruct(&nv, &ourview); + nv = ourview; if (sscanview(&nv, s)) newview(&nv); else @@ -171,7 +171,7 @@ char *s; VIEW nv; if (sscanf(s, "%s", buf) == 1) { /* get parameters from a file */ - copystruct(&nv, &stdview); + nv = stdview; if ((fname = getpath(buf, "", R_OK)) == NULL || (success = viewfile(fname, &nv, NULL)) == -1) { sprintf(errmsg, "cannot open \"%s\"", buf); @@ -188,9 +188,9 @@ char *s; error(COMMAND, "no previous view"); return; } - copystruct(&nv, &ourview); - copystruct(&ourview, &oldview); - copystruct(&oldview, &nv); + nv = ourview; + ourview = oldview; + oldview = nv; newimage(); } @@ -265,7 +265,7 @@ char *s; buf[0] = '\0'; fgets(buf, sizeof(buf), fp); pclose(fp); - copystruct(&nv, &stdview); + nv = stdview; if (!sscanview(&nv, buf)) { error(COMMAND, "rad error -- no such view?"); return; @@ -464,10 +464,10 @@ void *p; (*dev->comout)(buf); (*dev->comin)(buf, NULL); if (buf[0] == '\0' || - index("yY+1tTnN-0fF", buf[0]) == NULL) + strchr("yY+1tTnN-0fF", buf[0]) == NULL) return(0); } - ptr->i = index("yY+1tT", buf[0]) != NULL; + ptr->i = strchr("yY+1tT", buf[0]) != NULL; return(1); case 'C': /* color */ if (sscanf(str, "%lf %lf %lf", &d0, &d1, &d2) != 3) { @@ -754,9 +754,7 @@ char *s; error(COMMAND, errmsg); return; } -#ifdef MSDOS - setmode(fileno(fp), O_BINARY); -#endif + SET_FILE_BINARY(fp); (*dev->comout)("writing \""); (*dev->comout)(fname); (*dev->comout)("\"...\n");