From 2c13c60e916768fe09bcfff1d0b568a4c5397a99 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Wed, 30 Apr 2014 19:52:52 +0300 Subject: Fix code style in render. --- src/render/sdlgraphics.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/render/sdlgraphics.cpp') diff --git a/src/render/sdlgraphics.cpp b/src/render/sdlgraphics.cpp index cbd3f0689..ac304b7ab 100644 --- a/src/render/sdlgraphics.cpp +++ b/src/render/sdlgraphics.cpp @@ -1238,8 +1238,9 @@ void SDLGraphics::drawHLine(int x1, int y, int x2) case 2: { uint16_t* q = reinterpret_cast(p); + const uint16_t pixel1 = static_cast(pixel); for (; x1 <= x2; ++x1) - *(q++) = pixel; + *(q++) = pixel1; break; } @@ -1274,7 +1275,7 @@ void SDLGraphics::drawHLine(int x1, int y, int x2) if (mAlpha) { unsigned char a = static_cast(mColor.a); - unsigned char a1 = 255 - a; + unsigned char a1 = static_cast(255U - a); const int b0 = (pixel & 0xff) * a; const int g0 = (pixel & 0xff00) * a; const int r0 = (pixel & 0xff0000) * a; @@ -1403,7 +1404,7 @@ void SDLGraphics::drawVLine(int x, int y1, int y2) if (mAlpha) { unsigned char a = static_cast(mColor.a); - unsigned char a1 = 255 - a; + unsigned char a1 = static_cast(255U - a); const int b0 = (pixel & 0xff) * a; const int g0 = (pixel & 0xff00) * a; const int r0 = (pixel & 0xff0000) * a; -- cgit v1.2.3-60-g2f50