src/video/SDL_video.c
changeset 2257 340942cfda48
parent 2245 989fb86ad1ec
child 2266 e61ad15a205f
     1.1 --- a/src/video/SDL_video.c	Thu Aug 16 22:56:18 2007 +0000
     1.2 +++ b/src/video/SDL_video.c	Fri Aug 17 00:54:53 2007 +0000
     1.3 @@ -1595,7 +1595,7 @@
     1.4                                surface->pitch);
     1.5          }
     1.6      } else {
     1.7 -        Uint8 alpha;
     1.8 +        Uint32 cmod;
     1.9          SDL_Rect bounds;
    1.10          SDL_Surface dst;
    1.11  
    1.12 @@ -1648,6 +1648,7 @@
    1.13          }
    1.14  
    1.15          /* Copy over the alpha channel */
    1.16 +        cmod = surface->map->cmod;
    1.17          if (surface_flags & SDL_SRCALPHA) {
    1.18              if (fmt->Amask) {
    1.19                  surface->flags &= ~SDL_SRCALPHA;
    1.20 @@ -1655,7 +1656,6 @@
    1.21                  /* FIXME: Need to make sure the texture has an alpha channel
    1.22                   *        and copy 'alpha' into the texture alpha channel.
    1.23                   */
    1.24 -                alpha = surface->format->alpha;
    1.25                  SDL_SetAlpha(surface, 0, 0);
    1.26              }
    1.27          }
    1.28 @@ -1673,7 +1673,7 @@
    1.29              if (fmt->Amask) {
    1.30                  surface->flags |= SDL_SRCALPHA;
    1.31              } else {
    1.32 -                SDL_SetAlpha(surface, aflags, alpha);
    1.33 +                SDL_SetAlpha(surface, aflags, (cmod >> 24));
    1.34              }
    1.35          }
    1.36