12 |
|
|
13 |
|
#include <stdio.h> |
14 |
|
|
15 |
+ |
#ifdef MSDOS |
16 |
+ |
#include <fcntl.h> |
17 |
+ |
#endif |
18 |
+ |
|
19 |
|
#include "color.h" |
20 |
|
|
21 |
|
#include "ambient.h" |
29 |
|
|
30 |
|
|
31 |
|
main(argc, argv) /* load ambient values from a file */ |
32 |
+ |
int argc; |
33 |
|
char *argv[]; |
34 |
|
{ |
35 |
|
FILE *fp; |
65 |
|
if (header) { |
66 |
|
if (checkheader(fp, "ascii", stdout) < 0) |
67 |
|
goto formaterr; |
68 |
< |
} else |
68 |
> |
} else { |
69 |
> |
newheader("RADIANCE", stdout); |
70 |
|
printargs(argc, argv, stdout); |
71 |
+ |
} |
72 |
|
fputformat(AMBFMT, stdout); |
73 |
|
putchar('\n'); |
74 |
+ |
#ifdef MSDOS |
75 |
+ |
setmode(fileno(stdout), O_BINARY); |
76 |
+ |
#endif |
77 |
|
putambmagic(stdout); |
78 |
|
writamb(fp); |
79 |
|
} else { |
80 |
+ |
#ifdef MSDOS |
81 |
+ |
setmode(fileno(fp), O_BINARY); |
82 |
+ |
#endif |
83 |
|
if (checkheader(fp, AMBFMT, header ? stdout : (FILE *)NULL) < 0) |
84 |
|
goto formaterr; |
85 |
|
if (!hasambmagic(fp)) |