/*********************************************************************//**
*	\brief HUD Fade efekt
*	Modul implementuje efekt prekryti obrazovky zadanou barvou. Soucasti
*	je animace postupneho znepruhlednovani a pote zpruhledneni tohoto
*	prekryvu.	
*
*	\author Michal Jirous
*	\date 24.11.2008
*	\file HUD_fade.h
**********************************************************************/

#ifndef __HUD_FADE__H
#define __HUD_FADE__H



#include "algebraic.h"
#include <SDL/SDL.h>

class HUDFade
{
	Uint32 m_uiFadeInTimeEnd, m_uiFadeDurationTimeEnd, m_uiFadeOutTimeEnd;
	float m_fStartAlpha, m_fDurationAlpha, m_fEndAlpha;
	bool m_bStay;

	alg::Color m_FadeColor;
	Uint32 m_uiStartTime;

	float m_fCurrentAlpha;
public:
	HUDFade();
	void update( float seconds );
	void render();
	void reset();

	void startFade( alg::Color &rgb, Uint32 fadeInTime, Uint32 fadeDuration, Uint32 fadeOutTime, float startAlpha, float durationAlpha, float endAlpha, bool stay ); 
};

extern HUDFade fadeEffect;

#endif
