Changeset 416 for pwntcha


Ignore:
Timestamp:
Jan 4, 2005, 7:42:23 PM (15 years ago)
Author:
Sam Hocevar
Message:
  • if image is 8bpp, convert SDL surface to 32.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • pwntcha/trunk/src/image.c

    r413 r416  
    4040    if(!priv)
    4141        return NULL;
     42
     43#if defined(HAVE_SDL_IMAGE_H)
     44    if(priv->format->BytesPerPixel == 1)
     45    {
     46        img = image_new(priv->w, priv->h);
     47        SDL_BlitSurface(priv, NULL, img->priv, NULL);
     48        SDL_FreeSurface(priv);
     49        return img;
     50    }
     51#endif
    4252
    4353    img = malloc(sizeof(struct image));
Note: See TracChangeset for help on using the changeset viewer.