Fixed bug 1225 - Altivec blitters broken due to SDL_PixelFormat
authorSam Lantinga <slouken@libsdl.org>
Sat, 07 Jan 2012 01:25:55 -0500
changeset 6165b7347e716ab6
parent 6164 67f122d8284f
child 6166 0bc1f6da9c74
Fixed bug 1225 - Altivec blitters broken due to SDL_PixelFormat

bastien.bouclet@gmail.com 2011-06-13 05:50:58 PDT

Static pixel format initialization has not been updated to reflect header
changes in SDL_blit_N.c

The attached patch fixes Altivec support for me. altivec.h is needed for some
systems.
src/video/SDL_blit_A.c
src/video/SDL_blit_N.c
     1.1 --- a/src/video/SDL_blit_A.c	Sat Jan 07 01:21:50 2012 -0500
     1.2 +++ b/src/video/SDL_blit_A.c	Sat Jan 07 01:25:55 2012 -0500
     1.3 @@ -498,9 +498,10 @@
     1.4      /* ARGB */
     1.5      const static struct SDL_PixelFormat default_pixel_format = {
     1.6          0, NULL, 0, 0,
     1.7 +        {0, 0},
     1.8 +        0x00FF0000, 0x0000FF00, 0x000000FF, 0xFF000000,
     1.9          0, 0, 0, 0,
    1.10          16, 8, 0, 24,
    1.11 -        0x00FF0000, 0x0000FF00, 0x000000FF, 0xFF000000,
    1.12          0, NULL
    1.13      };
    1.14      if (!srcfmt) {
     2.1 --- a/src/video/SDL_blit_N.c	Sat Jan 07 01:21:50 2012 -0500
     2.2 +++ b/src/video/SDL_blit_N.c	Sat Jan 07 01:25:55 2012 -0500
     2.3 @@ -28,6 +28,9 @@
     2.4  /* Functions to blit from N-bit surfaces to other surfaces */
     2.5  
     2.6  #if SDL_ALTIVEC_BLITTERS
     2.7 +#ifdef HAVE_ALTIVEC_H
     2.8 +#include <altivec.h>
     2.9 +#endif
    2.10  #define assert(X)
    2.11  #ifdef __MACOSX__
    2.12  #include <sys/sysctl.h>
    2.13 @@ -108,9 +111,10 @@
    2.14      /* ARGB */
    2.15      const static const struct SDL_PixelFormat default_pixel_format = {
    2.16          0, NULL, 0, 0,
    2.17 +        {0, 0},
    2.18 +        0x00FF0000, 0x0000FF00, 0x000000FF, 0xFF000000,
    2.19          0, 0, 0, 0,
    2.20          16, 8, 0, 24,
    2.21 -        0x00FF0000, 0x0000FF00, 0x000000FF, 0xFF000000,
    2.22          0, NULL
    2.23      };
    2.24      if (!srcfmt) {