1 |
greg |
1.1 |
#ifndef lint |
2 |
|
|
static const char RCSid[] = "$Id$"; |
3 |
|
|
#endif |
4 |
|
|
#ifndef lint |
5 |
|
|
static char sccsid[] = "@(#)subr.c 4.1 (Berkeley) 6/27/83"; |
6 |
|
|
#endif |
7 |
|
|
|
8 |
|
|
#include <stdio.h> |
9 |
|
|
float obotx = 0.; |
10 |
|
|
float oboty = 0.; |
11 |
|
|
float botx = 0.; |
12 |
|
|
float boty = 0.; |
13 |
|
|
float scalex = 1.; |
14 |
|
|
float scaley = 1.; |
15 |
|
|
int scaleflag; |
16 |
|
|
|
17 |
|
|
int oloy = -1; |
18 |
|
|
int ohiy = -1; |
19 |
|
|
int ohix = -1; |
20 |
|
|
int oextra = -1; |
21 |
|
|
cont(x,y){ |
22 |
|
|
int hix,hiy,lox,loy,extra; |
23 |
|
|
int n; |
24 |
|
|
x = (x-obotx)*scalex + botx; |
25 |
|
|
y = (y-oboty)*scaley + boty; |
26 |
|
|
hix=(x>>7) & 037; |
27 |
|
|
hiy=(y>>7) & 037; |
28 |
|
|
lox = (x>>2)&037; |
29 |
|
|
loy=(y>>2)&037; |
30 |
|
|
extra=x&03+(y<<2)&014; |
31 |
|
|
n = (abs(hix-ohix) + abs(hiy-ohiy) + 6) / 12; |
32 |
|
|
if(hiy != ohiy){ |
33 |
|
|
putch(hiy|040); |
34 |
|
|
ohiy=hiy; |
35 |
|
|
} |
36 |
|
|
if(hix != ohix){ |
37 |
|
|
if(extra != oextra){ |
38 |
|
|
putch(extra|0140); |
39 |
|
|
oextra=extra; |
40 |
|
|
} |
41 |
|
|
putch(loy|0140); |
42 |
|
|
putch(hix|040); |
43 |
|
|
ohix=hix; |
44 |
|
|
oloy=loy; |
45 |
|
|
} |
46 |
|
|
else{ |
47 |
|
|
if(extra != oextra){ |
48 |
|
|
putch(extra|0140); |
49 |
|
|
putch(loy|0140); |
50 |
|
|
oextra=extra; |
51 |
|
|
oloy=loy; |
52 |
|
|
} |
53 |
|
|
else if(loy != oloy){ |
54 |
|
|
putch(loy|0140); |
55 |
|
|
oloy=loy; |
56 |
|
|
} |
57 |
|
|
} |
58 |
|
|
putch(lox|0100); |
59 |
|
|
while(n--) |
60 |
|
|
putch(0); |
61 |
|
|
} |
62 |
|
|
|
63 |
|
|
putch(c){ |
64 |
|
|
putc(c,stdout); |
65 |
|
|
} |