瀏覽代碼

* if image is 8bpp, convert SDL surface to 32.

git-svn-id: file:///srv/caca.zoy.org/var/lib/svn/pwntcha/trunk@416 92316355-f0b4-4df1-b90c-862c8a59935f
master
sam 20 年之前
父節點
當前提交
72a1507e7d
共有 1 個檔案被更改,包括 10 行新增0 行删除
  1. +10
    -0
      src/image.c

+ 10
- 0
src/image.c 查看文件

@@ -40,6 +40,16 @@ struct image *image_load(const char *name)
if(!priv)
return NULL;

#if defined(HAVE_SDL_IMAGE_H)
if(priv->format->BytesPerPixel == 1)
{
img = image_new(priv->w, priv->h);
SDL_BlitSurface(priv, NULL, img->priv, NULL);
SDL_FreeSurface(priv);
return img;
}
#endif

img = malloc(sizeof(struct image));
#if defined(HAVE_SDL_IMAGE_H)
img->width = priv->w;


Loading…
取消
儲存