src/SDL12_compat.c
changeset 25 2dfd8573dba0
parent 24 13ff8808236a
child 26 34c2ae82780a
     1.1 --- a/src/SDL12_compat.c	Thu Apr 11 00:20:35 2013 -0400
     1.2 +++ b/src/SDL12_compat.c	Thu Apr 11 00:37:09 2013 -0400
     1.3 @@ -38,7 +38,6 @@
     1.4  // !!! IMPLEMENT_ME SDL_ConvertSurface
     1.5  // !!! IMPLEMENT_ME SDL_CreateThread
     1.6  // !!! IMPLEMENT_ME SDL_EventState
     1.7 -// !!! IMPLEMENT_ME SDL_FillRect
     1.8  // !!! IMPLEMENT_ME SDL_GL_GetAttribute
     1.9  // !!! IMPLEMENT_ME SDL_GL_Lock
    1.10  // !!! IMPLEMENT_ME SDL_GL_SetAttribute
    1.11 @@ -1038,6 +1037,20 @@
    1.12      return retval;
    1.13  }
    1.14  
    1.15 +int
    1.16 +SDL_FillRect(SDL12_Surface *dst, SDL_Rect *dstrect, Uint32 color)
    1.17 +{
    1.18 +    const SDL_Rect orig_dstrect = *dstrect;
    1.19 +    const int retval = SDL20_FillRect(dst->hwdata, orig_dstrect, color);
    1.20 +    if (retval != -1)
    1.21 +    {
    1.22 +        if (dstrect)  /* 1.2 stores the clip intersection in dstrect */
    1.23 +            SDL20_IntersectRect(orig_dstrect, &dst->clip_rect, dstrect);
    1.24 +    }
    1.25 +    return retval;
    1.26 +}
    1.27 +
    1.28 +
    1.29  static SDL_PixelFormat *
    1.30  PixelFormat12to20(SDL_PixelFormat *format20, SDL_Palette *palette20, SDL12_PixelFormat *format12)
    1.31  {