include/SDL_pixels.h
changeset 6683 b1124b32b07d
parent 6138 4c64952a58fb
child 6885 700f1b25f77f
     1.1 --- a/include/SDL_pixels.h	Mon Nov 19 00:39:19 2012 +0300
     1.2 +++ b/include/SDL_pixels.h	Thu Nov 22 11:55:11 2012 -0800
     1.3 @@ -114,9 +114,10 @@
     1.4  #define SDL_DEFINE_PIXELFOURCC(A, B, C, D) SDL_FOURCC(A, B, C, D)
     1.5  
     1.6  #define SDL_DEFINE_PIXELFORMAT(type, order, layout, bits, bytes) \
     1.7 -    ((1 << 31) | ((type) << 24) | ((order) << 20) | ((layout) << 16) | \
     1.8 +    ((1 << 28) | ((type) << 24) | ((order) << 20) | ((layout) << 16) | \
     1.9       ((bits) << 8) | ((bytes) << 0))
    1.10  
    1.11 +#define SDL_PIXELFLAG(X)	(((X) >> 28) & 0x0F)
    1.12  #define SDL_PIXELTYPE(X)	(((X) >> 24) & 0x0F)
    1.13  #define SDL_PIXELORDER(X)	(((X) >> 20) & 0x0F)
    1.14  #define SDL_PIXELLAYOUT(X)	(((X) >> 16) & 0x0F)
    1.15 @@ -140,8 +141,9 @@
    1.16        (SDL_PIXELORDER(format) == SDL_PACKEDORDER_ABGR) || \
    1.17        (SDL_PIXELORDER(format) == SDL_PACKEDORDER_BGRA)))
    1.18  
    1.19 +/* The flag is set to 1 because 0x1? is not in the printable ASCII range */
    1.20  #define SDL_ISPIXELFORMAT_FOURCC(format)    \
    1.21 -    ((format) && !((format) & 0x80000000))
    1.22 +    ((format) && (SDL_PIXELFLAG(format) != 1))
    1.23  
    1.24  /* Note: If you modify this list, update SDL_GetPixelFormatName() */
    1.25  enum