diff src/video/SDL_video.c @ 2257:340942cfda48

Moved the colorkey and per-surface alpha into the blit info, in preparation for support for general color channel modulation. Removed and consolidated some data in the blit info.
author Sam Lantinga <slouken@libsdl.org>
date Fri, 17 Aug 2007 00:54:53 +0000
parents 989fb86ad1ec
children e61ad15a205f
line wrap: on
line diff
--- a/src/video/SDL_video.c	Thu Aug 16 22:56:18 2007 +0000
+++ b/src/video/SDL_video.c	Fri Aug 17 00:54:53 2007 +0000
@@ -1595,7 +1595,7 @@
                               surface->pitch);
         }
     } else {
-        Uint8 alpha;
+        Uint32 cmod;
         SDL_Rect bounds;
         SDL_Surface dst;
 
@@ -1648,6 +1648,7 @@
         }
 
         /* Copy over the alpha channel */
+        cmod = surface->map->cmod;
         if (surface_flags & SDL_SRCALPHA) {
             if (fmt->Amask) {
                 surface->flags &= ~SDL_SRCALPHA;
@@ -1655,7 +1656,6 @@
                 /* FIXME: Need to make sure the texture has an alpha channel
                  *        and copy 'alpha' into the texture alpha channel.
                  */
-                alpha = surface->format->alpha;
                 SDL_SetAlpha(surface, 0, 0);
             }
         }
@@ -1673,7 +1673,7 @@
             if (fmt->Amask) {
                 surface->flags |= SDL_SRCALPHA;
             } else {
-                SDL_SetAlpha(surface, aflags, alpha);
+                SDL_SetAlpha(surface, aflags, (cmod >> 24));
             }
         }