src/video/SDL_RLEaccel.c
changeset 9761 fd7fe355f173
parent 9619 b94b6d0bff0f
child 10000 acd714e378f4
     1.1 --- a/src/video/SDL_RLEaccel.c	Fri Jun 19 22:12:47 2015 -0700
     1.2 +++ b/src/video/SDL_RLEaccel.c	Fri Jun 19 23:12:13 2015 -0700
     1.3 @@ -374,6 +374,18 @@
     1.4      } while(0)
     1.5  
     1.6  /*
     1.7 + * Set a pixel value using the given format, except that the alpha value is
     1.8 + * placed in the top byte. This is the format used for RLE with alpha.
     1.9 + */
    1.10 +#define RLEPIXEL_FROM_RGBA(Pixel, fmt, r, g, b, a)                      \
    1.11 +{                                                                       \
    1.12 +    Pixel = ((r>>fmt->Rloss)<<fmt->Rshift)|                             \
    1.13 +        ((g>>fmt->Gloss)<<fmt->Gshift)|                                 \
    1.14 +        ((b>>fmt->Bloss)<<fmt->Bshift)|                                 \
    1.15 +        (a<<24);                                                        \
    1.16 +}
    1.17 +
    1.18 +/*
    1.19   * This takes care of the case when the surface is clipped on the left and/or
    1.20   * right. Top clipping has already been taken care of.
    1.21   */
    1.22 @@ -982,7 +994,7 @@
    1.23      for (i = 0; i < n; i++) {
    1.24          unsigned r, g, b, a;
    1.25          RGBA_FROM_8888(*src, sfmt, r, g, b, a);
    1.26 -        PIXEL_FROM_RGBA(*d, dfmt, r, g, b, a);
    1.27 +        RLEPIXEL_FROM_RGBA(*d, dfmt, r, g, b, a);
    1.28          d++;
    1.29          src++;
    1.30      }