1
0
Fork 0
mirror of https://github.com/TerryCavanagh/VVVVVV.git synced 2024-12-23 18:19:43 +01:00

Combine declaration/initialization of color in two FillRect()s

Just a small simplification, so it's both declared and initialized on
the same line.
This commit is contained in:
Misa 2021-02-25 15:36:02 -08:00 committed by Ethan Lee
parent e641063d68
commit e545c89b5e

View file

@ -353,8 +353,7 @@ SDL_Surface* ApplyFilter( SDL_Surface* _src )
void FillRect( SDL_Surface* _surface, const int _x, const int _y, const int _w, const int _h, const int r, int g, int b ) void FillRect( SDL_Surface* _surface, const int _x, const int _y, const int _w, const int _h, const int r, int g, int b )
{ {
SDL_Rect rect = {Sint16(_x),Sint16(_y),Sint16(_w),Sint16(_h)}; SDL_Rect rect = {Sint16(_x),Sint16(_y),Sint16(_w),Sint16(_h)};
Uint32 color; Uint32 color = SDL_MapRGB(_surface->format, r, g, b);
color = SDL_MapRGB(_surface->format, r, g, b);
SDL_FillRect(_surface, &rect, color); SDL_FillRect(_surface, &rect, color);
} }
@ -377,8 +376,7 @@ void FillRect( SDL_Surface* _surface, const int x, const int y, const int w, con
void FillRect( SDL_Surface* _surface, SDL_Rect& _rect, const int r, int g, int b ) void FillRect( SDL_Surface* _surface, SDL_Rect& _rect, const int r, int g, int b )
{ {
Uint32 color; Uint32 color = SDL_MapRGB(_surface->format, r, g, b);
color = SDL_MapRGB(_surface->format, r, g, b);
SDL_FillRect(_surface, &_rect, color); SDL_FillRect(_surface, &_rect, color);
} }