Skip to content

Commit

Permalink
Implemented SDL_FillRect().
Browse files Browse the repository at this point in the history
  • Loading branch information
icculus committed Apr 11, 2013
1 parent 9dca5e6 commit 0f5863c
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
15 changes: 14 additions & 1 deletion src/SDL12_compat.c
Expand Up @@ -38,7 +38,6 @@
// !!! IMPLEMENT_ME SDL_ConvertSurface
// !!! IMPLEMENT_ME SDL_CreateThread
// !!! IMPLEMENT_ME SDL_EventState
// !!! IMPLEMENT_ME SDL_FillRect
// !!! IMPLEMENT_ME SDL_GL_GetAttribute
// !!! IMPLEMENT_ME SDL_GL_Lock
// !!! IMPLEMENT_ME SDL_GL_SetAttribute
Expand Down Expand Up @@ -1038,6 +1037,20 @@ SDL_SetClipRect(SDL12_Surface *surface12, const SDL_Rect *rect)
return retval;
}

int
SDL_FillRect(SDL12_Surface *dst, SDL_Rect *dstrect, Uint32 color)
{
const SDL_Rect orig_dstrect = *dstrect;
const int retval = SDL20_FillRect(dst->hwdata, orig_dstrect, color);
if (retval != -1)
{
if (dstrect) /* 1.2 stores the clip intersection in dstrect */
SDL20_IntersectRect(orig_dstrect, &dst->clip_rect, dstrect);
}
return retval;
}


static SDL_PixelFormat *
PixelFormat12to20(SDL_PixelFormat *format20, SDL_Palette *palette20, SDL12_PixelFormat *format12)
{
Expand Down
2 changes: 2 additions & 0 deletions src/SDL20_syms.h
Expand Up @@ -47,6 +47,8 @@ SDL20_SYM_PASSTHROUGH(int,GL_LoadLibrary,(const char *a),(a),return)
SDL20_SYM_PASSTHROUGH(void *,GL_GetProcAddress,(const char *a),(a),return)
SDL20_SYM(void,GetClipRect,(SDL_Surface *a, SDL_Rect *b),(a,b),)
SDL20_SYM(SDL_bool,SetClipRect,(SDL_Surface *a, const SDL_Rect *b),(a,b),return)
SDL20_SYM(int,FillRect,(SDL_Surface *a,const SDL_Rect *b,Uint32 c),(a,b,c),return)
SDL20_SYM(SDL_bool,IntersectRect,(const SDL_Rect *a,const SDL_Rect *b,SDL_Rect *c),(a,b,c),return)

SDL20_SYM_PASSTHROUGH(int,ShowCursor,(int a),(a),return)
SDL20_SYM(SDL_Cursor *,CreateCursor,(const Uint8 *a,const Uint8 *b,int c,int d,int e,int f),(a,b,c,d,e,f),return)
Expand Down

0 comments on commit 0f5863c

Please sign in to comment.