src/video/SDL_blit_N.c
changeset 10559 fbf9b0e3589a
parent 10558 5184186d4366
child 10616 d17dd08640a4
     1.1 --- a/src/video/SDL_blit_N.c	Sat Oct 22 11:01:55 2016 -0700
     1.2 +++ b/src/video/SDL_blit_N.c	Sat Oct 22 17:53:03 2016 -0700
     1.3 @@ -125,11 +125,7 @@
     1.4                                                         0x0C);
     1.5      vector unsigned char vswiz;
     1.6      vector unsigned int srcvec;
     1.7 -#define RESHIFT(X) (3 - ((X) >> 3))
     1.8 -    Uint32 rmask = RESHIFT(srcfmt->Rshift) << (dstfmt->Rshift);
     1.9 -    Uint32 gmask = RESHIFT(srcfmt->Gshift) << (dstfmt->Gshift);
    1.10 -    Uint32 bmask = RESHIFT(srcfmt->Bshift) << (dstfmt->Bshift);
    1.11 -    Uint32 amask;
    1.12 +    Uint32 rmask, gmask, bmask, amask;
    1.13  
    1.14      if (!srcfmt) {
    1.15          srcfmt = &default_pixel_format;
    1.16 @@ -138,6 +134,11 @@
    1.17          dstfmt = &default_pixel_format;
    1.18      }
    1.19  
    1.20 +#define RESHIFT(X) (3 - ((X) >> 3))
    1.21 +    rmask = RESHIFT(srcfmt->Rshift) << (dstfmt->Rshift);
    1.22 +    gmask = RESHIFT(srcfmt->Gshift) << (dstfmt->Gshift);
    1.23 +    bmask = RESHIFT(srcfmt->Bshift) << (dstfmt->Bshift);
    1.24 +
    1.25      /* Use zero for alpha if either surface doesn't have alpha */
    1.26      if (dstfmt->Amask) {
    1.27          amask =
    1.28 @@ -149,6 +150,7 @@
    1.29                            0xFFFFFFFF);
    1.30      }
    1.31  #undef RESHIFT
    1.32 +
    1.33      ((unsigned int *) (char *) &srcvec)[0] = (rmask | gmask | bmask | amask);
    1.34      vswiz = vec_add(plus, (vector unsigned char) vec_splat(srcvec, 0));
    1.35      return (vswiz);