Code: Select all
void gmp_splashscreenrun(SDL_Surface *splashtemp)
{
SplashScreen.setGraphic(splashtemp);
SplashScreen.setX((SCR_W/2)-(SplashScreen.getGraphicWidth()/2));
SplashScreen.setY((SCR_H/2)-(SplashScreen.getGraphicHeight()/2));
for(int i = 0;i<255;i++)
{
SDL_FillRect( gfx_screen, &gfx_screen->clip_rect, SDL_MapRGB( gfx_screen->format, 0xFF, 0xFF, 0xFF ) );
SDL_SetAlpha(SplashScreen.graphic, SDL_SRCALPHA, i);
SDL_Delay(10);
if (i == 254)
{SDL_Delay(25);}
SplashScreen.draw();
gfx_flipscreen();
}
for(int i = 255;i>0;i--)
{
SDL_FillRect( gfx_screen, &gfx_screen->clip_rect, SDL_MapRGB( gfx_screen->format, 0xFF, 0xFF, 0xFF ) );
SDL_SetAlpha(SplashScreen.graphic, SDL_SRCALPHA, i);
SDL_Delay(10);
if (i == 1)
{SDL_Delay(25);}
SplashScreen.draw();
gfx_flipscreen();
}
SDL_FreeSurface(SplashScreen.graphic);
}