#include "stdio.h"
#include "graphics.h"
/*
 *	Perlin Production Co. Ltd. September 1993 (c).
 *	Common usable functions of GRAPHICS.REL library
 */

extern	int	_xcoord;
extern	int	_ycoord;

int in_screen(x,y)
int x,y;
{
	if ( x >= 0 && x <= GMAXX && y >=0 && y <= GMAXY ) return TRUE;
	return FALSE;
}


int	getx()
{
	return _xcoord;
}


int	gety()
{
	return	_ycoord;
}


int	moveto(x,y)
int x,y;
{
	if ( in_screen(x,y) )
	{
		_xcoord=x;
		_ycoord=y;
		return	SUCCESS;
	}
	return	ERROR;
}


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