// FlipBoth.tra
// Author - MrC
// Based on FadeFlipBoth.r4 by Gordon Williams
float myTime = 0;
float d;

void Init()
{

}

void Rect(float x0, float y0, float x1, float y1)
{
	gfxBegin(PRIM_QUADLIST);

    gfxTexCoord(0,1);
    gfxVertex(x0, y0, 0.0);
    gfxTexCoord(1, 1);
    gfxVertex(x1, y0, 0.0);
    gfxTexCoord(1, 0);
    gfxVertex(x1, y1, 0.0);
    gfxTexCoord(0, 0);
    gfxVertex(x0, y1, 0.0);
    
    gfxEnd();

}
void Render()
{
	myTime = myTime + (TIMEPASS/1.5);

	FINISHED = myTime>=1.0;

	gfxSetAspect(0);
	gfxTranslate(0, 0, 2.414);

	d = 0.0-Cos(myTime*3.14159);

	gfxSetTexture(TEXTURE_CURRPRESET);
	gfxSetBlendMode(BLEND_ADD);
	gfxColour(1, 1, 1, 0.25);

	Rect(-1.0, -1.0, 0.0 - d, 1.0);
	Rect(d, -1.0, 1.0, 1.0);
	Rect(-1.0, -1.0, 1.0, 0 - d);
	Rect(-1.0, d, 1.0, 1.0);

	gfxSetTexture(TEXTURE_NEXTPRESET);
	Rect(0.0 - d, -1.0, 1.0, 1.0);
	Rect(-1.0, -1.0, d, 1.0);
	Rect(-1.0, 0.0 - d, 1.0, 1.0);
	Rect(-1.0, -1.0, 1.0, d);

}
