src/video/directfb/SDL_DirectFB_video.c
changeset 219 f928da36f0e9
parent 167 cb384ef627f6
child 252 e8157fcb3114
     1.1 --- a/src/video/directfb/SDL_DirectFB_video.c	Fri Oct 26 14:51:22 2001 +0000
     1.2 +++ b/src/video/directfb/SDL_DirectFB_video.c	Thu Nov 01 16:21:40 2001 +0000
     1.3 @@ -601,7 +601,7 @@
     1.4    if (src->flags & SDL_SRCCOLORKEY)
     1.5      {
     1.6        flags |= DSBLIT_SRC_COLORKEY;
     1.7 -      surface->SetSrcColorKey (surface, src->format->colorkey);
     1.8 +      DirectFB_SetHWColorKey (NULL, src, src->format->colorkey);
     1.9      }
    1.10  
    1.11    if (src->flags & SDL_SRCALPHA)
    1.12 @@ -635,8 +635,17 @@
    1.13    return 0;
    1.14  }
    1.15  
    1.16 -static int DirectFB_SetHWColorKey(_THIS, SDL_Surface *surface, Uint32 key)
    1.17 +static int DirectFB_SetHWColorKey(_THIS, SDL_Surface *src, Uint32 key)
    1.18  {
    1.19 +  SDL_PixelFormat  *fmt     = src->format;
    1.20 +  IDirectFBSurface *surface = src->hwdata->surface;
    1.21 +
    1.22 +  /* ugly */
    1.23 +  surface->SetSrcColorKey (surface,
    1.24 +                           (key & fmt->Rmask) >> (fmt->Rshift - fmt->Rloss),
    1.25 +                           (key & fmt->Gmask) >> (fmt->Gshift - fmt->Gloss),
    1.26 +                           (key & fmt->Bmask) << (fmt->Bloss - fmt->Bshift));
    1.27 +
    1.28    return 0;
    1.29  }
    1.30