// Slide.tra
// Author - MrC

int direction;
float position;

void Init()
{
	position = 0;
	direction = Rand() * 4;
}

void Render()
{
	position += TIMEPASS*0.75;
	if (position >= 1.0f)
		FINISHED = true;

   gfxSetTexture(TEXTURE_CURRPRESET);
   gfxSetAspect(0);
   gfxTranslate(0, 0, 2.414);
   gfxColour(1, 1, 1, 1);
   gfxTexRect(-1, 1, 1, -1);
   
   gfxSetTexture(TEXTURE_NEXTPRESET);

	if (direction == 0)
	{
		// Top to bottom
		float i = -3 + position * 2;
		gfxTexRect(-1, i+2, 1, i);
	}
	else if (direction == 1)
	{
		// Bottom to top
		float i = 1 - (position * 2);
		gfxTexRect(-1, i+2, 1, i);
	}
	else if (direction == 2)
	{
		// Left to right
		float i = -3 + position * 2;
		gfxTexRect(i, 1, i+2, -1);
	}
	else
	{
		// Right to left
		float i = 1 - position * 2;
		gfxTexRect(i, 1, i+2, -1);
	}
		
}
