9 |
|
*/ |
10 |
|
|
11 |
|
#include <stdio.h> |
12 |
– |
|
12 |
|
#include <time.h> |
13 |
+ |
#include <math.h> |
14 |
|
|
15 |
+ |
#include "platform.h" |
16 |
|
#include "color.h" |
16 |
– |
|
17 |
|
#include "resolu.h" |
18 |
– |
|
18 |
|
#include "targa.h" |
19 |
|
|
21 |
– |
#ifdef MSDOS |
22 |
– |
#include <fcntl.h> |
23 |
– |
#endif |
20 |
|
|
25 |
– |
#include <math.h> |
26 |
– |
|
27 |
– |
#ifndef BSD |
28 |
– |
#define bcopy(s,d,n) (void)memcpy(d,s,n) |
29 |
– |
#endif |
30 |
– |
|
21 |
|
#define goodpic(h) (my_imType(h) && my_mapType(h)) |
22 |
|
#define my_imType(h) (((h)->dataType==IM_CMAP || (h)->dataType==IM_CCMAP) \ |
23 |
|
&& (h)->dataBits==8 && (h)->imType==0) |
59 |
|
int ncolors = 256; |
60 |
|
int greyscale = 0; |
61 |
|
int i; |
62 |
< |
#ifdef MSDOS |
63 |
< |
extern int _fmode; |
64 |
< |
_fmode = O_BINARY; |
75 |
< |
setmode(fileno(stdin), O_BINARY); |
76 |
< |
setmode(fileno(stdout), O_BINARY); |
77 |
< |
#endif |
62 |
> |
SET_DEFAULT_BINARY(); |
63 |
> |
SET_FILE_BINARY(stdin); |
64 |
> |
SET_FILE_BINARY(stdout); |
65 |
|
progname = argv[0]; |
66 |
|
samplefac = 0; |
67 |
|
|