Static analysis fix: clean up unused variables and dead stores in blitters.
authorRyan C. Gordon <icculus@icculus.org>
Thu, 20 Mar 2014 17:55:24 -0400
changeset 8659d3a9836732ea
parent 8658 7939f33e81ac
child 8660 6bd1f8bad873
Static analysis fix: clean up unused variables and dead stores in blitters.
src/video/SDL_blit_auto.c
src/video/sdlgenblit.pl
     1.1 --- a/src/video/SDL_blit_auto.c	Thu Mar 20 17:00:33 2014 -0400
     1.2 +++ b/src/video/SDL_blit_auto.c	Thu Mar 20 17:55:24 2014 -0400
     1.3 @@ -201,6 +201,8 @@
     1.4      const Uint32 modulateA = info->a;
     1.5      Uint32 pixel;
     1.6      Uint32 R, G, B, A;
     1.7 +    (void) A;  /* not all formats use alpha. */
     1.8 +    (void) modulateA;  /* not all formats use alpha. */
     1.9  
    1.10      while (info->dst_h--) {
    1.11          Uint32 *src = (Uint32 *)info->src;
    1.12 @@ -208,15 +210,12 @@
    1.13          int n = info->dst_w;
    1.14          while (n--) {
    1.15              pixel = *src;
    1.16 -            R = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); B = (Uint8)pixel; A = 0xFF;
    1.17 +            R = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); B = (Uint8)pixel;
    1.18              if (flags & SDL_COPY_MODULATE_COLOR) {
    1.19                  R = (R * modulateR) / 255;
    1.20                  G = (G * modulateG) / 255;
    1.21                  B = (B * modulateB) / 255;
    1.22              }
    1.23 -            if (flags & SDL_COPY_MODULATE_ALPHA) {
    1.24 -                A = (A * modulateA) / 255;
    1.25 -            }
    1.26              pixel = ((Uint32)R << 16) | ((Uint32)G << 8) | B;
    1.27              *dst = pixel;
    1.28              ++src;
    1.29 @@ -239,6 +238,8 @@
    1.30      int srcy, srcx;
    1.31      int posy, posx;
    1.32      int incy, incx;
    1.33 +    (void) A;  /* not all formats use alpha. */
    1.34 +    (void) modulateA;  /* not all formats use alpha. */
    1.35  
    1.36      srcy = 0;
    1.37      posy = 0;
    1.38 @@ -264,15 +265,12 @@
    1.39                  src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
    1.40              }
    1.41              pixel = *src;
    1.42 -            R = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); B = (Uint8)pixel; A = 0xFF;
    1.43 +            R = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); B = (Uint8)pixel;
    1.44              if (flags & SDL_COPY_MODULATE_COLOR) {
    1.45                  R = (R * modulateR) / 255;
    1.46                  G = (G * modulateG) / 255;
    1.47                  B = (B * modulateB) / 255;
    1.48              }
    1.49 -            if (flags & SDL_COPY_MODULATE_ALPHA) {
    1.50 -                A = (A * modulateA) / 255;
    1.51 -            }
    1.52              pixel = ((Uint32)R << 16) | ((Uint32)G << 8) | B;
    1.53              *dst = pixel;
    1.54              posx += incx;
    1.55 @@ -294,6 +292,7 @@
    1.56      Uint32 srcR, srcG, srcB, srcA;
    1.57      Uint32 dstpixel;
    1.58      Uint32 dstR, dstG, dstB, dstA;
    1.59 +    (void) modulateA;  /* not all formats use alpha. */
    1.60  
    1.61      while (info->dst_h--) {
    1.62          Uint32 *src = (Uint32 *)info->src;
    1.63 @@ -362,6 +361,7 @@
    1.64      int srcy, srcx;
    1.65      int posy, posx;
    1.66      int incy, incx;
    1.67 +    (void) modulateA;  /* not all formats use alpha. */
    1.68  
    1.69      srcy = 0;
    1.70      posy = 0;
    1.71 @@ -441,6 +441,7 @@
    1.72      int srcy, srcx;
    1.73      int posy, posx;
    1.74      int incy, incx;
    1.75 +    (void) A;  /* not all formats use alpha. */
    1.76  
    1.77      srcy = 0;
    1.78      posy = 0;
    1.79 @@ -466,7 +467,7 @@
    1.80                  src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
    1.81              }
    1.82              pixel = *src;
    1.83 -            R = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); B = (Uint8)pixel; A = 0xFF;
    1.84 +            R = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); B = (Uint8)pixel;
    1.85              pixel = ((Uint32)B << 16) | ((Uint32)G << 8) | R;
    1.86              *dst = pixel;
    1.87              posx += incx;
    1.88 @@ -613,6 +614,8 @@
    1.89      const Uint32 modulateA = info->a;
    1.90      Uint32 pixel;
    1.91      Uint32 R, G, B, A;
    1.92 +    (void) A;  /* not all formats use alpha. */
    1.93 +    (void) modulateA;  /* not all formats use alpha. */
    1.94  
    1.95      while (info->dst_h--) {
    1.96          Uint32 *src = (Uint32 *)info->src;
    1.97 @@ -620,15 +623,12 @@
    1.98          int n = info->dst_w;
    1.99          while (n--) {
   1.100              pixel = *src;
   1.101 -            R = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); B = (Uint8)pixel; A = 0xFF;
   1.102 +            R = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); B = (Uint8)pixel;
   1.103              if (flags & SDL_COPY_MODULATE_COLOR) {
   1.104                  R = (R * modulateR) / 255;
   1.105                  G = (G * modulateG) / 255;
   1.106                  B = (B * modulateB) / 255;
   1.107              }
   1.108 -            if (flags & SDL_COPY_MODULATE_ALPHA) {
   1.109 -                A = (A * modulateA) / 255;
   1.110 -            }
   1.111              pixel = ((Uint32)B << 16) | ((Uint32)G << 8) | R;
   1.112              *dst = pixel;
   1.113              ++src;
   1.114 @@ -651,6 +651,8 @@
   1.115      int srcy, srcx;
   1.116      int posy, posx;
   1.117      int incy, incx;
   1.118 +    (void) A;  /* not all formats use alpha. */
   1.119 +    (void) modulateA;  /* not all formats use alpha. */
   1.120  
   1.121      srcy = 0;
   1.122      posy = 0;
   1.123 @@ -676,15 +678,12 @@
   1.124                  src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
   1.125              }
   1.126              pixel = *src;
   1.127 -            R = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); B = (Uint8)pixel; A = 0xFF;
   1.128 +            R = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); B = (Uint8)pixel;
   1.129              if (flags & SDL_COPY_MODULATE_COLOR) {
   1.130                  R = (R * modulateR) / 255;
   1.131                  G = (G * modulateG) / 255;
   1.132                  B = (B * modulateB) / 255;
   1.133              }
   1.134 -            if (flags & SDL_COPY_MODULATE_ALPHA) {
   1.135 -                A = (A * modulateA) / 255;
   1.136 -            }
   1.137              pixel = ((Uint32)B << 16) | ((Uint32)G << 8) | R;
   1.138              *dst = pixel;
   1.139              posx += incx;
   1.140 @@ -706,6 +705,7 @@
   1.141      Uint32 srcR, srcG, srcB, srcA;
   1.142      Uint32 dstpixel;
   1.143      Uint32 dstR, dstG, dstB, dstA;
   1.144 +    (void) modulateA;  /* not all formats use alpha. */
   1.145  
   1.146      while (info->dst_h--) {
   1.147          Uint32 *src = (Uint32 *)info->src;
   1.148 @@ -774,6 +774,7 @@
   1.149      int srcy, srcx;
   1.150      int posy, posx;
   1.151      int incy, incx;
   1.152 +    (void) modulateA;  /* not all formats use alpha. */
   1.153  
   1.154      srcy = 0;
   1.155      posy = 0;
   1.156 @@ -853,6 +854,7 @@
   1.157      int srcy, srcx;
   1.158      int posy, posx;
   1.159      int incy, incx;
   1.160 +    (void) A;  /* not all formats use alpha. */
   1.161  
   1.162      srcy = 0;
   1.163      posy = 0;
   1.164 @@ -905,7 +907,7 @@
   1.165              srcpixel = *src;
   1.166              srcR = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcB = (Uint8)srcpixel; srcA = 0xFF;
   1.167              dstpixel = *dst;
   1.168 -            dstA = (Uint8)(dstpixel >> 24); dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel;
   1.169 +            dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; dstA = (Uint8)(dstpixel >> 24);
   1.170              if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
   1.171                  /* This goes away if we ever use premultiplied alpha */
   1.172                  if (srcA < 255) {
   1.173 @@ -979,7 +981,7 @@
   1.174              srcpixel = *src;
   1.175              srcR = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcB = (Uint8)srcpixel; srcA = 0xFF;
   1.176              dstpixel = *dst;
   1.177 -            dstA = (Uint8)(dstpixel >> 24); dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel;
   1.178 +            dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; dstA = (Uint8)(dstpixel >> 24);
   1.179              if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
   1.180                  /* This goes away if we ever use premultiplied alpha */
   1.181                  if (srcA < 255) {
   1.182 @@ -1025,6 +1027,8 @@
   1.183      const Uint32 modulateA = info->a;
   1.184      Uint32 pixel;
   1.185      Uint32 R, G, B, A;
   1.186 +    (void) A;  /* not all formats use alpha. */
   1.187 +    (void) modulateA;  /* not all formats use alpha. */
   1.188  
   1.189      while (info->dst_h--) {
   1.190          Uint32 *src = (Uint32 *)info->src;
   1.191 @@ -1063,6 +1067,8 @@
   1.192      int srcy, srcx;
   1.193      int posy, posx;
   1.194      int incy, incx;
   1.195 +    (void) A;  /* not all formats use alpha. */
   1.196 +    (void) modulateA;  /* not all formats use alpha. */
   1.197  
   1.198      srcy = 0;
   1.199      posy = 0;
   1.200 @@ -1118,6 +1124,7 @@
   1.201      Uint32 srcR, srcG, srcB, srcA;
   1.202      Uint32 dstpixel;
   1.203      Uint32 dstR, dstG, dstB, dstA;
   1.204 +    (void) modulateA;  /* not all formats use alpha. */
   1.205  
   1.206      while (info->dst_h--) {
   1.207          Uint32 *src = (Uint32 *)info->src;
   1.208 @@ -1127,7 +1134,7 @@
   1.209              srcpixel = *src;
   1.210              srcR = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcB = (Uint8)srcpixel; srcA = 0xFF;
   1.211              dstpixel = *dst;
   1.212 -            dstA = (Uint8)(dstpixel >> 24); dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel;
   1.213 +            dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; dstA = (Uint8)(dstpixel >> 24);
   1.214              if (flags & SDL_COPY_MODULATE_COLOR) {
   1.215                  srcR = (srcR * modulateR) / 255;
   1.216                  srcG = (srcG * modulateG) / 255;
   1.217 @@ -1186,6 +1193,7 @@
   1.218      int srcy, srcx;
   1.219      int posy, posx;
   1.220      int incy, incx;
   1.221 +    (void) modulateA;  /* not all formats use alpha. */
   1.222  
   1.223      srcy = 0;
   1.224      posy = 0;
   1.225 @@ -1213,7 +1221,7 @@
   1.226              srcpixel = *src;
   1.227              srcR = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcB = (Uint8)srcpixel; srcA = 0xFF;
   1.228              dstpixel = *dst;
   1.229 -            dstA = (Uint8)(dstpixel >> 24); dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel;
   1.230 +            dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; dstA = (Uint8)(dstpixel >> 24);
   1.231              if (flags & SDL_COPY_MODULATE_COLOR) {
   1.232                  srcR = (srcR * modulateR) / 255;
   1.233                  srcG = (srcG * modulateG) / 255;
   1.234 @@ -1265,6 +1273,7 @@
   1.235      int srcy, srcx;
   1.236      int posy, posx;
   1.237      int incy, incx;
   1.238 +    (void) A;  /* not all formats use alpha. */
   1.239  
   1.240      srcy = 0;
   1.241      posy = 0;
   1.242 @@ -1290,7 +1299,7 @@
   1.243                  src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
   1.244              }
   1.245              pixel = *src;
   1.246 -            B = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); R = (Uint8)pixel; A = 0xFF;
   1.247 +            B = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); R = (Uint8)pixel;
   1.248              pixel = ((Uint32)R << 16) | ((Uint32)G << 8) | B;
   1.249              *dst = pixel;
   1.250              posx += incx;
   1.251 @@ -1437,6 +1446,8 @@
   1.252      const Uint32 modulateA = info->a;
   1.253      Uint32 pixel;
   1.254      Uint32 R, G, B, A;
   1.255 +    (void) A;  /* not all formats use alpha. */
   1.256 +    (void) modulateA;  /* not all formats use alpha. */
   1.257  
   1.258      while (info->dst_h--) {
   1.259          Uint32 *src = (Uint32 *)info->src;
   1.260 @@ -1444,15 +1455,12 @@
   1.261          int n = info->dst_w;
   1.262          while (n--) {
   1.263              pixel = *src;
   1.264 -            B = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); R = (Uint8)pixel; A = 0xFF;
   1.265 +            B = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); R = (Uint8)pixel;
   1.266              if (flags & SDL_COPY_MODULATE_COLOR) {
   1.267                  R = (R * modulateR) / 255;
   1.268                  G = (G * modulateG) / 255;
   1.269                  B = (B * modulateB) / 255;
   1.270              }
   1.271 -            if (flags & SDL_COPY_MODULATE_ALPHA) {
   1.272 -                A = (A * modulateA) / 255;
   1.273 -            }
   1.274              pixel = ((Uint32)R << 16) | ((Uint32)G << 8) | B;
   1.275              *dst = pixel;
   1.276              ++src;
   1.277 @@ -1475,6 +1483,8 @@
   1.278      int srcy, srcx;
   1.279      int posy, posx;
   1.280      int incy, incx;
   1.281 +    (void) A;  /* not all formats use alpha. */
   1.282 +    (void) modulateA;  /* not all formats use alpha. */
   1.283  
   1.284      srcy = 0;
   1.285      posy = 0;
   1.286 @@ -1500,15 +1510,12 @@
   1.287                  src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
   1.288              }
   1.289              pixel = *src;
   1.290 -            B = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); R = (Uint8)pixel; A = 0xFF;
   1.291 +            B = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); R = (Uint8)pixel;
   1.292              if (flags & SDL_COPY_MODULATE_COLOR) {
   1.293                  R = (R * modulateR) / 255;
   1.294                  G = (G * modulateG) / 255;
   1.295                  B = (B * modulateB) / 255;
   1.296              }
   1.297 -            if (flags & SDL_COPY_MODULATE_ALPHA) {
   1.298 -                A = (A * modulateA) / 255;
   1.299 -            }
   1.300              pixel = ((Uint32)R << 16) | ((Uint32)G << 8) | B;
   1.301              *dst = pixel;
   1.302              posx += incx;
   1.303 @@ -1530,6 +1537,7 @@
   1.304      Uint32 srcR, srcG, srcB, srcA;
   1.305      Uint32 dstpixel;
   1.306      Uint32 dstR, dstG, dstB, dstA;
   1.307 +    (void) modulateA;  /* not all formats use alpha. */
   1.308  
   1.309      while (info->dst_h--) {
   1.310          Uint32 *src = (Uint32 *)info->src;
   1.311 @@ -1598,6 +1606,7 @@
   1.312      int srcy, srcx;
   1.313      int posy, posx;
   1.314      int incy, incx;
   1.315 +    (void) modulateA;  /* not all formats use alpha. */
   1.316  
   1.317      srcy = 0;
   1.318      posy = 0;
   1.319 @@ -1844,6 +1853,8 @@
   1.320      const Uint32 modulateA = info->a;
   1.321      Uint32 pixel;
   1.322      Uint32 R, G, B, A;
   1.323 +    (void) A;  /* not all formats use alpha. */
   1.324 +    (void) modulateA;  /* not all formats use alpha. */
   1.325  
   1.326      while (info->dst_h--) {
   1.327          Uint32 *src = (Uint32 *)info->src;
   1.328 @@ -1851,15 +1862,12 @@
   1.329          int n = info->dst_w;
   1.330          while (n--) {
   1.331              pixel = *src;
   1.332 -            B = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); R = (Uint8)pixel; A = 0xFF;
   1.333 +            B = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); R = (Uint8)pixel;
   1.334              if (flags & SDL_COPY_MODULATE_COLOR) {
   1.335                  R = (R * modulateR) / 255;
   1.336                  G = (G * modulateG) / 255;
   1.337                  B = (B * modulateB) / 255;
   1.338              }
   1.339 -            if (flags & SDL_COPY_MODULATE_ALPHA) {
   1.340 -                A = (A * modulateA) / 255;
   1.341 -            }
   1.342              pixel = ((Uint32)B << 16) | ((Uint32)G << 8) | R;
   1.343              *dst = pixel;
   1.344              ++src;
   1.345 @@ -1882,6 +1890,8 @@
   1.346      int srcy, srcx;
   1.347      int posy, posx;
   1.348      int incy, incx;
   1.349 +    (void) A;  /* not all formats use alpha. */
   1.350 +    (void) modulateA;  /* not all formats use alpha. */
   1.351  
   1.352      srcy = 0;
   1.353      posy = 0;
   1.354 @@ -1907,15 +1917,12 @@
   1.355                  src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
   1.356              }
   1.357              pixel = *src;
   1.358 -            B = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); R = (Uint8)pixel; A = 0xFF;
   1.359 +            B = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); R = (Uint8)pixel;
   1.360              if (flags & SDL_COPY_MODULATE_COLOR) {
   1.361                  R = (R * modulateR) / 255;
   1.362                  G = (G * modulateG) / 255;
   1.363                  B = (B * modulateB) / 255;
   1.364              }
   1.365 -            if (flags & SDL_COPY_MODULATE_ALPHA) {
   1.366 -                A = (A * modulateA) / 255;
   1.367 -            }
   1.368              pixel = ((Uint32)B << 16) | ((Uint32)G << 8) | R;
   1.369              *dst = pixel;
   1.370              posx += incx;
   1.371 @@ -1937,6 +1944,7 @@
   1.372      Uint32 srcR, srcG, srcB, srcA;
   1.373      Uint32 dstpixel;
   1.374      Uint32 dstR, dstG, dstB, dstA;
   1.375 +    (void) modulateA;  /* not all formats use alpha. */
   1.376  
   1.377      while (info->dst_h--) {
   1.378          Uint32 *src = (Uint32 *)info->src;
   1.379 @@ -2005,6 +2013,7 @@
   1.380      int srcy, srcx;
   1.381      int posy, posx;
   1.382      int incy, incx;
   1.383 +    (void) modulateA;  /* not all formats use alpha. */
   1.384  
   1.385      srcy = 0;
   1.386      posy = 0;
   1.387 @@ -2084,6 +2093,7 @@
   1.388      int srcy, srcx;
   1.389      int posy, posx;
   1.390      int incy, incx;
   1.391 +    (void) A;  /* not all formats use alpha. */
   1.392  
   1.393      srcy = 0;
   1.394      posy = 0;
   1.395 @@ -2136,7 +2146,7 @@
   1.396              srcpixel = *src;
   1.397              srcB = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcR = (Uint8)srcpixel; srcA = 0xFF;
   1.398              dstpixel = *dst;
   1.399 -            dstA = (Uint8)(dstpixel >> 24); dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel;
   1.400 +            dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; dstA = (Uint8)(dstpixel >> 24);
   1.401              if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
   1.402                  /* This goes away if we ever use premultiplied alpha */
   1.403                  if (srcA < 255) {
   1.404 @@ -2210,7 +2220,7 @@
   1.405              srcpixel = *src;
   1.406              srcB = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcR = (Uint8)srcpixel; srcA = 0xFF;
   1.407              dstpixel = *dst;
   1.408 -            dstA = (Uint8)(dstpixel >> 24); dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel;
   1.409 +            dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; dstA = (Uint8)(dstpixel >> 24);
   1.410              if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
   1.411                  /* This goes away if we ever use premultiplied alpha */
   1.412                  if (srcA < 255) {
   1.413 @@ -2256,6 +2266,8 @@
   1.414      const Uint32 modulateA = info->a;
   1.415      Uint32 pixel;
   1.416      Uint32 R, G, B, A;
   1.417 +    (void) A;  /* not all formats use alpha. */
   1.418 +    (void) modulateA;  /* not all formats use alpha. */
   1.419  
   1.420      while (info->dst_h--) {
   1.421          Uint32 *src = (Uint32 *)info->src;
   1.422 @@ -2294,6 +2306,8 @@
   1.423      int srcy, srcx;
   1.424      int posy, posx;
   1.425      int incy, incx;
   1.426 +    (void) A;  /* not all formats use alpha. */
   1.427 +    (void) modulateA;  /* not all formats use alpha. */
   1.428  
   1.429      srcy = 0;
   1.430      posy = 0;
   1.431 @@ -2349,6 +2363,7 @@
   1.432      Uint32 srcR, srcG, srcB, srcA;
   1.433      Uint32 dstpixel;
   1.434      Uint32 dstR, dstG, dstB, dstA;
   1.435 +    (void) modulateA;  /* not all formats use alpha. */
   1.436  
   1.437      while (info->dst_h--) {
   1.438          Uint32 *src = (Uint32 *)info->src;
   1.439 @@ -2358,7 +2373,7 @@
   1.440              srcpixel = *src;
   1.441              srcB = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcR = (Uint8)srcpixel; srcA = 0xFF;
   1.442              dstpixel = *dst;
   1.443 -            dstA = (Uint8)(dstpixel >> 24); dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel;
   1.444 +            dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; dstA = (Uint8)(dstpixel >> 24);
   1.445              if (flags & SDL_COPY_MODULATE_COLOR) {
   1.446                  srcR = (srcR * modulateR) / 255;
   1.447                  srcG = (srcG * modulateG) / 255;
   1.448 @@ -2417,6 +2432,7 @@
   1.449      int srcy, srcx;
   1.450      int posy, posx;
   1.451      int incy, incx;
   1.452 +    (void) modulateA;  /* not all formats use alpha. */
   1.453  
   1.454      srcy = 0;
   1.455      posy = 0;
   1.456 @@ -2444,7 +2460,7 @@
   1.457              srcpixel = *src;
   1.458              srcB = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcR = (Uint8)srcpixel; srcA = 0xFF;
   1.459              dstpixel = *dst;
   1.460 -            dstA = (Uint8)(dstpixel >> 24); dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel;
   1.461 +            dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; dstA = (Uint8)(dstpixel >> 24);
   1.462              if (flags & SDL_COPY_MODULATE_COLOR) {
   1.463                  srcR = (srcR * modulateR) / 255;
   1.464                  srcG = (srcG * modulateG) / 255;
   1.465 @@ -2496,6 +2512,7 @@
   1.466      int srcy, srcx;
   1.467      int posy, posx;
   1.468      int incy, incx;
   1.469 +    (void) A;  /* not all formats use alpha. */
   1.470  
   1.471      srcy = 0;
   1.472      posy = 0;
   1.473 @@ -2521,7 +2538,7 @@
   1.474                  src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
   1.475              }
   1.476              pixel = *src;
   1.477 -            A = (Uint8)(pixel >> 24); R = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); B = (Uint8)pixel;
   1.478 +            R = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); B = (Uint8)pixel;
   1.479              pixel = ((Uint32)R << 16) | ((Uint32)G << 8) | B;
   1.480              *dst = pixel;
   1.481              posx += incx;
   1.482 @@ -2546,7 +2563,7 @@
   1.483          int n = info->dst_w;
   1.484          while (n--) {
   1.485              srcpixel = *src;
   1.486 -            srcA = (Uint8)(srcpixel >> 24); srcR = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcB = (Uint8)srcpixel;
   1.487 +            srcR = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcB = (Uint8)srcpixel; srcA = (Uint8)(srcpixel >> 24);
   1.488              dstpixel = *dst;
   1.489              dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; dstA = 0xFF;
   1.490              if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
   1.491 @@ -2620,7 +2637,7 @@
   1.492                  src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
   1.493              }
   1.494              srcpixel = *src;
   1.495 -            srcA = (Uint8)(srcpixel >> 24); srcR = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcB = (Uint8)srcpixel;
   1.496 +            srcR = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcB = (Uint8)srcpixel; srcA = (Uint8)(srcpixel >> 24);
   1.497              dstpixel = *dst;
   1.498              dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; dstA = 0xFF;
   1.499              if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
   1.500 @@ -2668,6 +2685,8 @@
   1.501      const Uint32 modulateA = info->a;
   1.502      Uint32 pixel;
   1.503      Uint32 R, G, B, A;
   1.504 +    (void) A;  /* not all formats use alpha. */
   1.505 +    (void) modulateA;  /* not all formats use alpha. */
   1.506  
   1.507      while (info->dst_h--) {
   1.508          Uint32 *src = (Uint32 *)info->src;
   1.509 @@ -2675,15 +2694,12 @@
   1.510          int n = info->dst_w;
   1.511          while (n--) {
   1.512              pixel = *src;
   1.513 -            A = (Uint8)(pixel >> 24); R = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); B = (Uint8)pixel;
   1.514 +            R = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); B = (Uint8)pixel;
   1.515              if (flags & SDL_COPY_MODULATE_COLOR) {
   1.516                  R = (R * modulateR) / 255;
   1.517                  G = (G * modulateG) / 255;
   1.518                  B = (B * modulateB) / 255;
   1.519              }
   1.520 -            if (flags & SDL_COPY_MODULATE_ALPHA) {
   1.521 -                A = (A * modulateA) / 255;
   1.522 -            }
   1.523              pixel = ((Uint32)R << 16) | ((Uint32)G << 8) | B;
   1.524              *dst = pixel;
   1.525              ++src;
   1.526 @@ -2706,6 +2722,8 @@
   1.527      int srcy, srcx;
   1.528      int posy, posx;
   1.529      int incy, incx;
   1.530 +    (void) A;  /* not all formats use alpha. */
   1.531 +    (void) modulateA;  /* not all formats use alpha. */
   1.532  
   1.533      srcy = 0;
   1.534      posy = 0;
   1.535 @@ -2731,15 +2749,12 @@
   1.536                  src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
   1.537              }
   1.538              pixel = *src;
   1.539 -            A = (Uint8)(pixel >> 24); R = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); B = (Uint8)pixel;
   1.540 +            R = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); B = (Uint8)pixel;
   1.541              if (flags & SDL_COPY_MODULATE_COLOR) {
   1.542                  R = (R * modulateR) / 255;
   1.543                  G = (G * modulateG) / 255;
   1.544                  B = (B * modulateB) / 255;
   1.545              }
   1.546 -            if (flags & SDL_COPY_MODULATE_ALPHA) {
   1.547 -                A = (A * modulateA) / 255;
   1.548 -            }
   1.549              pixel = ((Uint32)R << 16) | ((Uint32)G << 8) | B;
   1.550              *dst = pixel;
   1.551              posx += incx;
   1.552 @@ -2761,6 +2776,7 @@
   1.553      Uint32 srcR, srcG, srcB, srcA;
   1.554      Uint32 dstpixel;
   1.555      Uint32 dstR, dstG, dstB, dstA;
   1.556 +    (void) modulateA;  /* not all formats use alpha. */
   1.557  
   1.558      while (info->dst_h--) {
   1.559          Uint32 *src = (Uint32 *)info->src;
   1.560 @@ -2768,7 +2784,7 @@
   1.561          int n = info->dst_w;
   1.562          while (n--) {
   1.563              srcpixel = *src;
   1.564 -            srcA = (Uint8)(srcpixel >> 24); srcR = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcB = (Uint8)srcpixel;
   1.565 +            srcR = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcB = (Uint8)srcpixel; srcA = (Uint8)(srcpixel >> 24);
   1.566              dstpixel = *dst;
   1.567              dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; dstA = 0xFF;
   1.568              if (flags & SDL_COPY_MODULATE_COLOR) {
   1.569 @@ -2829,6 +2845,7 @@
   1.570      int srcy, srcx;
   1.571      int posy, posx;
   1.572      int incy, incx;
   1.573 +    (void) modulateA;  /* not all formats use alpha. */
   1.574  
   1.575      srcy = 0;
   1.576      posy = 0;
   1.577 @@ -2854,7 +2871,7 @@
   1.578                  src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
   1.579              }
   1.580              srcpixel = *src;
   1.581 -            srcA = (Uint8)(srcpixel >> 24); srcR = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcB = (Uint8)srcpixel;
   1.582 +            srcR = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcB = (Uint8)srcpixel; srcA = (Uint8)(srcpixel >> 24);
   1.583              dstpixel = *dst;
   1.584              dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; dstA = 0xFF;
   1.585              if (flags & SDL_COPY_MODULATE_COLOR) {
   1.586 @@ -2908,6 +2925,7 @@
   1.587      int srcy, srcx;
   1.588      int posy, posx;
   1.589      int incy, incx;
   1.590 +    (void) A;  /* not all formats use alpha. */
   1.591  
   1.592      srcy = 0;
   1.593      posy = 0;
   1.594 @@ -2933,7 +2951,7 @@
   1.595                  src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
   1.596              }
   1.597              pixel = *src;
   1.598 -            A = (Uint8)(pixel >> 24); R = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); B = (Uint8)pixel;
   1.599 +            R = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); B = (Uint8)pixel;
   1.600              pixel = ((Uint32)B << 16) | ((Uint32)G << 8) | R;
   1.601              *dst = pixel;
   1.602              posx += incx;
   1.603 @@ -2958,7 +2976,7 @@
   1.604          int n = info->dst_w;
   1.605          while (n--) {
   1.606              srcpixel = *src;
   1.607 -            srcA = (Uint8)(srcpixel >> 24); srcR = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcB = (Uint8)srcpixel;
   1.608 +            srcR = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcB = (Uint8)srcpixel; srcA = (Uint8)(srcpixel >> 24);
   1.609              dstpixel = *dst;
   1.610              dstB = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstR = (Uint8)dstpixel; dstA = 0xFF;
   1.611              if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
   1.612 @@ -3032,7 +3050,7 @@
   1.613                  src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
   1.614              }
   1.615              srcpixel = *src;
   1.616 -            srcA = (Uint8)(srcpixel >> 24); srcR = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcB = (Uint8)srcpixel;
   1.617 +            srcR = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcB = (Uint8)srcpixel; srcA = (Uint8)(srcpixel >> 24);
   1.618              dstpixel = *dst;
   1.619              dstB = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstR = (Uint8)dstpixel; dstA = 0xFF;
   1.620              if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
   1.621 @@ -3080,6 +3098,8 @@
   1.622      const Uint32 modulateA = info->a;
   1.623      Uint32 pixel;
   1.624      Uint32 R, G, B, A;
   1.625 +    (void) A;  /* not all formats use alpha. */
   1.626 +    (void) modulateA;  /* not all formats use alpha. */
   1.627  
   1.628      while (info->dst_h--) {
   1.629          Uint32 *src = (Uint32 *)info->src;
   1.630 @@ -3087,15 +3107,12 @@
   1.631          int n = info->dst_w;
   1.632          while (n--) {
   1.633              pixel = *src;
   1.634 -            A = (Uint8)(pixel >> 24); R = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); B = (Uint8)pixel;
   1.635 +            R = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); B = (Uint8)pixel;
   1.636              if (flags & SDL_COPY_MODULATE_COLOR) {
   1.637                  R = (R * modulateR) / 255;
   1.638                  G = (G * modulateG) / 255;
   1.639                  B = (B * modulateB) / 255;
   1.640              }
   1.641 -            if (flags & SDL_COPY_MODULATE_ALPHA) {
   1.642 -                A = (A * modulateA) / 255;
   1.643 -            }
   1.644              pixel = ((Uint32)B << 16) | ((Uint32)G << 8) | R;
   1.645              *dst = pixel;
   1.646              ++src;
   1.647 @@ -3118,6 +3135,8 @@
   1.648      int srcy, srcx;
   1.649      int posy, posx;
   1.650      int incy, incx;
   1.651 +    (void) A;  /* not all formats use alpha. */
   1.652 +    (void) modulateA;  /* not all formats use alpha. */
   1.653  
   1.654      srcy = 0;
   1.655      posy = 0;
   1.656 @@ -3143,15 +3162,12 @@
   1.657                  src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
   1.658              }
   1.659              pixel = *src;
   1.660 -            A = (Uint8)(pixel >> 24); R = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); B = (Uint8)pixel;
   1.661 +            R = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); B = (Uint8)pixel;
   1.662              if (flags & SDL_COPY_MODULATE_COLOR) {
   1.663                  R = (R * modulateR) / 255;
   1.664                  G = (G * modulateG) / 255;
   1.665                  B = (B * modulateB) / 255;
   1.666              }
   1.667 -            if (flags & SDL_COPY_MODULATE_ALPHA) {
   1.668 -                A = (A * modulateA) / 255;
   1.669 -            }
   1.670              pixel = ((Uint32)B << 16) | ((Uint32)G << 8) | R;
   1.671              *dst = pixel;
   1.672              posx += incx;
   1.673 @@ -3173,6 +3189,7 @@
   1.674      Uint32 srcR, srcG, srcB, srcA;
   1.675      Uint32 dstpixel;
   1.676      Uint32 dstR, dstG, dstB, dstA;
   1.677 +    (void) modulateA;  /* not all formats use alpha. */
   1.678  
   1.679      while (info->dst_h--) {
   1.680          Uint32 *src = (Uint32 *)info->src;
   1.681 @@ -3180,7 +3197,7 @@
   1.682          int n = info->dst_w;
   1.683          while (n--) {
   1.684              srcpixel = *src;
   1.685 -            srcA = (Uint8)(srcpixel >> 24); srcR = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcB = (Uint8)srcpixel;
   1.686 +            srcR = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcB = (Uint8)srcpixel; srcA = (Uint8)(srcpixel >> 24);
   1.687              dstpixel = *dst;
   1.688              dstB = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstR = (Uint8)dstpixel; dstA = 0xFF;
   1.689              if (flags & SDL_COPY_MODULATE_COLOR) {
   1.690 @@ -3241,6 +3258,7 @@
   1.691      int srcy, srcx;
   1.692      int posy, posx;
   1.693      int incy, incx;
   1.694 +    (void) modulateA;  /* not all formats use alpha. */
   1.695  
   1.696      srcy = 0;
   1.697      posy = 0;
   1.698 @@ -3266,7 +3284,7 @@
   1.699                  src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
   1.700              }
   1.701              srcpixel = *src;
   1.702 -            srcA = (Uint8)(srcpixel >> 24); srcR = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcB = (Uint8)srcpixel;
   1.703 +            srcR = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcB = (Uint8)srcpixel; srcA = (Uint8)(srcpixel >> 24);
   1.704              dstpixel = *dst;
   1.705              dstB = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstR = (Uint8)dstpixel; dstA = 0xFF;
   1.706              if (flags & SDL_COPY_MODULATE_COLOR) {
   1.707 @@ -3365,9 +3383,9 @@
   1.708          int n = info->dst_w;
   1.709          while (n--) {
   1.710              srcpixel = *src;
   1.711 -            srcA = (Uint8)(srcpixel >> 24); srcR = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcB = (Uint8)srcpixel;
   1.712 +            srcR = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcB = (Uint8)srcpixel; srcA = (Uint8)(srcpixel >> 24);
   1.713              dstpixel = *dst;
   1.714 -            dstA = (Uint8)(dstpixel >> 24); dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel;
   1.715 +            dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; dstA = (Uint8)(dstpixel >> 24);
   1.716              if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
   1.717                  /* This goes away if we ever use premultiplied alpha */
   1.718                  if (srcA < 255) {
   1.719 @@ -3439,9 +3457,9 @@
   1.720                  src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
   1.721              }
   1.722              srcpixel = *src;
   1.723 -            srcA = (Uint8)(srcpixel >> 24); srcR = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcB = (Uint8)srcpixel;
   1.724 +            srcR = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcB = (Uint8)srcpixel; srcA = (Uint8)(srcpixel >> 24);
   1.725              dstpixel = *dst;
   1.726 -            dstA = (Uint8)(dstpixel >> 24); dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel;
   1.727 +            dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; dstA = (Uint8)(dstpixel >> 24);
   1.728              if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
   1.729                  /* This goes away if we ever use premultiplied alpha */
   1.730                  if (srcA < 255) {
   1.731 @@ -3487,6 +3505,8 @@
   1.732      const Uint32 modulateA = info->a;
   1.733      Uint32 pixel;
   1.734      Uint32 R, G, B, A;
   1.735 +    (void) A;  /* not all formats use alpha. */
   1.736 +    (void) modulateA;  /* not all formats use alpha. */
   1.737  
   1.738      while (info->dst_h--) {
   1.739          Uint32 *src = (Uint32 *)info->src;
   1.740 @@ -3494,7 +3514,7 @@
   1.741          int n = info->dst_w;
   1.742          while (n--) {
   1.743              pixel = *src;
   1.744 -            A = (Uint8)(pixel >> 24); R = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); B = (Uint8)pixel;
   1.745 +            R = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); B = (Uint8)pixel; A = (Uint8)(pixel >> 24);
   1.746              if (flags & SDL_COPY_MODULATE_COLOR) {
   1.747                  R = (R * modulateR) / 255;
   1.748                  G = (G * modulateG) / 255;
   1.749 @@ -3525,6 +3545,8 @@
   1.750      int srcy, srcx;
   1.751      int posy, posx;
   1.752      int incy, incx;
   1.753 +    (void) A;  /* not all formats use alpha. */
   1.754 +    (void) modulateA;  /* not all formats use alpha. */
   1.755  
   1.756      srcy = 0;
   1.757      posy = 0;
   1.758 @@ -3550,7 +3572,7 @@
   1.759                  src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
   1.760              }
   1.761              pixel = *src;
   1.762 -            A = (Uint8)(pixel >> 24); R = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); B = (Uint8)pixel;
   1.763 +            R = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); B = (Uint8)pixel; A = (Uint8)(pixel >> 24);
   1.764              if (flags & SDL_COPY_MODULATE_COLOR) {
   1.765                  R = (R * modulateR) / 255;
   1.766                  G = (G * modulateG) / 255;
   1.767 @@ -3580,6 +3602,7 @@
   1.768      Uint32 srcR, srcG, srcB, srcA;
   1.769      Uint32 dstpixel;
   1.770      Uint32 dstR, dstG, dstB, dstA;
   1.771 +    (void) modulateA;  /* not all formats use alpha. */
   1.772  
   1.773      while (info->dst_h--) {
   1.774          Uint32 *src = (Uint32 *)info->src;
   1.775 @@ -3587,9 +3610,9 @@
   1.776          int n = info->dst_w;
   1.777          while (n--) {
   1.778              srcpixel = *src;
   1.779 -            srcA = (Uint8)(srcpixel >> 24); srcR = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcB = (Uint8)srcpixel;
   1.780 +            srcR = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcB = (Uint8)srcpixel; srcA = (Uint8)(srcpixel >> 24);
   1.781              dstpixel = *dst;
   1.782 -            dstA = (Uint8)(dstpixel >> 24); dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel;
   1.783 +            dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; dstA = (Uint8)(dstpixel >> 24);
   1.784              if (flags & SDL_COPY_MODULATE_COLOR) {
   1.785                  srcR = (srcR * modulateR) / 255;
   1.786                  srcG = (srcG * modulateG) / 255;
   1.787 @@ -3648,6 +3671,7 @@
   1.788      int srcy, srcx;
   1.789      int posy, posx;
   1.790      int incy, incx;
   1.791 +    (void) modulateA;  /* not all formats use alpha. */
   1.792  
   1.793      srcy = 0;
   1.794      posy = 0;
   1.795 @@ -3673,9 +3697,9 @@
   1.796                  src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
   1.797              }
   1.798              srcpixel = *src;
   1.799 -            srcA = (Uint8)(srcpixel >> 24); srcR = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcB = (Uint8)srcpixel;
   1.800 +            srcR = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcB = (Uint8)srcpixel; srcA = (Uint8)(srcpixel >> 24);
   1.801              dstpixel = *dst;
   1.802 -            dstA = (Uint8)(dstpixel >> 24); dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel;
   1.803 +            dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; dstA = (Uint8)(dstpixel >> 24);
   1.804              if (flags & SDL_COPY_MODULATE_COLOR) {
   1.805                  srcR = (srcR * modulateR) / 255;
   1.806                  srcG = (srcG * modulateG) / 255;
   1.807 @@ -3727,6 +3751,7 @@
   1.808      int srcy, srcx;
   1.809      int posy, posx;
   1.810      int incy, incx;
   1.811 +    (void) A;  /* not all formats use alpha. */
   1.812  
   1.813      srcy = 0;
   1.814      posy = 0;
   1.815 @@ -3752,7 +3777,7 @@
   1.816                  src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
   1.817              }
   1.818              pixel = *src;
   1.819 -            R = (Uint8)(pixel >> 24); G = (Uint8)(pixel >> 16); B = (Uint8)(pixel >> 8); A = (Uint8)pixel;
   1.820 +            R = (Uint8)(pixel >> 24); G = (Uint8)(pixel >> 16); B = (Uint8)(pixel >> 8);
   1.821              pixel = ((Uint32)R << 16) | ((Uint32)G << 8) | B;
   1.822              *dst = pixel;
   1.823              posx += incx;
   1.824 @@ -3899,6 +3924,8 @@
   1.825      const Uint32 modulateA = info->a;
   1.826      Uint32 pixel;
   1.827      Uint32 R, G, B, A;
   1.828 +    (void) A;  /* not all formats use alpha. */
   1.829 +    (void) modulateA;  /* not all formats use alpha. */
   1.830  
   1.831      while (info->dst_h--) {
   1.832          Uint32 *src = (Uint32 *)info->src;
   1.833 @@ -3906,15 +3933,12 @@
   1.834          int n = info->dst_w;
   1.835          while (n--) {
   1.836              pixel = *src;
   1.837 -            R = (Uint8)(pixel >> 24); G = (Uint8)(pixel >> 16); B = (Uint8)(pixel >> 8); A = (Uint8)pixel;
   1.838 +            R = (Uint8)(pixel >> 24); G = (Uint8)(pixel >> 16); B = (Uint8)(pixel >> 8);
   1.839              if (flags & SDL_COPY_MODULATE_COLOR) {
   1.840                  R = (R * modulateR) / 255;
   1.841                  G = (G * modulateG) / 255;
   1.842                  B = (B * modulateB) / 255;
   1.843              }
   1.844 -            if (flags & SDL_COPY_MODULATE_ALPHA) {
   1.845 -                A = (A * modulateA) / 255;
   1.846 -            }
   1.847              pixel = ((Uint32)R << 16) | ((Uint32)G << 8) | B;
   1.848              *dst = pixel;
   1.849              ++src;
   1.850 @@ -3937,6 +3961,8 @@
   1.851      int srcy, srcx;
   1.852      int posy, posx;
   1.853      int incy, incx;
   1.854 +    (void) A;  /* not all formats use alpha. */
   1.855 +    (void) modulateA;  /* not all formats use alpha. */
   1.856  
   1.857      srcy = 0;
   1.858      posy = 0;
   1.859 @@ -3962,15 +3988,12 @@
   1.860                  src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
   1.861              }
   1.862              pixel = *src;
   1.863 -            R = (Uint8)(pixel >> 24); G = (Uint8)(pixel >> 16); B = (Uint8)(pixel >> 8); A = (Uint8)pixel;
   1.864 +            R = (Uint8)(pixel >> 24); G = (Uint8)(pixel >> 16); B = (Uint8)(pixel >> 8);
   1.865              if (flags & SDL_COPY_MODULATE_COLOR) {
   1.866                  R = (R * modulateR) / 255;
   1.867                  G = (G * modulateG) / 255;
   1.868                  B = (B * modulateB) / 255;
   1.869              }
   1.870 -            if (flags & SDL_COPY_MODULATE_ALPHA) {
   1.871 -                A = (A * modulateA) / 255;
   1.872 -            }
   1.873              pixel = ((Uint32)R << 16) | ((Uint32)G << 8) | B;
   1.874              *dst = pixel;
   1.875              posx += incx;
   1.876 @@ -3992,6 +4015,7 @@
   1.877      Uint32 srcR, srcG, srcB, srcA;
   1.878      Uint32 dstpixel;
   1.879      Uint32 dstR, dstG, dstB, dstA;
   1.880 +    (void) modulateA;  /* not all formats use alpha. */
   1.881  
   1.882      while (info->dst_h--) {
   1.883          Uint32 *src = (Uint32 *)info->src;
   1.884 @@ -4060,6 +4084,7 @@
   1.885      int srcy, srcx;
   1.886      int posy, posx;
   1.887      int incy, incx;
   1.888 +    (void) modulateA;  /* not all formats use alpha. */
   1.889  
   1.890      srcy = 0;
   1.891      posy = 0;
   1.892 @@ -4139,6 +4164,7 @@
   1.893      int srcy, srcx;
   1.894      int posy, posx;
   1.895      int incy, incx;
   1.896 +    (void) A;  /* not all formats use alpha. */
   1.897  
   1.898      srcy = 0;
   1.899      posy = 0;
   1.900 @@ -4164,7 +4190,7 @@
   1.901                  src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
   1.902              }
   1.903              pixel = *src;
   1.904 -            R = (Uint8)(pixel >> 24); G = (Uint8)(pixel >> 16); B = (Uint8)(pixel >> 8); A = (Uint8)pixel;
   1.905 +            R = (Uint8)(pixel >> 24); G = (Uint8)(pixel >> 16); B = (Uint8)(pixel >> 8);
   1.906              pixel = ((Uint32)B << 16) | ((Uint32)G << 8) | R;
   1.907              *dst = pixel;
   1.908              posx += incx;
   1.909 @@ -4311,6 +4337,8 @@
   1.910      const Uint32 modulateA = info->a;
   1.911      Uint32 pixel;
   1.912      Uint32 R, G, B, A;
   1.913 +    (void) A;  /* not all formats use alpha. */
   1.914 +    (void) modulateA;  /* not all formats use alpha. */
   1.915  
   1.916      while (info->dst_h--) {
   1.917          Uint32 *src = (Uint32 *)info->src;
   1.918 @@ -4318,15 +4346,12 @@
   1.919          int n = info->dst_w;
   1.920          while (n--) {
   1.921              pixel = *src;
   1.922 -            R = (Uint8)(pixel >> 24); G = (Uint8)(pixel >> 16); B = (Uint8)(pixel >> 8); A = (Uint8)pixel;
   1.923 +            R = (Uint8)(pixel >> 24); G = (Uint8)(pixel >> 16); B = (Uint8)(pixel >> 8);
   1.924              if (flags & SDL_COPY_MODULATE_COLOR) {
   1.925                  R = (R * modulateR) / 255;
   1.926                  G = (G * modulateG) / 255;
   1.927                  B = (B * modulateB) / 255;
   1.928              }
   1.929 -            if (flags & SDL_COPY_MODULATE_ALPHA) {
   1.930 -                A = (A * modulateA) / 255;
   1.931 -            }
   1.932              pixel = ((Uint32)B << 16) | ((Uint32)G << 8) | R;
   1.933              *dst = pixel;
   1.934              ++src;
   1.935 @@ -4349,6 +4374,8 @@
   1.936      int srcy, srcx;
   1.937      int posy, posx;
   1.938      int incy, incx;
   1.939 +    (void) A;  /* not all formats use alpha. */
   1.940 +    (void) modulateA;  /* not all formats use alpha. */
   1.941  
   1.942      srcy = 0;
   1.943      posy = 0;
   1.944 @@ -4374,15 +4401,12 @@
   1.945                  src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
   1.946              }
   1.947              pixel = *src;
   1.948 -            R = (Uint8)(pixel >> 24); G = (Uint8)(pixel >> 16); B = (Uint8)(pixel >> 8); A = (Uint8)pixel;
   1.949 +            R = (Uint8)(pixel >> 24); G = (Uint8)(pixel >> 16); B = (Uint8)(pixel >> 8);
   1.950              if (flags & SDL_COPY_MODULATE_COLOR) {
   1.951                  R = (R * modulateR) / 255;
   1.952                  G = (G * modulateG) / 255;
   1.953                  B = (B * modulateB) / 255;
   1.954              }
   1.955 -            if (flags & SDL_COPY_MODULATE_ALPHA) {
   1.956 -                A = (A * modulateA) / 255;
   1.957 -            }
   1.958              pixel = ((Uint32)B << 16) | ((Uint32)G << 8) | R;
   1.959              *dst = pixel;
   1.960              posx += incx;
   1.961 @@ -4404,6 +4428,7 @@
   1.962      Uint32 srcR, srcG, srcB, srcA;
   1.963      Uint32 dstpixel;
   1.964      Uint32 dstR, dstG, dstB, dstA;
   1.965 +    (void) modulateA;  /* not all formats use alpha. */
   1.966  
   1.967      while (info->dst_h--) {
   1.968          Uint32 *src = (Uint32 *)info->src;
   1.969 @@ -4472,6 +4497,7 @@
   1.970      int srcy, srcx;
   1.971      int posy, posx;
   1.972      int incy, incx;
   1.973 +    (void) modulateA;  /* not all formats use alpha. */
   1.974  
   1.975      srcy = 0;
   1.976      posy = 0;
   1.977 @@ -4551,6 +4577,7 @@
   1.978      int srcy, srcx;
   1.979      int posy, posx;
   1.980      int incy, incx;
   1.981 +    (void) A;  /* not all formats use alpha. */
   1.982  
   1.983      srcy = 0;
   1.984      posy = 0;
   1.985 @@ -4603,7 +4630,7 @@
   1.986              srcpixel = *src;
   1.987              srcR = (Uint8)(srcpixel >> 24); srcG = (Uint8)(srcpixel >> 16); srcB = (Uint8)(srcpixel >> 8); srcA = (Uint8)srcpixel;
   1.988              dstpixel = *dst;
   1.989 -            dstA = (Uint8)(dstpixel >> 24); dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel;
   1.990 +            dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; dstA = (Uint8)(dstpixel >> 24);
   1.991              if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
   1.992                  /* This goes away if we ever use premultiplied alpha */
   1.993                  if (srcA < 255) {
   1.994 @@ -4677,7 +4704,7 @@
   1.995              srcpixel = *src;
   1.996              srcR = (Uint8)(srcpixel >> 24); srcG = (Uint8)(srcpixel >> 16); srcB = (Uint8)(srcpixel >> 8); srcA = (Uint8)srcpixel;
   1.997              dstpixel = *dst;
   1.998 -            dstA = (Uint8)(dstpixel >> 24); dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel;
   1.999 +            dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; dstA = (Uint8)(dstpixel >> 24);
  1.1000              if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
  1.1001                  /* This goes away if we ever use premultiplied alpha */
  1.1002                  if (srcA < 255) {
  1.1003 @@ -4723,6 +4750,8 @@
  1.1004      const Uint32 modulateA = info->a;
  1.1005      Uint32 pixel;
  1.1006      Uint32 R, G, B, A;
  1.1007 +    (void) A;  /* not all formats use alpha. */
  1.1008 +    (void) modulateA;  /* not all formats use alpha. */
  1.1009  
  1.1010      while (info->dst_h--) {
  1.1011          Uint32 *src = (Uint32 *)info->src;
  1.1012 @@ -4761,6 +4790,8 @@
  1.1013      int srcy, srcx;
  1.1014      int posy, posx;
  1.1015      int incy, incx;
  1.1016 +    (void) A;  /* not all formats use alpha. */
  1.1017 +    (void) modulateA;  /* not all formats use alpha. */
  1.1018  
  1.1019      srcy = 0;
  1.1020      posy = 0;
  1.1021 @@ -4816,6 +4847,7 @@
  1.1022      Uint32 srcR, srcG, srcB, srcA;
  1.1023      Uint32 dstpixel;
  1.1024      Uint32 dstR, dstG, dstB, dstA;
  1.1025 +    (void) modulateA;  /* not all formats use alpha. */
  1.1026  
  1.1027      while (info->dst_h--) {
  1.1028          Uint32 *src = (Uint32 *)info->src;
  1.1029 @@ -4825,7 +4857,7 @@
  1.1030              srcpixel = *src;
  1.1031              srcR = (Uint8)(srcpixel >> 24); srcG = (Uint8)(srcpixel >> 16); srcB = (Uint8)(srcpixel >> 8); srcA = (Uint8)srcpixel;
  1.1032              dstpixel = *dst;
  1.1033 -            dstA = (Uint8)(dstpixel >> 24); dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel;
  1.1034 +            dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; dstA = (Uint8)(dstpixel >> 24);
  1.1035              if (flags & SDL_COPY_MODULATE_COLOR) {
  1.1036                  srcR = (srcR * modulateR) / 255;
  1.1037                  srcG = (srcG * modulateG) / 255;
  1.1038 @@ -4884,6 +4916,7 @@
  1.1039      int srcy, srcx;
  1.1040      int posy, posx;
  1.1041      int incy, incx;
  1.1042 +    (void) modulateA;  /* not all formats use alpha. */
  1.1043  
  1.1044      srcy = 0;
  1.1045      posy = 0;
  1.1046 @@ -4911,7 +4944,7 @@
  1.1047              srcpixel = *src;
  1.1048              srcR = (Uint8)(srcpixel >> 24); srcG = (Uint8)(srcpixel >> 16); srcB = (Uint8)(srcpixel >> 8); srcA = (Uint8)srcpixel;
  1.1049              dstpixel = *dst;
  1.1050 -            dstA = (Uint8)(dstpixel >> 24); dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel;
  1.1051 +            dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; dstA = (Uint8)(dstpixel >> 24);
  1.1052              if (flags & SDL_COPY_MODULATE_COLOR) {
  1.1053                  srcR = (srcR * modulateR) / 255;
  1.1054                  srcG = (srcG * modulateG) / 255;
  1.1055 @@ -4963,6 +4996,7 @@
  1.1056      int srcy, srcx;
  1.1057      int posy, posx;
  1.1058      int incy, incx;
  1.1059 +    (void) A;  /* not all formats use alpha. */
  1.1060  
  1.1061      srcy = 0;
  1.1062      posy = 0;
  1.1063 @@ -4988,7 +5022,7 @@
  1.1064                  src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
  1.1065              }
  1.1066              pixel = *src;
  1.1067 -            A = (Uint8)(pixel >> 24); B = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); R = (Uint8)pixel;
  1.1068 +            B = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); R = (Uint8)pixel;
  1.1069              pixel = ((Uint32)R << 16) | ((Uint32)G << 8) | B;
  1.1070              *dst = pixel;
  1.1071              posx += incx;
  1.1072 @@ -5013,7 +5047,7 @@
  1.1073          int n = info->dst_w;
  1.1074          while (n--) {
  1.1075              srcpixel = *src;
  1.1076 -            srcA = (Uint8)(srcpixel >> 24); srcB = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcR = (Uint8)srcpixel;
  1.1077 +            srcB = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcR = (Uint8)srcpixel; srcA = (Uint8)(srcpixel >> 24);
  1.1078              dstpixel = *dst;
  1.1079              dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; dstA = 0xFF;
  1.1080              if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
  1.1081 @@ -5087,7 +5121,7 @@
  1.1082                  src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
  1.1083              }
  1.1084              srcpixel = *src;
  1.1085 -            srcA = (Uint8)(srcpixel >> 24); srcB = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcR = (Uint8)srcpixel;
  1.1086 +            srcB = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcR = (Uint8)srcpixel; srcA = (Uint8)(srcpixel >> 24);
  1.1087              dstpixel = *dst;
  1.1088              dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; dstA = 0xFF;
  1.1089              if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
  1.1090 @@ -5135,6 +5169,8 @@
  1.1091      const Uint32 modulateA = info->a;
  1.1092      Uint32 pixel;
  1.1093      Uint32 R, G, B, A;
  1.1094 +    (void) A;  /* not all formats use alpha. */
  1.1095 +    (void) modulateA;  /* not all formats use alpha. */
  1.1096  
  1.1097      while (info->dst_h--) {
  1.1098          Uint32 *src = (Uint32 *)info->src;
  1.1099 @@ -5142,15 +5178,12 @@
  1.1100          int n = info->dst_w;
  1.1101          while (n--) {
  1.1102              pixel = *src;
  1.1103 -            A = (Uint8)(pixel >> 24); B = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); R = (Uint8)pixel;
  1.1104 +            B = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); R = (Uint8)pixel;
  1.1105              if (flags & SDL_COPY_MODULATE_COLOR) {
  1.1106                  R = (R * modulateR) / 255;
  1.1107                  G = (G * modulateG) / 255;
  1.1108                  B = (B * modulateB) / 255;
  1.1109              }
  1.1110 -            if (flags & SDL_COPY_MODULATE_ALPHA) {
  1.1111 -                A = (A * modulateA) / 255;
  1.1112 -            }
  1.1113              pixel = ((Uint32)R << 16) | ((Uint32)G << 8) | B;
  1.1114              *dst = pixel;
  1.1115              ++src;
  1.1116 @@ -5173,6 +5206,8 @@
  1.1117      int srcy, srcx;
  1.1118      int posy, posx;
  1.1119      int incy, incx;
  1.1120 +    (void) A;  /* not all formats use alpha. */
  1.1121 +    (void) modulateA;  /* not all formats use alpha. */
  1.1122  
  1.1123      srcy = 0;
  1.1124      posy = 0;
  1.1125 @@ -5198,15 +5233,12 @@
  1.1126                  src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
  1.1127              }
  1.1128              pixel = *src;
  1.1129 -            A = (Uint8)(pixel >> 24); B = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); R = (Uint8)pixel;
  1.1130 +            B = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); R = (Uint8)pixel;
  1.1131              if (flags & SDL_COPY_MODULATE_COLOR) {
  1.1132                  R = (R * modulateR) / 255;
  1.1133                  G = (G * modulateG) / 255;
  1.1134                  B = (B * modulateB) / 255;
  1.1135              }
  1.1136 -            if (flags & SDL_COPY_MODULATE_ALPHA) {
  1.1137 -                A = (A * modulateA) / 255;
  1.1138 -            }
  1.1139              pixel = ((Uint32)R << 16) | ((Uint32)G << 8) | B;
  1.1140              *dst = pixel;
  1.1141              posx += incx;
  1.1142 @@ -5228,6 +5260,7 @@
  1.1143      Uint32 srcR, srcG, srcB, srcA;
  1.1144      Uint32 dstpixel;
  1.1145      Uint32 dstR, dstG, dstB, dstA;
  1.1146 +    (void) modulateA;  /* not all formats use alpha. */
  1.1147  
  1.1148      while (info->dst_h--) {
  1.1149          Uint32 *src = (Uint32 *)info->src;
  1.1150 @@ -5235,7 +5268,7 @@
  1.1151          int n = info->dst_w;
  1.1152          while (n--) {
  1.1153              srcpixel = *src;
  1.1154 -            srcA = (Uint8)(srcpixel >> 24); srcB = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcR = (Uint8)srcpixel;
  1.1155 +            srcB = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcR = (Uint8)srcpixel; srcA = (Uint8)(srcpixel >> 24);
  1.1156              dstpixel = *dst;
  1.1157              dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; dstA = 0xFF;
  1.1158              if (flags & SDL_COPY_MODULATE_COLOR) {
  1.1159 @@ -5296,6 +5329,7 @@
  1.1160      int srcy, srcx;
  1.1161      int posy, posx;
  1.1162      int incy, incx;
  1.1163 +    (void) modulateA;  /* not all formats use alpha. */
  1.1164  
  1.1165      srcy = 0;
  1.1166      posy = 0;
  1.1167 @@ -5321,7 +5355,7 @@
  1.1168                  src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
  1.1169              }
  1.1170              srcpixel = *src;
  1.1171 -            srcA = (Uint8)(srcpixel >> 24); srcB = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcR = (Uint8)srcpixel;
  1.1172 +            srcB = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcR = (Uint8)srcpixel; srcA = (Uint8)(srcpixel >> 24);
  1.1173              dstpixel = *dst;
  1.1174              dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; dstA = 0xFF;
  1.1175              if (flags & SDL_COPY_MODULATE_COLOR) {
  1.1176 @@ -5375,6 +5409,7 @@
  1.1177      int srcy, srcx;
  1.1178      int posy, posx;
  1.1179      int incy, incx;
  1.1180 +    (void) A;  /* not all formats use alpha. */
  1.1181  
  1.1182      srcy = 0;
  1.1183      posy = 0;
  1.1184 @@ -5400,7 +5435,7 @@
  1.1185                  src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
  1.1186              }
  1.1187              pixel = *src;
  1.1188 -            A = (Uint8)(pixel >> 24); B = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); R = (Uint8)pixel;
  1.1189 +            B = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); R = (Uint8)pixel;
  1.1190              pixel = ((Uint32)B << 16) | ((Uint32)G << 8) | R;
  1.1191              *dst = pixel;
  1.1192              posx += incx;
  1.1193 @@ -5425,7 +5460,7 @@
  1.1194          int n = info->dst_w;
  1.1195          while (n--) {
  1.1196              srcpixel = *src;
  1.1197 -            srcA = (Uint8)(srcpixel >> 24); srcB = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcR = (Uint8)srcpixel;
  1.1198 +            srcB = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcR = (Uint8)srcpixel; srcA = (Uint8)(srcpixel >> 24);
  1.1199              dstpixel = *dst;
  1.1200              dstB = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstR = (Uint8)dstpixel; dstA = 0xFF;
  1.1201              if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
  1.1202 @@ -5499,7 +5534,7 @@
  1.1203                  src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
  1.1204              }
  1.1205              srcpixel = *src;
  1.1206 -            srcA = (Uint8)(srcpixel >> 24); srcB = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcR = (Uint8)srcpixel;
  1.1207 +            srcB = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcR = (Uint8)srcpixel; srcA = (Uint8)(srcpixel >> 24);
  1.1208              dstpixel = *dst;
  1.1209              dstB = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstR = (Uint8)dstpixel; dstA = 0xFF;
  1.1210              if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
  1.1211 @@ -5547,6 +5582,8 @@
  1.1212      const Uint32 modulateA = info->a;
  1.1213      Uint32 pixel;
  1.1214      Uint32 R, G, B, A;
  1.1215 +    (void) A;  /* not all formats use alpha. */
  1.1216 +    (void) modulateA;  /* not all formats use alpha. */
  1.1217  
  1.1218      while (info->dst_h--) {
  1.1219          Uint32 *src = (Uint32 *)info->src;
  1.1220 @@ -5554,15 +5591,12 @@
  1.1221          int n = info->dst_w;
  1.1222          while (n--) {
  1.1223              pixel = *src;
  1.1224 -            A = (Uint8)(pixel >> 24); B = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); R = (Uint8)pixel;
  1.1225 +            B = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); R = (Uint8)pixel;
  1.1226              if (flags & SDL_COPY_MODULATE_COLOR) {
  1.1227                  R = (R * modulateR) / 255;
  1.1228                  G = (G * modulateG) / 255;
  1.1229                  B = (B * modulateB) / 255;
  1.1230              }
  1.1231 -            if (flags & SDL_COPY_MODULATE_ALPHA) {
  1.1232 -                A = (A * modulateA) / 255;
  1.1233 -            }
  1.1234              pixel = ((Uint32)B << 16) | ((Uint32)G << 8) | R;
  1.1235              *dst = pixel;
  1.1236              ++src;
  1.1237 @@ -5585,6 +5619,8 @@
  1.1238      int srcy, srcx;
  1.1239      int posy, posx;
  1.1240      int incy, incx;
  1.1241 +    (void) A;  /* not all formats use alpha. */
  1.1242 +    (void) modulateA;  /* not all formats use alpha. */
  1.1243  
  1.1244      srcy = 0;
  1.1245      posy = 0;
  1.1246 @@ -5610,15 +5646,12 @@
  1.1247                  src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
  1.1248              }
  1.1249              pixel = *src;
  1.1250 -            A = (Uint8)(pixel >> 24); B = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); R = (Uint8)pixel;
  1.1251 +            B = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); R = (Uint8)pixel;
  1.1252              if (flags & SDL_COPY_MODULATE_COLOR) {
  1.1253                  R = (R * modulateR) / 255;
  1.1254                  G = (G * modulateG) / 255;
  1.1255                  B = (B * modulateB) / 255;
  1.1256              }
  1.1257 -            if (flags & SDL_COPY_MODULATE_ALPHA) {
  1.1258 -                A = (A * modulateA) / 255;
  1.1259 -            }
  1.1260              pixel = ((Uint32)B << 16) | ((Uint32)G << 8) | R;
  1.1261              *dst = pixel;
  1.1262              posx += incx;
  1.1263 @@ -5640,6 +5673,7 @@
  1.1264      Uint32 srcR, srcG, srcB, srcA;
  1.1265      Uint32 dstpixel;
  1.1266      Uint32 dstR, dstG, dstB, dstA;
  1.1267 +    (void) modulateA;  /* not all formats use alpha. */
  1.1268  
  1.1269      while (info->dst_h--) {
  1.1270          Uint32 *src = (Uint32 *)info->src;
  1.1271 @@ -5647,7 +5681,7 @@
  1.1272          int n = info->dst_w;
  1.1273          while (n--) {
  1.1274              srcpixel = *src;
  1.1275 -            srcA = (Uint8)(srcpixel >> 24); srcB = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcR = (Uint8)srcpixel;
  1.1276 +            srcB = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcR = (Uint8)srcpixel; srcA = (Uint8)(srcpixel >> 24);
  1.1277              dstpixel = *dst;
  1.1278              dstB = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstR = (Uint8)dstpixel; dstA = 0xFF;
  1.1279              if (flags & SDL_COPY_MODULATE_COLOR) {
  1.1280 @@ -5708,6 +5742,7 @@
  1.1281      int srcy, srcx;
  1.1282      int posy, posx;
  1.1283      int incy, incx;
  1.1284 +    (void) modulateA;  /* not all formats use alpha. */
  1.1285  
  1.1286      srcy = 0;
  1.1287      posy = 0;
  1.1288 @@ -5733,7 +5768,7 @@
  1.1289                  src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
  1.1290              }
  1.1291              srcpixel = *src;
  1.1292 -            srcA = (Uint8)(srcpixel >> 24); srcB = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcR = (Uint8)srcpixel;
  1.1293 +            srcB = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcR = (Uint8)srcpixel; srcA = (Uint8)(srcpixel >> 24);
  1.1294              dstpixel = *dst;
  1.1295              dstB = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstR = (Uint8)dstpixel; dstA = 0xFF;
  1.1296              if (flags & SDL_COPY_MODULATE_COLOR) {
  1.1297 @@ -5787,6 +5822,7 @@
  1.1298      int srcy, srcx;
  1.1299      int posy, posx;
  1.1300      int incy, incx;
  1.1301 +    (void) A;  /* not all formats use alpha. */
  1.1302  
  1.1303      srcy = 0;
  1.1304      posy = 0;
  1.1305 @@ -5812,7 +5848,7 @@
  1.1306                  src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
  1.1307              }
  1.1308              pixel = *src;
  1.1309 -            A = (Uint8)(pixel >> 24); B = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); R = (Uint8)pixel;
  1.1310 +            B = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); R = (Uint8)pixel; A = (Uint8)(pixel >> 24);
  1.1311              pixel = ((Uint32)A << 24) | ((Uint32)R << 16) | ((Uint32)G << 8) | B;
  1.1312              *dst = pixel;
  1.1313              posx += incx;
  1.1314 @@ -5837,9 +5873,9 @@
  1.1315          int n = info->dst_w;
  1.1316          while (n--) {
  1.1317              srcpixel = *src;
  1.1318 -            srcA = (Uint8)(srcpixel >> 24); srcB = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcR = (Uint8)srcpixel;
  1.1319 +            srcB = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcR = (Uint8)srcpixel; srcA = (Uint8)(srcpixel >> 24);
  1.1320              dstpixel = *dst;
  1.1321 -            dstA = (Uint8)(dstpixel >> 24); dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel;
  1.1322 +            dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; dstA = (Uint8)(dstpixel >> 24);
  1.1323              if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
  1.1324                  /* This goes away if we ever use premultiplied alpha */
  1.1325                  if (srcA < 255) {
  1.1326 @@ -5911,9 +5947,9 @@
  1.1327                  src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
  1.1328              }
  1.1329              srcpixel = *src;
  1.1330 -            srcA = (Uint8)(srcpixel >> 24); srcB = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcR = (Uint8)srcpixel;
  1.1331 +            srcB = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcR = (Uint8)srcpixel; srcA = (Uint8)(srcpixel >> 24);
  1.1332              dstpixel = *dst;
  1.1333 -            dstA = (Uint8)(dstpixel >> 24); dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel;
  1.1334 +            dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; dstA = (Uint8)(dstpixel >> 24);
  1.1335              if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
  1.1336                  /* This goes away if we ever use premultiplied alpha */
  1.1337                  if (srcA < 255) {
  1.1338 @@ -5959,6 +5995,8 @@
  1.1339      const Uint32 modulateA = info->a;
  1.1340      Uint32 pixel;
  1.1341      Uint32 R, G, B, A;
  1.1342 +    (void) A;  /* not all formats use alpha. */
  1.1343 +    (void) modulateA;  /* not all formats use alpha. */
  1.1344  
  1.1345      while (info->dst_h--) {
  1.1346          Uint32 *src = (Uint32 *)info->src;
  1.1347 @@ -5966,7 +6004,7 @@
  1.1348          int n = info->dst_w;
  1.1349          while (n--) {
  1.1350              pixel = *src;
  1.1351 -            A = (Uint8)(pixel >> 24); B = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); R = (Uint8)pixel;
  1.1352 +            B = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); R = (Uint8)pixel; A = (Uint8)(pixel >> 24);
  1.1353              if (flags & SDL_COPY_MODULATE_COLOR) {
  1.1354                  R = (R * modulateR) / 255;
  1.1355                  G = (G * modulateG) / 255;
  1.1356 @@ -5997,6 +6035,8 @@
  1.1357      int srcy, srcx;
  1.1358      int posy, posx;
  1.1359      int incy, incx;
  1.1360 +    (void) A;  /* not all formats use alpha. */
  1.1361 +    (void) modulateA;  /* not all formats use alpha. */
  1.1362  
  1.1363      srcy = 0;
  1.1364      posy = 0;
  1.1365 @@ -6022,7 +6062,7 @@
  1.1366                  src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
  1.1367              }
  1.1368              pixel = *src;
  1.1369 -            A = (Uint8)(pixel >> 24); B = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); R = (Uint8)pixel;
  1.1370 +            B = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); R = (Uint8)pixel; A = (Uint8)(pixel >> 24);
  1.1371              if (flags & SDL_COPY_MODULATE_COLOR) {
  1.1372                  R = (R * modulateR) / 255;
  1.1373                  G = (G * modulateG) / 255;
  1.1374 @@ -6052,6 +6092,7 @@
  1.1375      Uint32 srcR, srcG, srcB, srcA;
  1.1376      Uint32 dstpixel;
  1.1377      Uint32 dstR, dstG, dstB, dstA;
  1.1378 +    (void) modulateA;  /* not all formats use alpha. */
  1.1379  
  1.1380      while (info->dst_h--) {
  1.1381          Uint32 *src = (Uint32 *)info->src;
  1.1382 @@ -6059,9 +6100,9 @@
  1.1383          int n = info->dst_w;
  1.1384          while (n--) {
  1.1385              srcpixel = *src;
  1.1386 -            srcA = (Uint8)(srcpixel >> 24); srcB = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcR = (Uint8)srcpixel;
  1.1387 +            srcB = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcR = (Uint8)srcpixel; srcA = (Uint8)(srcpixel >> 24);
  1.1388              dstpixel = *dst;
  1.1389 -            dstA = (Uint8)(dstpixel >> 24); dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel;
  1.1390 +            dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; dstA = (Uint8)(dstpixel >> 24);
  1.1391              if (flags & SDL_COPY_MODULATE_COLOR) {
  1.1392                  srcR = (srcR * modulateR) / 255;
  1.1393                  srcG = (srcG * modulateG) / 255;
  1.1394 @@ -6120,6 +6161,7 @@
  1.1395      int srcy, srcx;
  1.1396      int posy, posx;
  1.1397      int incy, incx;
  1.1398 +    (void) modulateA;  /* not all formats use alpha. */
  1.1399  
  1.1400      srcy = 0;
  1.1401      posy = 0;
  1.1402 @@ -6145,9 +6187,9 @@
  1.1403                  src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
  1.1404              }
  1.1405              srcpixel = *src;
  1.1406 -            srcA = (Uint8)(srcpixel >> 24); srcB = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcR = (Uint8)srcpixel;
  1.1407 +            srcB = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcR = (Uint8)srcpixel; srcA = (Uint8)(srcpixel >> 24);
  1.1408              dstpixel = *dst;
  1.1409 -            dstA = (Uint8)(dstpixel >> 24); dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel;
  1.1410 +            dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; dstA = (Uint8)(dstpixel >> 24);
  1.1411              if (flags & SDL_COPY_MODULATE_COLOR) {
  1.1412                  srcR = (srcR * modulateR) / 255;
  1.1413                  srcG = (srcG * modulateG) / 255;
  1.1414 @@ -6199,6 +6241,7 @@
  1.1415      int srcy, srcx;
  1.1416      int posy, posx;
  1.1417      int incy, incx;
  1.1418 +    (void) A;  /* not all formats use alpha. */
  1.1419  
  1.1420      srcy = 0;
  1.1421      posy = 0;
  1.1422 @@ -6224,7 +6267,7 @@
  1.1423                  src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
  1.1424              }
  1.1425              pixel = *src;
  1.1426 -            B = (Uint8)(pixel >> 24); G = (Uint8)(pixel >> 16); R = (Uint8)(pixel >> 8); A = (Uint8)pixel;
  1.1427 +            B = (Uint8)(pixel >> 24); G = (Uint8)(pixel >> 16); R = (Uint8)(pixel >> 8);
  1.1428              pixel = ((Uint32)R << 16) | ((Uint32)G << 8) | B;
  1.1429              *dst = pixel;
  1.1430              posx += incx;
  1.1431 @@ -6371,6 +6414,8 @@
  1.1432      const Uint32 modulateA = info->a;
  1.1433      Uint32 pixel;
  1.1434      Uint32 R, G, B, A;
  1.1435 +    (void) A;  /* not all formats use alpha. */
  1.1436 +    (void) modulateA;  /* not all formats use alpha. */
  1.1437  
  1.1438      while (info->dst_h--) {
  1.1439          Uint32 *src = (Uint32 *)info->src;
  1.1440 @@ -6378,15 +6423,12 @@
  1.1441          int n = info->dst_w;
  1.1442          while (n--) {
  1.1443              pixel = *src;
  1.1444 -            B = (Uint8)(pixel >> 24); G = (Uint8)(pixel >> 16); R = (Uint8)(pixel >> 8); A = (Uint8)pixel;
  1.1445 +            B = (Uint8)(pixel >> 24); G = (Uint8)(pixel >> 16); R = (Uint8)(pixel >> 8);
  1.1446              if (flags & SDL_COPY_MODULATE_COLOR) {
  1.1447                  R = (R * modulateR) / 255;
  1.1448                  G = (G * modulateG) / 255;
  1.1449                  B = (B * modulateB) / 255;
  1.1450              }
  1.1451 -            if (flags & SDL_COPY_MODULATE_ALPHA) {
  1.1452 -                A = (A * modulateA) / 255;
  1.1453 -            }
  1.1454              pixel = ((Uint32)R << 16) | ((Uint32)G << 8) | B;
  1.1455              *dst = pixel;
  1.1456              ++src;
  1.1457 @@ -6409,6 +6451,8 @@
  1.1458      int srcy, srcx;
  1.1459      int posy, posx;
  1.1460      int incy, incx;
  1.1461 +    (void) A;  /* not all formats use alpha. */
  1.1462 +    (void) modulateA;  /* not all formats use alpha. */
  1.1463  
  1.1464      srcy = 0;
  1.1465      posy = 0;
  1.1466 @@ -6434,15 +6478,12 @@
  1.1467                  src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
  1.1468              }
  1.1469              pixel = *src;
  1.1470 -            B = (Uint8)(pixel >> 24); G = (Uint8)(pixel >> 16); R = (Uint8)(pixel >> 8); A = (Uint8)pixel;
  1.1471 +            B = (Uint8)(pixel >> 24); G = (Uint8)(pixel >> 16); R = (Uint8)(pixel >> 8);
  1.1472              if (flags & SDL_COPY_MODULATE_COLOR) {
  1.1473                  R = (R * modulateR) / 255;
  1.1474                  G = (G * modulateG) / 255;
  1.1475                  B = (B * modulateB) / 255;
  1.1476              }
  1.1477 -            if (flags & SDL_COPY_MODULATE_ALPHA) {
  1.1478 -                A = (A * modulateA) / 255;
  1.1479 -            }
  1.1480              pixel = ((Uint32)R << 16) | ((Uint32)G << 8) | B;
  1.1481              *dst = pixel;
  1.1482              posx += incx;
  1.1483 @@ -6464,6 +6505,7 @@
  1.1484      Uint32 srcR, srcG, srcB, srcA;
  1.1485      Uint32 dstpixel;
  1.1486      Uint32 dstR, dstG, dstB, dstA;
  1.1487 +    (void) modulateA;  /* not all formats use alpha. */
  1.1488  
  1.1489      while (info->dst_h--) {
  1.1490          Uint32 *src = (Uint32 *)info->src;
  1.1491 @@ -6532,6 +6574,7 @@
  1.1492      int srcy, srcx;
  1.1493      int posy, posx;
  1.1494      int incy, incx;
  1.1495 +    (void) modulateA;  /* not all formats use alpha. */
  1.1496  
  1.1497      srcy = 0;
  1.1498      posy = 0;
  1.1499 @@ -6611,6 +6654,7 @@
  1.1500      int srcy, srcx;
  1.1501      int posy, posx;
  1.1502      int incy, incx;
  1.1503 +    (void) A;  /* not all formats use alpha. */
  1.1504  
  1.1505      srcy = 0;
  1.1506      posy = 0;
  1.1507 @@ -6636,7 +6680,7 @@
  1.1508                  src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
  1.1509              }
  1.1510              pixel = *src;
  1.1511 -            B = (Uint8)(pixel >> 24); G = (Uint8)(pixel >> 16); R = (Uint8)(pixel >> 8); A = (Uint8)pixel;
  1.1512 +            B = (Uint8)(pixel >> 24); G = (Uint8)(pixel >> 16); R = (Uint8)(pixel >> 8);
  1.1513              pixel = ((Uint32)B << 16) | ((Uint32)G << 8) | R;
  1.1514              *dst = pixel;
  1.1515              posx += incx;
  1.1516 @@ -6783,6 +6827,8 @@
  1.1517      const Uint32 modulateA = info->a;
  1.1518      Uint32 pixel;
  1.1519      Uint32 R, G, B, A;
  1.1520 +    (void) A;  /* not all formats use alpha. */
  1.1521 +    (void) modulateA;  /* not all formats use alpha. */
  1.1522  
  1.1523      while (info->dst_h--) {
  1.1524          Uint32 *src = (Uint32 *)info->src;
  1.1525 @@ -6790,15 +6836,12 @@
  1.1526          int n = info->dst_w;
  1.1527          while (n--) {
  1.1528              pixel = *src;
  1.1529 -            B = (Uint8)(pixel >> 24); G = (Uint8)(pixel >> 16); R = (Uint8)(pixel >> 8); A = (Uint8)pixel;
  1.1530 +            B = (Uint8)(pixel >> 24); G = (Uint8)(pixel >> 16); R = (Uint8)(pixel >> 8);
  1.1531              if (flags & SDL_COPY_MODULATE_COLOR) {
  1.1532                  R = (R * modulateR) / 255;
  1.1533                  G = (G * modulateG) / 255;
  1.1534                  B = (B * modulateB) / 255;
  1.1535              }
  1.1536 -            if (flags & SDL_COPY_MODULATE_ALPHA) {
  1.1537 -                A = (A * modulateA) / 255;
  1.1538 -            }
  1.1539              pixel = ((Uint32)B << 16) | ((Uint32)G << 8) | R;
  1.1540              *dst = pixel;
  1.1541              ++src;
  1.1542 @@ -6821,6 +6864,8 @@
  1.1543      int srcy, srcx;
  1.1544      int posy, posx;
  1.1545      int incy, incx;
  1.1546 +    (void) A;  /* not all formats use alpha. */
  1.1547 +    (void) modulateA;  /* not all formats use alpha. */
  1.1548  
  1.1549      srcy = 0;
  1.1550      posy = 0;
  1.1551 @@ -6846,15 +6891,12 @@
  1.1552                  src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
  1.1553              }
  1.1554              pixel = *src;
  1.1555 -            B = (Uint8)(pixel >> 24); G = (Uint8)(pixel >> 16); R = (Uint8)(pixel >> 8); A = (Uint8)pixel;
  1.1556 +            B = (Uint8)(pixel >> 24); G = (Uint8)(pixel >> 16); R = (Uint8)(pixel >> 8);
  1.1557              if (flags & SDL_COPY_MODULATE_COLOR) {
  1.1558                  R = (R * modulateR) / 255;
  1.1559                  G = (G * modulateG) / 255;
  1.1560                  B = (B * modulateB) / 255;
  1.1561              }
  1.1562 -            if (flags & SDL_COPY_MODULATE_ALPHA) {
  1.1563 -                A = (A * modulateA) / 255;
  1.1564 -            }
  1.1565              pixel = ((Uint32)B << 16) | ((Uint32)G << 8) | R;
  1.1566              *dst = pixel;
  1.1567              posx += incx;
  1.1568 @@ -6876,6 +6918,7 @@
  1.1569      Uint32 srcR, srcG, srcB, srcA;
  1.1570      Uint32 dstpixel;
  1.1571      Uint32 dstR, dstG, dstB, dstA;
  1.1572 +    (void) modulateA;  /* not all formats use alpha. */
  1.1573  
  1.1574      while (info->dst_h--) {
  1.1575          Uint32 *src = (Uint32 *)info->src;
  1.1576 @@ -6944,6 +6987,7 @@
  1.1577      int srcy, srcx;
  1.1578      int posy, posx;
  1.1579      int incy, incx;
  1.1580 +    (void) modulateA;  /* not all formats use alpha. */
  1.1581  
  1.1582      srcy = 0;
  1.1583      posy = 0;
  1.1584 @@ -7023,6 +7067,7 @@
  1.1585      int srcy, srcx;
  1.1586      int posy, posx;
  1.1587      int incy, incx;
  1.1588 +    (void) A;  /* not all formats use alpha. */
  1.1589  
  1.1590      srcy = 0;
  1.1591      posy = 0;
  1.1592 @@ -7075,7 +7120,7 @@
  1.1593              srcpixel = *src;
  1.1594              srcB = (Uint8)(srcpixel >> 24); srcG = (Uint8)(srcpixel >> 16); srcR = (Uint8)(srcpixel >> 8); srcA = (Uint8)srcpixel;
  1.1595              dstpixel = *dst;
  1.1596 -            dstA = (Uint8)(dstpixel >> 24); dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel;
  1.1597 +            dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; dstA = (Uint8)(dstpixel >> 24);
  1.1598              if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
  1.1599                  /* This goes away if we ever use premultiplied alpha */
  1.1600                  if (srcA < 255) {
  1.1601 @@ -7149,7 +7194,7 @@
  1.1602              srcpixel = *src;
  1.1603              srcB = (Uint8)(srcpixel >> 24); srcG = (Uint8)(srcpixel >> 16); srcR = (Uint8)(srcpixel >> 8); srcA = (Uint8)srcpixel;
  1.1604              dstpixel = *dst;
  1.1605 -            dstA = (Uint8)(dstpixel >> 24); dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel;
  1.1606 +            dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; dstA = (Uint8)(dstpixel >> 24);
  1.1607              if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
  1.1608                  /* This goes away if we ever use premultiplied alpha */
  1.1609                  if (srcA < 255) {
  1.1610 @@ -7195,6 +7240,8 @@
  1.1611      const Uint32 modulateA = info->a;
  1.1612      Uint32 pixel;
  1.1613      Uint32 R, G, B, A;
  1.1614 +    (void) A;  /* not all formats use alpha. */
  1.1615 +    (void) modulateA;  /* not all formats use alpha. */
  1.1616  
  1.1617      while (info->dst_h--) {
  1.1618          Uint32 *src = (Uint32 *)info->src;
  1.1619 @@ -7233,6 +7280,8 @@
  1.1620      int srcy, srcx;
  1.1621      int posy, posx;
  1.1622      int incy, incx;
  1.1623 +    (void) A;  /* not all formats use alpha. */
  1.1624 +    (void) modulateA;  /* not all formats use alpha. */
  1.1625  
  1.1626      srcy = 0;
  1.1627      posy = 0;
  1.1628 @@ -7288,6 +7337,7 @@
  1.1629      Uint32 srcR, srcG, srcB, srcA;
  1.1630      Uint32 dstpixel;
  1.1631      Uint32 dstR, dstG, dstB, dstA;
  1.1632 +    (void) modulateA;  /* not all formats use alpha. */
  1.1633  
  1.1634      while (info->dst_h--) {
  1.1635          Uint32 *src = (Uint32 *)info->src;
  1.1636 @@ -7297,7 +7347,7 @@
  1.1637              srcpixel = *src;
  1.1638              srcB = (Uint8)(srcpixel >> 24); srcG = (Uint8)(srcpixel >> 16); srcR = (Uint8)(srcpixel >> 8); srcA = (Uint8)srcpixel;
  1.1639              dstpixel = *dst;
  1.1640 -            dstA = (Uint8)(dstpixel >> 24); dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel;
  1.1641 +            dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; dstA = (Uint8)(dstpixel >> 24);
  1.1642              if (flags & SDL_COPY_MODULATE_COLOR) {
  1.1643                  srcR = (srcR * modulateR) / 255;
  1.1644                  srcG = (srcG * modulateG) / 255;
  1.1645 @@ -7356,6 +7406,7 @@
  1.1646      int srcy, srcx;
  1.1647      int posy, posx;
  1.1648      int incy, incx;
  1.1649 +    (void) modulateA;  /* not all formats use alpha. */
  1.1650  
  1.1651      srcy = 0;
  1.1652      posy = 0;
  1.1653 @@ -7383,7 +7434,7 @@
  1.1654              srcpixel = *src;
  1.1655              srcB = (Uint8)(srcpixel >> 24); srcG = (Uint8)(srcpixel >> 16); srcR = (Uint8)(srcpixel >> 8); srcA = (Uint8)srcpixel;
  1.1656              dstpixel = *dst;
  1.1657 -            dstA = (Uint8)(dstpixel >> 24); dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel;
  1.1658 +            dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; dstA = (Uint8)(dstpixel >> 24);
  1.1659              if (flags & SDL_COPY_MODULATE_COLOR) {
  1.1660                  srcR = (srcR * modulateR) / 255;
  1.1661                  srcG = (srcG * modulateG) / 255;
     2.1 --- a/src/video/sdlgenblit.pl	Thu Mar 20 17:00:33 2014 -0400
     2.2 +++ b/src/video/sdlgenblit.pl	Thu Mar 20 17:55:24 2014 -0400
     2.3 @@ -58,12 +58,22 @@
     2.4      "BGRA8888" => "Uint32",
     2.5  );
     2.6  
     2.7 +my %get_rgba_string_ignore_alpha = (
     2.8 +    "RGB888" => "_R = (Uint8)(_pixel >> 16); _G = (Uint8)(_pixel >> 8); _B = (Uint8)_pixel;",
     2.9 +    "BGR888" => "_B = (Uint8)(_pixel >> 16); _G = (Uint8)(_pixel >> 8); _R = (Uint8)_pixel;",
    2.10 +    "ARGB8888" => "_R = (Uint8)(_pixel >> 16); _G = (Uint8)(_pixel >> 8); _B = (Uint8)_pixel;",
    2.11 +    "RGBA8888" => "_R = (Uint8)(_pixel >> 24); _G = (Uint8)(_pixel >> 16); _B = (Uint8)(_pixel >> 8);",
    2.12 +    "ABGR8888" => "_B = (Uint8)(_pixel >> 16); _G = (Uint8)(_pixel >> 8); _R = (Uint8)_pixel;",
    2.13 +    "BGRA8888" => "_B = (Uint8)(_pixel >> 24); _G = (Uint8)(_pixel >> 16); _R = (Uint8)(_pixel >> 8);",
    2.14 +);
    2.15 +
    2.16  my %get_rgba_string = (
    2.17 -    "RGB888" => "_R = (Uint8)(_pixel >> 16); _G = (Uint8)(_pixel >> 8); _B = (Uint8)_pixel; _A = 0xFF;",
    2.18 -    "BGR888" => "_B = (Uint8)(_pixel >> 16); _G = (Uint8)(_pixel >> 8); _R = (Uint8)_pixel; _A = 0xFF;", "ARGB8888" => "_A = (Uint8)(_pixel >> 24); _R = (Uint8)(_pixel >> 16); _G = (Uint8)(_pixel >> 8); _B = (Uint8)_pixel;",
    2.19 -    "RGBA8888" => "_R = (Uint8)(_pixel >> 24); _G = (Uint8)(_pixel >> 16); _B = (Uint8)(_pixel >> 8); _A = (Uint8)_pixel;",
    2.20 -    "ABGR8888" => "_A = (Uint8)(_pixel >> 24); _B = (Uint8)(_pixel >> 16); _G = (Uint8)(_pixel >> 8); _R = (Uint8)_pixel;",
    2.21 -    "BGRA8888" => "_B = (Uint8)(_pixel >> 24); _G = (Uint8)(_pixel >> 16); _R = (Uint8)(_pixel >> 8); _A = (Uint8)_pixel;",
    2.22 +    "RGB888" => $get_rgba_string_ignore_alpha{"RGB888"} . " _A = 0xFF;",
    2.23 +    "BGR888" => $get_rgba_string_ignore_alpha{"BGR888"} . " _A = 0xFF;",
    2.24 +    "ARGB8888" => $get_rgba_string_ignore_alpha{"ARGB8888"} . " _A = (Uint8)(_pixel >> 24);",
    2.25 +    "RGBA8888" => $get_rgba_string_ignore_alpha{"RGBA8888"} . " _A = (Uint8)_pixel;",
    2.26 +    "ABGR8888" => $get_rgba_string_ignore_alpha{"ABGR8888"} . " _A = (Uint8)(_pixel >> 24);",
    2.27 +    "BGRA8888" => $get_rgba_string_ignore_alpha{"BGRA8888"} . " _A = (Uint8)_pixel;",
    2.28  );
    2.29  
    2.30  my %set_rgba_string = (
    2.31 @@ -160,7 +170,15 @@
    2.32  {
    2.33      my $prefix = shift;
    2.34      my $format = shift;
    2.35 -    my $string = $get_rgba_string{$format};
    2.36 +    my $ignore_alpha = shift;
    2.37 +
    2.38 +    my $string;
    2.39 +    if ($ignore_alpha) {
    2.40 +        $string = $get_rgba_string_ignore_alpha{$format};
    2.41 +    } else {
    2.42 +        $string = $get_rgba_string{$format};
    2.43 +    }
    2.44 +
    2.45      $string =~ s/_/$prefix/g;
    2.46      if ( $prefix ne "" ) {
    2.47          print FILE <<__EOF__;
    2.48 @@ -196,6 +214,7 @@
    2.49      my $blend = shift;
    2.50      my $s = "";
    2.51      my $d = "";
    2.52 +    my $ignore_dst_alpha = 0;
    2.53  
    2.54      # Nice and easy...
    2.55      if ( $src eq $dst && !$modulate && !$blend ) {
    2.56 @@ -205,13 +224,17 @@
    2.57          return;
    2.58      }
    2.59  
    2.60 +    if (not $dst =~ /A/) {
    2.61 +        $ignore_dst_alpha = !$blend;
    2.62 +    }
    2.63 +
    2.64      if ( $blend ) {
    2.65 -        get_rgba("src", $src);
    2.66 -        get_rgba("dst", $dst);
    2.67 +        get_rgba("src", $src, $ignore_dst_alpha);
    2.68 +        get_rgba("dst", $dst, $ignore_dst_alpha);
    2.69          $s = "src";
    2.70          $d = "dst";
    2.71      } else {
    2.72 -        get_rgba("", $src);
    2.73 +        get_rgba("", $src, $ignore_dst_alpha);
    2.74      }
    2.75  
    2.76      if ( $modulate ) {
    2.77 @@ -221,10 +244,14 @@
    2.78                  ${s}G = (${s}G * modulateG) / 255;
    2.79                  ${s}B = (${s}B * modulateB) / 255;
    2.80              }
    2.81 +__EOF__
    2.82 +        if (not $ignore_dst_alpha) {
    2.83 +            print FILE <<__EOF__;
    2.84              if (flags & SDL_COPY_MODULATE_ALPHA) {
    2.85                  ${s}A = (${s}A * modulateA) / 255;
    2.86              }
    2.87  __EOF__
    2.88 +        }
    2.89      }
    2.90      if ( $blend ) {
    2.91          print FILE <<__EOF__;
    2.92 @@ -306,6 +333,23 @@
    2.93      int srcy, srcx;
    2.94      int posy, posx;
    2.95      int incy, incx;
    2.96 +__EOF__
    2.97 +
    2.98 +    # !!! FIXME: the script should just exclude in these cases.
    2.99 +    if ( (!$blend) && ($modulate || $src ne $dst) ) {
   2.100 +        print FILE <<__EOF__;
   2.101 +    (void) A;  /* not all formats use alpha. */
   2.102 +__EOF__
   2.103 +    }
   2.104 +
   2.105 +    # !!! FIXME: the script should just exclude in these cases.
   2.106 +    if ( $modulate ) {
   2.107 +        print FILE <<__EOF__;
   2.108 +    (void) modulateA;  /* not all formats use alpha. */
   2.109 +__EOF__
   2.110 +    }
   2.111 +
   2.112 +    print FILE <<__EOF__;
   2.113  
   2.114      srcy = 0;
   2.115      posy = 0;
   2.116 @@ -343,6 +387,20 @@
   2.117      }
   2.118  __EOF__
   2.119      } else {
   2.120 +        # !!! FIXME: the script should just exclude in these cases.
   2.121 +        if ( (!$blend) && ($modulate || $src ne $dst) ) {
   2.122 +            print FILE <<__EOF__;
   2.123 +    (void) A;  /* not all formats use alpha. */
   2.124 +__EOF__
   2.125 +        }
   2.126 +
   2.127 +        # !!! FIXME: the script should just exclude in these cases.
   2.128 +        if ( $modulate ) {
   2.129 +            print FILE <<__EOF__;
   2.130 +    (void) modulateA;  /* not all formats use alpha. */
   2.131 +__EOF__
   2.132 +        }
   2.133 +
   2.134          print FILE <<__EOF__;
   2.135  
   2.136      while (info->dst_h--) {