//------------------------------------------------------------------------------------
// irr::core::position2di wrappers
//------------------------------------------------------------------------------------
extern "C" 
{

	// defaults: x,y=0.0f
	position2di* IrrCore_Position2di_new(s32 x,s32 y)
	{
		return new position2di(x,y);
	}
	
	position2di* IrrCore_Position2di_newFromPos(position2di* pos)
	{
		return new position2di(*pos);
	}
	
	void IrrCore_Position2di_del(position2di* del)
	{
		if (del)
			delete del;
			
		del=0;
	}
	
	s32 IrrCore_Position2di_getX(position2di* pos)
	{
		s32 nRetVal=0;
	
		if (pos)
			nRetVal=pos->X;
	
		return nRetVal;
	}
	
	s32 IrrCore_Position2di_getY(position2di* pos)
	{
		s32 nRetVal=0;
	
		if (pos)
			nRetVal=pos->Y;
	
		return nRetVal;
	}
	
	void IrrCore_Position2di_setX(position2di* pos,s32 x)
	{
		if (pos)
			pos->X=x;
	}
	
	void IrrCore_Position2di_setY(position2di* pos,s32 y)
	{
		if (pos)
			pos->Y=y;
	}
	
	bool IrrCore_Position2di_EqEq(position2di* pos,position2di* other)
	{
		return (*pos==*other);
	}
	
	bool IrrCore_Position2di_NotEq(position2di* pos,position2di* other)
	{
		return (*pos!=*other);
	}
		
	position2di* IrrCore_Position2di_Plus(position2di* pos,position2di* other)
	{
		return new position2di(*pos + *other);
	}
	
	position2di* IrrCore_Position2di_Minus(position2di* pos,position2di* other)
	{
		return new position2di(*pos - *other);
	}

	position2di* IrrCore_Position2di_Eq(position2di* pos,position2di* other)
	{
		return new position2di(*pos=*other);
	}
	
	position2di* IrrCore_Position2di_PlusDim(position2di* pos,dimension2di* other)
	{
		return new position2di(*pos + *other);
	}
	
	position2di* IrrCore_Position2di_MinusDim(position2di* pos,dimension2di* other)
	{
		return new position2di(*pos - *other);
	}	
	
	position2di* IrrCore_Position2di_Mult(position2di* pos,position2di* other)
	{
		return new position2di(*pos * *other);
	}

	position2di* IrrCore_Position2di_MultScalar(position2di* pos,const s32& scalar)
	{
		return new position2di(*pos * scalar);
	}

	// do not delete
	position2di* IrrCore_Position2di_PlusEq(position2di* pos,const position2d<s32>& other)
	{
		if (pos) {
			*pos+=other;
			return pos;
		} else return 0;
	}

	// do not delete
	position2di* IrrCore_Position2di_MinusEq(position2di* pos,const position2d<s32>& other)
	{
		if (pos) {
			*pos-=other;
			return pos;
		} else return 0;
	}

	// do not delete
	position2di* IrrCore_Position2di_PlusEqDim(position2di* pos,const dimension2d<s32>& other)
	{
		if (pos) {
			*pos+=other;
			return pos;
		} else return 0;
	}

	// do not delete
	position2di* IrrCore_Position2di_MinusEqDim(position2di* pos,const dimension2d<s32>& other)
	{
		if (pos) {
			*pos-=other;
			return pos;
		} else return 0;
	}	
}