SDL_FreeSurface crashes?

Discuss the development of new homebrew software, tools and libraries.

Moderators: cheriff, TyRaNiD

Post Reply
psiko_scweek
Posts: 42
Joined: Sat Nov 12, 2005 2:30 am

SDL_FreeSurface crashes?

Post by psiko_scweek »

ok, it seems like everytime i try and use SDL_FreeSurface it crashes.

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&#40;int i = 0;i<255;i++&#41;
   &#123;
   SDL_FillRect&#40; gfx_screen, &gfx_screen->clip_rect, SDL_MapRGB&#40; gfx_screen->format, 0xFF, 0xFF, 0xFF &#41; &#41;;
   SDL_SetAlpha&#40;SplashScreen.graphic, SDL_SRCALPHA, i&#41;;
   SDL_Delay&#40;10&#41;;
   if &#40;i == 254&#41;
   &#123;SDL_Delay&#40;25&#41;;&#125;
   SplashScreen.draw&#40;&#41;;
   gfx_flipscreen&#40;&#41;;
   &#125;
for&#40;int i = 255;i>0;i--&#41;
   &#123;
   SDL_FillRect&#40; gfx_screen, &gfx_screen->clip_rect, SDL_MapRGB&#40; gfx_screen->format, 0xFF, 0xFF, 0xFF &#41; &#41;;
   SDL_SetAlpha&#40;SplashScreen.graphic, SDL_SRCALPHA, i&#41;;
   SDL_Delay&#40;10&#41;;
   if &#40;i == 1&#41;
   &#123;SDL_Delay&#40;25&#41;;&#125;
   SplashScreen.draw&#40;&#41;;
   gfx_flipscreen&#40;&#41;;
   &#125;
SDL_FreeSurface&#40;SplashScreen.graphic&#41;;
&#125;
is there anything wrong with this code?
Post Reply