/*
 *	Perlin Production Co. Ltd. September 1993 (c)
 *	LINE procedures for GRAPHICS.REL
 */

#include "stdio.h"
#include "graphics.h"


extern	int	_xcoord;
extern	int	_ycoord;


int	line	(xs,ys,xe,ye)
int xs,ys,xe,ye;
{
	if ( in_screen(xs,ys) && in_screen(xe,ye) )
	{
		_line(xs,ys,xe,ye);
		return	SUCCESS;
	}
	return	ERROR;
}


int	lineto(xe,ye)
int xe,ye;
{

	if ( in_screen(xe,ye) )
	{
		_line(_xcoord,_ycoord,xe,ye);
		_xcoord=xe;
		_ycoord=ye;
		return	SUCCESS;
	}
	return	ERROR;
}


int	linerel(xr,yr)
int	xr,yr;
{
	if ( in_screen(xr+=_xcoord,yr+=_ycoord) )
	{
		_line (_xcoord,_ycoord,xr,yr);
		_xcoord=xr;
		_ycoord=yr;
		return	SUCCESS;
	}
	return	ERROR;
}
