#ifndef _Myrsky_HPP_
#define _Myrsky_HPP_

#include <stdio.h>
#include "../externs.hpp"

/*
class MyrskyP 
{
public:
	MyrskyP() {};
	~MyrskyP() {};

	void init(Vector start);
	Vector pos;
	//Vector end;
	Vector rotation;
	float size;
};
/**/

class MyrskyParticle
{
public:
    float energy;
    float maxenergy;

    Vector pos;
    Vector pos2;
    Vector startrotation;
    Vector endrotation;
    float size;
    bool active;
    bool special;
    float l;

    Vector v1, v2, v3, v4;
};

class MyrskyTaika
{
public:

    float st;
    float et;
    Vector color;

    float radius;
    float y;
    float width;
    float speed;
    float phase;

    void draw(float pos, float alpha);
};


class Myrsky : public Base
{
	public:

		Myrsky();
		~Myrsky();

		bool init(unsigned long s, unsigned long e);
		void draw();

		void drawScene(float pos, float alpha);
		void RenderRefractionAndDepth(float pos, float alpha);
		void RenderReflection(float pos, float alpha);
		static void RenderWater(float pos, float alpha);

        static void renderSky(float pos, float sync, float alpha);


	private:

        Vector turbulenceFunc1(float t, Vector &pos);
        Vector turbulenceFunc2(float t, Vector &pos);
        Vector turbulenceFunc3(float t, Vector &pos);
        int maxparticles;
        int particleindex;
        MyrskyParticle *particles;
        int taikacount;
        MyrskyTaika **taiat;

        void updateParticles(float pos);
		void renderScene(float pos, float alpha);

		TriggerSystem *trigger;

/*		Lista2 *list;	
		float lastTime;
		float lastAdd;
*/
};

#endif
