--- ray/src/rt/ambient.c 2003/05/15 05:13:35 2.49 +++ ray/src/rt/ambient.c 2003/06/26 00:58:10 2.51 @@ -1,5 +1,5 @@ #ifndef lint -static const char RCSid[] = "$Id: ambient.c,v 2.49 2003/05/15 05:13:35 greg Exp $"; +static const char RCSid[] = "$Id: ambient.c,v 2.51 2003/06/26 00:58:10 schorsch Exp $"; #endif /* * ambient.c - routines dealing with ambient (inter-reflected) component. @@ -9,12 +9,10 @@ static const char RCSid[] = "$Id: ambient.c,v 2.49 200 #include "copyright.h" +#include "platform.h" #include "ray.h" - #include "otypes.h" - #include "ambient.h" - #include "random.h" #ifndef OCTSCALE @@ -165,7 +163,9 @@ setambient() /* initialize calculation */ (flen - pos)/AMBVALSIZ); error(WARNING, errmsg); fseek(ambfp, pos, 0); +#ifndef _WIN32 /* XXX we need a replacement for that one */ ftruncate(fileno(ambfp), (off_t)pos); +#endif } } else if ((ambfp = fopen(ambfile, "w+")) != NULL) { initambfile(1); /* else create new file */ @@ -474,9 +474,7 @@ int creat; #ifdef F_SETLKW aflock(creat ? F_WRLCK : F_RDLCK); #endif -#ifdef MSDOS - setmode(fileno(ambfp), O_BINARY); -#endif + SET_FILE_BINARY(ambfp); if (mybuf == NULL) mybuf = (char *)bmalloc(BUFSIZ+8); setbuf(ambfp, mybuf);