9 |
|
|
10 |
|
#include "copyright.h" |
11 |
|
|
12 |
+ |
#include "platform.h" |
13 |
|
#include "ray.h" |
13 |
– |
|
14 |
|
#include "otypes.h" |
15 |
– |
|
15 |
|
#include "ambient.h" |
17 |
– |
|
16 |
|
#include "random.h" |
17 |
|
|
18 |
|
#ifndef OCTSCALE |
163 |
|
(flen - pos)/AMBVALSIZ); |
164 |
|
error(WARNING, errmsg); |
165 |
|
fseek(ambfp, pos, 0); |
166 |
+ |
#ifndef _WIN32 /* XXX we need a replacement for that one */ |
167 |
|
ftruncate(fileno(ambfp), (off_t)pos); |
168 |
+ |
#endif |
169 |
|
} |
170 |
|
} else if ((ambfp = fopen(ambfile, "w+")) != NULL) { |
171 |
|
initambfile(1); /* else create new file */ |
474 |
|
#ifdef F_SETLKW |
475 |
|
aflock(creat ? F_WRLCK : F_RDLCK); |
476 |
|
#endif |
477 |
< |
#ifdef MSDOS |
478 |
< |
setmode(fileno(ambfp), O_BINARY); |
479 |
< |
#endif |
477 |
> |
SET_FILE_BINARY(ambfp); |
478 |
|
if (mybuf == NULL) |
479 |
|
mybuf = (char *)bmalloc(BUFSIZ+8); |
480 |
|
setbuf(ambfp, mybuf); |