1 /* 2 * Copyright (c) 1985 Regents of the University of California. 3 * All rights reserved. The Berkeley software License Agreement 4 * specifies the terms and conditions for redistribution. 5 */ 6 7 #ifndef lint 8 static char sccsid[] = "@(#)line.c 5.1 (Berkeley) 09/21/85"; 9 #endif not lint 10 11 #include "imp.h" 12 #include "imPcodes.h" 13 14 float obotx = 0.; 15 float oboty = 0.; 16 float botx = 0.; 17 float boty = 0.; 18 float scalex = 1.; 19 float scaley = 1.; 20 line(x0,y0,x1,y1) 21 { 22 putch(imP_CREATE_PATH); 23 putwd(2); /* two coordinates follow */ 24 putwd((int)((x0-obotx)*scalex+botx+1)); 25 putwd((int)((y0-oboty)*scaley+boty+1)); 26 putwd((int)((x1-obotx)*scalex+botx+1)); 27 putwd((int)((y1-oboty)*scaley+boty+1)); 28 putch(imP_DRAW_PATH); 29 putch(15); /* "black" lines */ 30 imPx = x1; 31 imPy = y1; 32 } 33 putch(c) 34 { 35 putc(c, stdout); 36 } 37 putwd(w) 38 { 39 putch(w>>8); 40 putch(w); 41 } 42