summaryrefslogtreecommitdiff
path: root/src/render/sdl2softwaregraphics.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-04-30 19:52:52 +0300
committerAndrei Karas <akaras@inbox.ru>2014-04-30 19:52:52 +0300
commit2c13c60e916768fe09bcfff1d0b568a4c5397a99 (patch)
tree9c1fc71c68c2c7f1b2cb55dd53452f9fee120875 /src/render/sdl2softwaregraphics.cpp
parentdc569bbcb4c12a5a400f9e5701e5c1027badadae (diff)
downloadplus-2c13c60e916768fe09bcfff1d0b568a4c5397a99.tar.gz
plus-2c13c60e916768fe09bcfff1d0b568a4c5397a99.tar.bz2
plus-2c13c60e916768fe09bcfff1d0b568a4c5397a99.tar.xz
plus-2c13c60e916768fe09bcfff1d0b568a4c5397a99.zip
Fix code style in render.
Diffstat (limited to 'src/render/sdl2softwaregraphics.cpp')
-rw-r--r--src/render/sdl2softwaregraphics.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/render/sdl2softwaregraphics.cpp b/src/render/sdl2softwaregraphics.cpp
index 54cd010a8..a176b6905 100644
--- a/src/render/sdl2softwaregraphics.cpp
+++ b/src/render/sdl2softwaregraphics.cpp
@@ -1241,8 +1241,9 @@ void SDL2SoftwareGraphics::drawHLine(int x1, int y, int x2)
case 2:
{
uint16_t* q = reinterpret_cast<uint16_t*>(p);
+ const uint16_t pixel1 = static_cast<uint16_t>(pixel);
for (; x1 <= x2; ++x1)
- *(q++) = pixel;
+ *(q++) = pixel1;
break;
}
@@ -1277,7 +1278,7 @@ void SDL2SoftwareGraphics::drawHLine(int x1, int y, int x2)
if (mAlpha)
{
unsigned char a = static_cast<unsigned char>(mColor.a);
- unsigned char a1 = 255 - a;
+ unsigned char a1 = static_cast<unsigned char>(255U - a);
const int b0 = (pixel & 0xff) * a;
const int g0 = (pixel & 0xff00) * a;
const int r0 = (pixel & 0xff0000) * a;
@@ -1406,7 +1407,7 @@ void SDL2SoftwareGraphics::drawVLine(int x, int y1, int y2)
if (mAlpha)
{
unsigned char a = static_cast<unsigned char>(mColor.a);
- unsigned char a1 = 255 - a;
+ unsigned char a1 = static_cast<unsigned char>(255U - a);
const int b0 = (pixel & 0xff) * a;
const int g0 = (pixel & 0xff00) * a;
const int r0 = (pixel & 0xff0000) * a;