Runge-Kutta-Simulation/AppleX/GRAPHICS/DRAWLINE.C

76 lines
1.6 KiB
C
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/* ------------------------------------------------------------------------
System : Manx Aztec C65 Version 3.2b
MS-DOS cross-development environment
Platform : Apple IIe 128K PRODOS 8
Program : dlopixel.c
Description : G2 Library Routine
Written by : Bill Buckels
Revision Date: May 20, 1991
Licence : You may use this code for whatever you wish as long
as you agree that Bill Buckels has no warranty or
liability obligations whatsoever from said use.
------------------------------------------------------------------------ */
#define BOX '\x01'
drawline(x1, y1, x2, y2, dcolor,action)
int x1, y1, x2, y2, dcolor;
char action;
{
/* make sure x2 is greater than x1 */
int temp;
if(x1 > x2)
{
temp=x1;
x1 = x2;
x2 = temp;
temp = y1;
y1 = y2;
y2 = temp;
}
switch(dcolor)
{
case 1 : if(action==BOX)
{
bdrw(x1,y1,x2,y1);
blineto(x2,y2);
blineto(x1,y2);
blineto(x1,y1);
break;
}
bdrw(x1,y1,x2,y2);
break;
case 2 : if(action==BOX)
{
rdrw(x1,y1,x2,y1);
rlineto(x2,y2);
rlineto(x1,y2);
rlineto(x1,y1);
break;
}
bdrw(x1,y1,x2,y2);
break;
default: if(action==BOX)
{
drw(x1,y1,x2,y1);
lineto(x2,y2);
lineto(x1,y2);
lineto(x1,y1);
break;
}
drw(x1,y1,x2,y2);
}
}