


#include "fxtest.h"
#include "fx.h"
#include "main.h"
#include "menu.h"
#include "fx.h"

TextureBankType *fxtest_TextureBank;
FX_PARTICLE_SYS fxtest_ParticleSys;
int fxTest_CurType=0;
char * fxTest_CurrDesc[] = {"Sprite Sparkles"};
//int fxTest_TypeList[] = {PARTICLE_SPARKSPRITE};
int fxTest_Num=1;


void fxtestEnd(void);
void fxtestCycle(void);
void fxtestDraw(void);


// ============
// ====
// ============
void fxtestCycle(void)
{
	if (padData.debounce[0] & PAD_CROSS)
		fxtestEnd();

//	particleSys_Update(&fxtest_ParticleSys);

}


// ============
// ====
// ============
void fxtestDraw(void)
{
	mycamera.vpx = 0;
	mycamera.vpy = -1200;
	mycamera.vpz = 0;
	mycamera.vrx = 0;
	mycamera.vry = 0;
	mycamera.vrz = 0;
	mapCamSetRefView2L(&mycamera);

	fontPrint(font, 0, 0, "Doing somthing ", 128, 128, 128);
//	particleSys_Draw(&fxtest_ParticleSys);
}


// ============
// ====
// ============
void fxtestStart(void)
{
TextureType *texture;
int crc;

	fxtest_TextureBank = textureLoadBank("SHELL\\sparkles.spt");
	textureDownloadBank(fxtest_TextureBank);

	crc = utilStr2CRC("SPARKLE1");
	texture = textureFindCRCInBank(fxtest_TextureBank, crc);
	printf("Found texture at : 0x%X.\n", texture);
	
//	particleSys_Create(&fxtest_ParticleSys, 40, PARTICLE_SPARKSPRITE, 30, texture);
	
	draw_routine = fxtestDraw;
	cycle_routine = fxtestCycle;	
}


// ============
// ====
// ============
void fxtestEnd(void)
{
	particleSys_Destroy(&fxtest_ParticleSys);

	textureUnloadBank(fxtest_TextureBank);
	textureDestroyBank(fxtest_TextureBank);
	
	menuStart();
}