--- ray/src/rt/rtrace.c 2003/04/18 17:29:22 2.29 +++ ray/src/rt/rtrace.c 2003/07/21 22:30:19 2.33 @@ -1,5 +1,5 @@ #ifndef lint -static const char RCSid[] = "$Id: rtrace.c,v 2.29 2003/04/18 17:29:22 greg Exp $"; +static const char RCSid[] = "$Id: rtrace.c,v 2.33 2003/07/21 22:30:19 schorsch Exp $"; #endif /* * rtrace.c - program and variables for individual ray tracing. @@ -21,10 +21,11 @@ static const char RCSid[] = "$Id: rtrace.c,v 2.29 2003 * irradiance values are desired. */ -#include "ray.h" +#include +#include "platform.h" +#include "ray.h" #include "otypes.h" - #include "resolu.h" CUBE thescene; /* our scene */ @@ -108,7 +109,7 @@ void quit(code) /* quit program */ int code; { -#ifndef NIX +#ifndef NON_POSIX /* XXX we don't clean up elsewhere? */ headclean(); /* delete header file */ pfclean(); /* clean up persist files */ #endif @@ -146,9 +147,9 @@ char *fname; sprintf(errmsg, "cannot open input file \"%s\"", fname); error(SYSTEM, errmsg); } -#ifdef MSDOS +#ifdef _WIN32 if (inform != 'a') - setmode(fileno(fp), O_BINARY); + SET_FILE_BINARY(fp); #endif /* set up output */ setoutput(outvals); @@ -284,12 +285,13 @@ double dmax; thisray.rmax = dmax; rayorigin(&thisray, NULL, PRIMARY, 1.0); if (castonly) { - if (!localhit(&thisray, &thescene)) + if (!localhit(&thisray, &thescene)) { if (thisray.ro == &Aftplane) { /* clipped */ thisray.ro = NULL; thisray.rot = FHUGE; } else sourcehit(&thisray); + } } else rayvalue(&thisray); printvals(&thisray);