From 9a637d0c0f9c38fcb92d430cab3cba706f2c4731 Mon Sep 17 00:00:00 2001 From: Misa Date: Fri, 3 Sep 2021 15:34:45 -0700 Subject: [PATCH] Clean up style of drawcoloredtile All unmutated parameters have been made const. Declarations and code are no longer mixed. Spacing has been made consistent. --- desktop_version/src/Graphics.cpp | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/desktop_version/src/Graphics.cpp b/desktop_version/src/Graphics.cpp index ba1713c0..c2301667 100644 --- a/desktop_version/src/Graphics.cpp +++ b/desktop_version/src/Graphics.cpp @@ -1614,17 +1614,24 @@ void Graphics::drawmenu( int cr, int cg, int cb, bool levelmenu /*= false*/ ) } -void Graphics::drawcoloredtile( int x, int y, int t, int r, int g, int b ) -{ +void Graphics::drawcoloredtile( + const int x, + const int y, + const int t, + const int r, + const int g, + const int b +) { + SDL_Rect rect; + if (!INBOUNDS_VEC(t, tiles)) { return; } - setcolreal(getRGB(r,g,b)); - SDL_Rect rect; - setRect(rect,x,y,tiles_rect.w,tiles_rect.h); - BlitSurfaceColoured(tiles[t],NULL, backBuffer, &rect, ct ); + setcolreal(getRGB(r, g, b)); + setRect(rect, x, y, tiles_rect.w, tiles_rect.h); + BlitSurfaceColoured(tiles[t], NULL, backBuffer, &rect, ct); }