src/video/SDL_pixels.c
changeset 3284 2b95b2c0b6d4
parent 3182 9f82979eaaf0
child 3484 fed6d4c6c693
--- a/src/video/SDL_pixels.c	Sun Sep 20 04:15:19 2009 +0000
+++ b/src/video/SDL_pixels.c	Sun Sep 20 22:47:28 2009 +0000
@@ -39,10 +39,10 @@
     Uint32 masks[4];
 
     /* Initialize the values here */
-    if (SDL_BYTESPERPIXEL(format) == 3) {
+    if (SDL_BYTESPERPIXEL(format) <= 2) {
+        *bpp = SDL_BITSPERPIXEL(format);
+    } else {
         *bpp = SDL_BYTESPERPIXEL(format) * 8;
-    } else {
-        *bpp = SDL_BITSPERPIXEL(format);
     }
     *Rmask = *Gmask = *Bmask = *Amask = 0;