/*
* Little class to handle splash screen fading
*
* Author: Peter S. (www.console-dev.de)
*/
#ifndef SPLASH_H
#define SPLASH_H

#include "mygba.h"
#include "cstdlib"

#define RGB_GET_R_VALUE(rgb)  ((rgb & 0x001f) << 3)
#define RGB_GET_G_VALUE(rgb) (((rgb >> 5) & 0x001f) << 3)
#define RGB_GET_B_VALUE(rgb) (((rgb >> 10) & 0x001f) << 3)

class CSplash
{
private:
u32 m_Counter;
u32 m_nFrameCnt;
u16 *m_pPalette;
u8 m_FadeSpeed;

public:
CSplash();
void Init(void);
void *GetPalette(void) { return m_pPalette; }
void SetPalette(u16 *pPalette);
void SetTexture(u8 *pTexture);
void SetFadeSpeed(u8 val){ m_FadeSpeed = val; }
u8 GetFadeSpeed(void){ return m_FadeSpeed; }
void FadeIn(void);
void FadeOut(void);
void WaitFrames(u32 val);
};

// Other functions
void WaitVSync();

#endif /* SPLASH_H */

/* END OF FILE */