From 4309e3326a056f1568da5c963c005c7157ecd512 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Sun, 20 Sep 2009 22:47:28 +0000 Subject: [PATCH] Fixed compatibility with SDL 1.2 pixel format (24 bits per pixel of color data with 4 bytes per pixel == 32 bpp) --HG-- extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403834 --- src/video/SDL_pixels.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/video/SDL_pixels.c b/src/video/SDL_pixels.c index 897f1f980..9992cedbd 100644 --- a/src/video/SDL_pixels.c +++ b/src/video/SDL_pixels.c @@ -39,10 +39,10 @@ SDL_PixelFormatEnumToMasks(Uint32 format, int *bpp, Uint32 * Rmask, Uint32 masks[4]; /* Initialize the values here */ - if (SDL_BYTESPERPIXEL(format) == 3) { - *bpp = SDL_BYTESPERPIXEL(format) * 8; - } else { + if (SDL_BYTESPERPIXEL(format) <= 2) { *bpp = SDL_BITSPERPIXEL(format); + } else { + *bpp = SDL_BYTESPERPIXEL(format) * 8; } *Rmask = *Gmask = *Bmask = *Amask = 0;