src/video/SDL_blit_0.c
changeset 7502 6ff02ff3cf06
parent 6967 adc80d085ddf
child 8093 b43765095a6f
     1.1 --- a/src/video/SDL_blit_0.c	Mon Jul 22 02:51:45 2013 -0700
     1.2 +++ b/src/video/SDL_blit_0.c	Tue Jul 23 08:06:49 2013 -0700
     1.3 @@ -363,7 +363,10 @@
     1.4      SDL_PixelFormat *dstfmt = info->dst_fmt;
     1.5      int dstbpp;
     1.6      int c;
     1.7 -    const int A = info->a;
     1.8 +    Uint32 pixel;
     1.9 +    unsigned sR, sG, sB;
    1.10 +    unsigned dR, dG, dB, dA;
    1.11 +    const unsigned A = info->a;
    1.12  
    1.13      /* Set up some basic variables */
    1.14      dstbpp = dstfmt->BytesPerPixel;
    1.15 @@ -377,15 +380,12 @@
    1.16              }
    1.17              bit = (byte & 0x80) >> 7;
    1.18              if (1) {
    1.19 -                Uint32 pixel;
    1.20 -                unsigned sR, sG, sB;
    1.21 -                unsigned dR, dG, dB;
    1.22                  sR = srcpal[bit].r;
    1.23                  sG = srcpal[bit].g;
    1.24                  sB = srcpal[bit].b;
    1.25 -                DISEMBLE_RGB(dst, dstbpp, dstfmt, pixel, dR, dG, dB);
    1.26 -                ALPHA_BLEND(sR, sG, sB, A, dR, dG, dB);
    1.27 -                ASSEMBLE_RGB(dst, dstbpp, dstfmt, dR, dG, dB);
    1.28 +                DISEMBLE_RGBA(dst, dstbpp, dstfmt, pixel, dR, dG, dB, dA);
    1.29 +                ALPHA_BLEND_RGBA(sR, sG, sB, A, dR, dG, dB, dA);
    1.30 +                ASSEMBLE_RGBA(dst, dstbpp, dstfmt, dR, dG, dB, dA);
    1.31              }
    1.32              byte <<= 1;
    1.33              dst += dstbpp;
    1.34 @@ -409,7 +409,10 @@
    1.35      const SDL_Color *srcpal = srcfmt->palette->colors;
    1.36      int dstbpp;
    1.37      int c;
    1.38 -    const int A = info->a;
    1.39 +    Uint32 pixel;
    1.40 +    unsigned sR, sG, sB;
    1.41 +    unsigned dR, dG, dB, dA;
    1.42 +    const unsigned A = info->a;
    1.43      Uint32 ckey = info->colorkey;
    1.44  
    1.45      /* Set up some basic variables */
    1.46 @@ -424,15 +427,12 @@
    1.47              }
    1.48              bit = (byte & 0x80) >> 7;
    1.49              if (bit != ckey) {
    1.50 -                int sR, sG, sB;
    1.51 -                int dR, dG, dB;
    1.52 -                Uint32 pixel;
    1.53                  sR = srcpal[bit].r;
    1.54                  sG = srcpal[bit].g;
    1.55                  sB = srcpal[bit].b;
    1.56 -                DISEMBLE_RGB(dst, dstbpp, dstfmt, pixel, dR, dG, dB);
    1.57 -                ALPHA_BLEND(sR, sG, sB, A, dR, dG, dB);
    1.58 -                ASSEMBLE_RGB(dst, dstbpp, dstfmt, dR, dG, dB);
    1.59 +                DISEMBLE_RGBA(dst, dstbpp, dstfmt, pixel, dR, dG, dB, dA);
    1.60 +                ALPHA_BLEND_RGBA(sR, sG, sB, A, dR, dG, dB, dA);
    1.61 +                ASSEMBLE_RGBA(dst, dstbpp, dstfmt, dR, dG, dB, dA);
    1.62              }
    1.63              byte <<= 1;
    1.64              dst += dstbpp;