Commit | Line | Data |
---|---|---|
e7e40a84 | 1 | /*- |
cad0e734 KB |
2 | * Copyright (c) 1985, 1993 |
3 | * The Regents of the University of California. All rights reserved. | |
e7e40a84 | 4 | * |
ad787160 C |
5 | * This module is believed to contain source code proprietary to AT&T. |
6 | * Use and redistribution is subject to the Berkeley Software License | |
7 | * Agreement and your Software Agreement with AT&T (Western Electric). | |
b059c7be DF |
8 | */ |
9 | ||
6873b236 | 10 | #ifndef lint |
ad787160 | 11 | static char sccsid[] = "@(#)subr.c 8.1 (Berkeley) 6/4/93"; |
e7e40a84 | 12 | #endif /* not lint */ |
6873b236 JK |
13 | |
14 | #include <stdio.h> | |
15 | float obotx = 0.; | |
16 | float oboty = 0.; | |
17 | float botx = 0.; | |
18 | float boty = 0.; | |
19 | float scalex = 1.; | |
20 | float scaley = 1.; | |
21 | int scaleflag; | |
22 | ||
23 | int oloy = -1; | |
24 | int ohiy = -1; | |
25 | int ohix = -1; | |
26 | cont(x,y){ | |
27 | int hix,hiy,lox,loy; | |
28 | int n; | |
29 | x = (x-obotx)*scalex + botx; | |
30 | y = (y-oboty)*scaley + boty; | |
31 | hix=(x>>5) & 037; | |
32 | hiy=(y>>5) & 037; | |
33 | lox = x & 037; | |
34 | loy = y & 037; | |
35 | n = (abs(hix-ohix) + abs(hiy-ohiy) + 6) / 12; | |
36 | if(hiy != ohiy){ | |
37 | putch(hiy|040); | |
38 | ohiy=hiy; | |
39 | } | |
40 | if(hix != ohix){ | |
41 | putch(loy|0140); | |
42 | putch(hix|040); | |
43 | ohix=hix; | |
44 | oloy=loy; | |
45 | } | |
46 | else if(loy != oloy){ | |
47 | putch(loy|0140); | |
48 | oloy=loy; | |
49 | } | |
50 | putch(lox|0100); | |
51 | while(n--) | |
52 | putch(0); | |
53 | } | |
54 | ||
55 | putch(c){ | |
56 | putc(c,stdout); | |
57 | } |