src/video/SDL_blit_slow.c
changeset 10400 3f0d2277232c
parent 9998 f67cf37e9cd4
child 10432 eeb3847d81a6
equal deleted inserted replaced
10399:8e4a030053c2 10400:3f0d2277232c
    44     int incy, incx;
    44     int incy, incx;
    45     SDL_PixelFormat *src_fmt = info->src_fmt;
    45     SDL_PixelFormat *src_fmt = info->src_fmt;
    46     SDL_PixelFormat *dst_fmt = info->dst_fmt;
    46     SDL_PixelFormat *dst_fmt = info->dst_fmt;
    47     int srcbpp = src_fmt->BytesPerPixel;
    47     int srcbpp = src_fmt->BytesPerPixel;
    48     int dstbpp = dst_fmt->BytesPerPixel;
    48     int dstbpp = dst_fmt->BytesPerPixel;
       
    49     Uint32 rgbmask = ~src_fmt->Amask;
       
    50     Uint32 ckey = info->colorkey & rgbmask;
    49 
    51 
    50     srcy = 0;
    52     srcy = 0;
    51     posy = 0;
    53     posy = 0;
    52     incy = (info->src_h << 16) / info->dst_h;
    54     incy = (info->src_h << 16) / info->dst_h;
    53     incx = (info->src_w << 16) / info->dst_w;
    55     incx = (info->src_w << 16) / info->dst_w;
    83                 /* srcpixel isn't set for 24 bpp */
    85                 /* srcpixel isn't set for 24 bpp */
    84                 if (srcbpp == 3) {
    86                 if (srcbpp == 3) {
    85                     srcpixel = (srcR << src_fmt->Rshift) |
    87                     srcpixel = (srcR << src_fmt->Rshift) |
    86                         (srcG << src_fmt->Gshift) | (srcB << src_fmt->Bshift);
    88                         (srcG << src_fmt->Gshift) | (srcB << src_fmt->Bshift);
    87                 }
    89                 }
    88                 if (srcpixel == info->colorkey) {
    90                 if ((srcpixel & rgbmask) == ckey) {
    89                     posx += incx;
    91                     posx += incx;
    90                     dst += dstbpp;
    92                     dst += dstbpp;
    91                     continue;
    93                     continue;
    92                 }
    94                 }
    93             }
    95             }