7 |
|
* 7/1/87 |
8 |
|
*/ |
9 |
|
|
10 |
+ |
#include "copyright.h" |
11 |
+ |
|
12 |
+ |
#include <string.h> |
13 |
+ |
|
14 |
+ |
#include "platform.h" |
15 |
|
#include "standard.h" |
16 |
+ |
#include "resolu.h" |
17 |
|
#include "color.h" |
18 |
|
#include "font.h" |
19 |
|
|
39 |
|
int xsiz, ysiz; /* bitmap dimensions */ |
40 |
|
int xdim; /* size of horizontal scan (bytes) */ |
41 |
|
|
42 |
+ |
/* conflicting def's in param.h */ |
43 |
+ |
#undef tstbit |
44 |
+ |
#undef setbit |
45 |
+ |
#undef clrbit |
46 |
+ |
#undef tglbit |
47 |
+ |
|
48 |
|
#define bitop(x,y,op) (ourbitmap[(y)*xdim+((x)>>3)] op (1<<((x)&7))) |
49 |
|
#define tstbit(x,y) bitop(x,y,&) |
50 |
|
#define setbit(x,y) bitop(x,y,|=) |
63 |
|
int nlines, maxline; /* text dimensions */ |
64 |
|
int maxwidth; /* maximum line width (dvi) */ |
65 |
|
|
66 |
+ |
static void makemap(void); |
67 |
+ |
static void gettext(FILE *fp); |
68 |
+ |
static void arg_text(int ac, char *av[]); |
69 |
+ |
static void maptext(void); |
70 |
+ |
static void mapglyph(GLYPH *gl, int tx0, int ty0); |
71 |
+ |
static void mapcoord(int p[2], int tx, int ty); |
72 |
+ |
static void mapedge(int x, int y, int run, int rise); |
73 |
+ |
static void writemap(FILE *fp); |
74 |
|
|
75 |
< |
main(argc, argv) |
76 |
< |
int argc; |
77 |
< |
char *argv[]; |
75 |
> |
|
76 |
> |
int |
77 |
> |
main( |
78 |
> |
int argc, |
79 |
> |
char *argv[] |
80 |
> |
) |
81 |
|
{ |
82 |
|
int an; |
83 |
|
SET_FILE_BINARY(stdout); |
161 |
|
} |
162 |
|
|
163 |
|
|
164 |
< |
makemap() /* create the bit map */ |
164 |
> |
static void |
165 |
> |
makemap(void) /* create the bit map */ |
166 |
|
{ |
167 |
|
double pictaspect; |
168 |
|
|
221 |
|
ourbitmap = (BYTE *)bmalloc(ysiz*xdim); |
222 |
|
if (ourbitmap == NULL) |
223 |
|
error(SYSTEM, "Out of memory in makemap"); |
224 |
< |
bzero((char *)ourbitmap, ysiz*xdim); |
224 |
> |
memset((char *)ourbitmap, '\0', ysiz*xdim); |
225 |
|
} |
226 |
|
|
227 |
|
|
228 |
< |
gettext(fp) /* get text from a file */ |
229 |
< |
FILE *fp; |
228 |
> |
static void |
229 |
> |
gettext( /* get text from a file */ |
230 |
> |
FILE *fp |
231 |
> |
) |
232 |
|
{ |
233 |
|
char buf[MAXLINE]; |
234 |
|
register LINE *curl; |
244 |
|
len = strlen(buf); |
245 |
|
curl->s = (char *)malloc(len); |
246 |
|
curl->sp = (short *)malloc(sizeof(short)*len--); |
247 |
< |
if (curl->s == NULL | curl->sp == NULL) |
247 |
> |
if ((curl->s == NULL) | (curl->sp == NULL)) |
248 |
|
goto memerr; |
249 |
|
if (len > maxline) |
250 |
|
maxline = len; |
270 |
|
} |
271 |
|
|
272 |
|
|
273 |
< |
arg_text(ac, av) /* get text from arguments */ |
274 |
< |
int ac; |
275 |
< |
char *av[]; |
273 |
> |
static void |
274 |
> |
arg_text( /* get text from arguments */ |
275 |
> |
int ac, |
276 |
> |
char *av[] |
277 |
> |
) |
278 |
|
{ |
279 |
|
register char *cp; |
280 |
|
|
310 |
|
} |
311 |
|
|
312 |
|
|
313 |
< |
maptext() /* map our text */ |
313 |
> |
static void |
314 |
> |
maptext(void) /* map our text */ |
315 |
|
{ |
316 |
|
register LINE *curl; |
317 |
|
int l, len; |
327 |
|
} |
328 |
|
|
329 |
|
|
330 |
< |
mapglyph(gl, tx0, ty0) /* convert a glyph */ |
331 |
< |
GLYPH *gl; |
332 |
< |
int tx0, ty0; |
330 |
> |
static void |
331 |
> |
mapglyph( /* convert a glyph */ |
332 |
> |
GLYPH *gl, |
333 |
> |
int tx0, |
334 |
> |
int ty0 |
335 |
> |
) |
336 |
|
{ |
337 |
|
int n; |
338 |
|
register GORD *gp; |
353 |
|
} |
354 |
|
|
355 |
|
|
356 |
< |
mapcoord(p, tx, ty) /* map text to picture coordinates */ |
357 |
< |
int p[2], tx, ty; |
356 |
> |
static void |
357 |
> |
mapcoord( /* map text to picture coordinates */ |
358 |
> |
int p[2], |
359 |
> |
int tx, |
360 |
> |
int ty |
361 |
> |
) |
362 |
|
{ |
363 |
|
tx = (long)tx*cwidth >> 8; |
364 |
|
ty = (long)ty*cheight >> 8; |
384 |
|
} |
385 |
|
|
386 |
|
|
387 |
< |
mapedge(x, y, run, rise) /* map an edge */ |
388 |
< |
register int x, y; |
389 |
< |
int run, rise; |
387 |
> |
static void |
388 |
> |
mapedge( /* map an edge */ |
389 |
> |
register int x, |
390 |
> |
register int y, |
391 |
> |
int run, |
392 |
> |
int rise |
393 |
> |
) |
394 |
|
{ |
395 |
|
int xstep; |
396 |
|
int rise2, run2; |
425 |
|
} |
426 |
|
|
427 |
|
|
428 |
< |
writemap(fp) /* write out bitmap */ |
429 |
< |
FILE *fp; |
428 |
> |
static void |
429 |
> |
writemap( /* write out bitmap */ |
430 |
> |
FILE *fp |
431 |
> |
) |
432 |
|
{ |
433 |
|
COLR pixval[SSS*SSS+1]; /* possible pixel values */ |
434 |
|
COLOR ctmp0, ctmp1; |