#ifdef _DEBUG
	#include <stdlib.h>
	#include "../mmgr.h"
#endif

#include <math.h>

#include "Salamat.hpp"
#include "../mathematics.hpp"
#include "../primitives.hpp"

void Salamat::draw()
{
	const float pos = (time - startTime) / (endTime - startTime);
	float alpha = 1.0f;

	const float fadeinstart = 0.0f;
	const float fadeinstop = 0.02f;
	const float fadeoutstart = 0.98f;
	const float fadeoutstop = 1.0f;

	if (pos >= fadeinstart && pos <= fadeinstop)
		alpha *= (pos-fadeinstart) / (fadeinstop-fadeinstart);
	if (pos >= fadeoutstart && pos <= fadeoutstop)
		alpha *= 1-(pos-fadeoutstart) / (fadeoutstop-fadeoutstart);

//    filter.init(true);
	renderScene(pos, alpha);
//    filter.glow(8, 0.005f, 0.005f, 0.92f, -1.0f, 1.0f);
}

void Salamat::renderScene(float pos, float alpha)
{
 //   int i;
    cam->useCamera(1);

  
    float analval = powf(anal->get()/10.0f, 2.6f);


}

Salamat::Salamat()
{	
    int i;
    count = 200;

    anal = new Analyzer(1);

}

Salamat::~Salamat()
{
}


bool Salamat::init(unsigned long s, unsigned long e)
{
	startTime = s;
	endTime = e;
	return true;
}

