mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2024-11-13 22:49:42 +01:00
Fix two versions of FillRect() unnecessarily creating SDL_Rects
When you pass NULL in for the SDL_Rect* parameter to SDL_FillRect(), SDL will automatically fill the entire surface with that color. There's no need for us to create the SDL_Rect ourselves.
This commit is contained in:
parent
163b85d206
commit
e641063d68
1 changed files with 3 additions and 6 deletions
|
@ -360,16 +360,13 @@ void FillRect( SDL_Surface* _surface, const int _x, const int _y, const int _w,
|
||||||
|
|
||||||
void FillRect( SDL_Surface* _surface, const int r, int g, int b )
|
void FillRect( SDL_Surface* _surface, const int r, int g, int b )
|
||||||
{
|
{
|
||||||
SDL_Rect rect = {0,0,Uint16(_surface->w) ,Uint16(_surface->h) };
|
Uint32 color = SDL_MapRGB(_surface->format, r, g, b);
|
||||||
Uint32 color;
|
SDL_FillRect(_surface, NULL, color);
|
||||||
color = SDL_MapRGB(_surface->format, r, g, b);
|
|
||||||
SDL_FillRect(_surface, &rect, color);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void FillRect( SDL_Surface* _surface, const int color )
|
void FillRect( SDL_Surface* _surface, const int color )
|
||||||
{
|
{
|
||||||
SDL_Rect rect = {0,0,Uint16(_surface->w) ,Uint16(_surface->h) };
|
SDL_FillRect(_surface, NULL, color);
|
||||||
SDL_FillRect(_surface, &rect, color);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void FillRect( SDL_Surface* _surface, const int x, const int y, const int w, const int h, int rgba )
|
void FillRect( SDL_Surface* _surface, const int x, const int y, const int w, const int h, int rgba )
|
||||||
|
|
Loading…
Reference in a new issue