#include <windows.h>
#include <GL/gl.h>
#include "text.h"
#include "globals.h"

char *scrolltext[] ={
"You saw the new Shaven Raven",
"a wild demo in 64k",
"njaa... just kidding...",
"this was just a casual intro by NEXTEMPIRE",
"",	
"brought to you by the",
"following deviants:",
"",
"Code:",
"KORONA",
"KANTTU",
"",
"Graphics/Textures:",
"KORUPT",
"KYDROX",
"",
"Music:",
"KENSHI",
"",
"Modelling:",
"KRAGEN",
"",
"Special thanks to Sickmo",
"",
"",
"please visit nextempire.com",
"no popup windows",
"no banners",
"no passwords",
"no membership required",
"",
"",
"",
"",
"",
"And remember...",
"We are the knights who say NE!",
"SCROLLEND"
					};

void DrawScrollText ()
{
	static float starttime = time;
	static float lasttime = 0;
	float lapsedtime = time - starttime;
	float delta = lapsedtime - lasttime;

	static float o = 1.0;

	o -= delta * 0.04;
	int i = -1;

	for (float y = o; y < 1.0; y += 0.032)
	{
		i++;
		if (!strcmp (scrolltext[i], "SCROLLEND"))
			break;

		float x = 0.5 - (strlen(scrolltext[i])*0.018*0.5);

		if (o < -.59 && !strcmp(scrolltext[i+1], "SCROLLEND"))
			glText2D (scrolltext[i], x, 0.5, 0.25);
		else
			glText2D (scrolltext[i], x, y, 0.25);
	}
	// - 0.55
//	char ctemp[10];
//	glText2D (_gcvt(o, 5, ctemp), 0, 0, 0.3);

	lasttime = lapsedtime;
}
