/******************************************************************************************
	AM2 PS   (c) 2000-1 ISL		-=Modified for Chicken Run 27/3/2000 Barry Paterson=-

	language.h:		Language selection
******************************************************************************************/

#ifndef __LANGUAGE_H__
#define __LANGUAGE_H__

#include "gametext.h"

#define BONUS_FLAGS	13

#define FLAGPOINTS 36
#define FLAGPOLYS FLAGPOINTS-1

typedef struct _LanguageDataType
{
	long			frame;
	TextureBankType	*flagTextures;
	TextureType		*flagTexture[LANG_NUMLANGS+BONUS_FLAGS+1];
	long lastFade;


	VERT flagPoints[FLAGPOINTS][FLAGPOINTS];
	long screenXYs[FLAGPOINTS][FLAGPOINTS];
	long screenZs[FLAGPOINTS][FLAGPOINTS];

	long wind[FLAGPOINTS*2];
	long	crosswind[FLAGPOINTS];
	long accel[FLAGPOINTS][FLAGPOINTS];
	unsigned char flagShade[FLAGPOINTS][FLAGPOINTS];

	unsigned char textureU[FLAGPOLYS][FLAGPOLYS][4];
	unsigned char textureV[FLAGPOLYS][FLAGPOLYS][4];
	unsigned char tileTexture;

	short fadeDirection,finishing;
	GsRVIEW2	langCam;

} LanguageDataType;


static void languageTransformPoints(void);
static void setCamera(int vpx,int vpy,int vpz, int vrx,int vry,int vrz);
static void languageDrawPolys(void);
void calculateTileTexture(int x, int y);
void languageDraw(void);
void languageCycle(void);
void languageStart(void);
void languageInitialise(void);
void languageFrame(void);
void languageDestroy(void);
void languageDrawBackground(void);
void calculateTileTexture(int x, int y);

#endif
