Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 5240 in orxonox.OLD for trunk/src/lib


Ignore:
Timestamp:
Sep 24, 2005, 11:27:37 AM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: init the icon in the right SDL-style way

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/lib/graphics/graphics_engine.cc

    r5237 r5240  
    7373
    7474  SDL_QuitSubSystem(SDL_INIT_VIDEO);
     75  if (this->screen != NULL)
     76    SDL_FreeSurface(this->screen);
     77
    7578  GraphicsEngine::singletonRef = NULL;
    7679}
     
    172175{
    173176  SDL_Surface* iconSurf = SDL_LoadBMP(icon);
    174 
    175   SDL_WM_SetIcon(iconSurf, NULL);
     177  if (iconSurf != NULL)
     178  {
     179    Uint32 colorkey = SDL_MapRGB(iconSurf->format, 255, 0, 255);
     180    SDL_SetColorKey(iconSurf, SDL_SRCCOLORKEY, colorkey);
     181    SDL_WM_SetIcon(iconSurf,NULL);
     182    SDL_FreeSurface(iconSurf);
     183  }
     184
    176185  SDL_WM_SetCaption (windowName, icon);
    177186
    178   delete iconSurf;
    179187}
    180188
Note: See TracChangeset for help on using the changeset viewer.