Updated SDL DirectFB backend for DirectFB version 0.9.7
authorSam Lantinga <slouken@libsdl.org>
Thu, 01 Nov 2001 16:21:40 +0000
changeset 219f928da36f0e9
parent 218 91a5db3e930a
child 220 7861d904fb77
Updated SDL DirectFB backend for DirectFB version 0.9.7
configure.in
src/video/directfb/SDL_DirectFB_video.c
     1.1 --- a/configure.in	Fri Oct 26 14:51:22 2001 +0000
     1.2 +++ b/configure.in	Thu Nov 01 16:21:40 2001 +0000
     1.3 @@ -704,7 +704,7 @@
     1.4                  AC_MSG_ERROR([*** pkg-config too old; version 0.5 or better required.])
     1.5              fi
     1.6  
     1.7 -            DIRECTFB_REQUIRED_VERSION=0.9.5
     1.8 +            DIRECTFB_REQUIRED_VERSION=0.9.7
     1.9  
    1.10              if $PKG_CONFIG --atleast-version $DIRECTFB_REQUIRED_VERSION directfb ; then
    1.11                  DIRECTFB_CFLAGS=`$PKG_CONFIG --cflags directfb`
     2.1 --- a/src/video/directfb/SDL_DirectFB_video.c	Fri Oct 26 14:51:22 2001 +0000
     2.2 +++ b/src/video/directfb/SDL_DirectFB_video.c	Thu Nov 01 16:21:40 2001 +0000
     2.3 @@ -601,7 +601,7 @@
     2.4    if (src->flags & SDL_SRCCOLORKEY)
     2.5      {
     2.6        flags |= DSBLIT_SRC_COLORKEY;
     2.7 -      surface->SetSrcColorKey (surface, src->format->colorkey);
     2.8 +      DirectFB_SetHWColorKey (NULL, src, src->format->colorkey);
     2.9      }
    2.10  
    2.11    if (src->flags & SDL_SRCALPHA)
    2.12 @@ -635,8 +635,17 @@
    2.13    return 0;
    2.14  }
    2.15  
    2.16 -static int DirectFB_SetHWColorKey(_THIS, SDL_Surface *surface, Uint32 key)
    2.17 +static int DirectFB_SetHWColorKey(_THIS, SDL_Surface *src, Uint32 key)
    2.18  {
    2.19 +  SDL_PixelFormat  *fmt     = src->format;
    2.20 +  IDirectFBSurface *surface = src->hwdata->surface;
    2.21 +
    2.22 +  /* ugly */
    2.23 +  surface->SetSrcColorKey (surface,
    2.24 +                           (key & fmt->Rmask) >> (fmt->Rshift - fmt->Rloss),
    2.25 +                           (key & fmt->Gmask) >> (fmt->Gshift - fmt->Gloss),
    2.26 +                           (key & fmt->Bmask) << (fmt->Bloss - fmt->Bshift));
    2.27 +
    2.28    return 0;
    2.29  }
    2.30