ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/meta/lib4014/subr.c
Revision: 1.3
Committed: Sun Mar 28 20:33:13 2004 UTC (20 years, 1 month ago) by schorsch
Content type: text/plain
Branch: MAIN
CVS Tags: rad3R6P1, rad3R6
Changes since 1.2: +2 -2 lines
Log Message:
Continued ANSIfication, and other fixes and clarifications.

File Contents

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