From 7e0a97d2521b9ce57003176e82a0b5564aa003c2 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Tue, 17 Jul 2012 23:26:59 +0300 Subject: Fix more code style and additional warnings. --- src/resources/sdlimagehelper.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/resources/sdlimagehelper.cpp') diff --git a/src/resources/sdlimagehelper.cpp b/src/resources/sdlimagehelper.cpp index 78094b211..5463abfeb 100644 --- a/src/resources/sdlimagehelper.cpp +++ b/src/resources/sdlimagehelper.cpp @@ -154,7 +154,8 @@ Image *SDLImageHelper::createTextSurface(SDL_Surface *tmpImage, float alpha) uint32_t c = (static_cast(tmpImage->pixels))[i]; unsigned v = (c & fmt->Amask) >> fmt->Ashift; - uint8_t a = (v << fmt->Aloss) + (v >> (8 - (fmt->Aloss << 1))); + uint8_t a = static_cast((v << fmt->Aloss) + + (v >> (8 - (fmt->Aloss << 1)))); uint8_t a2 = static_cast(static_cast(a) * alpha); @@ -241,7 +242,8 @@ Image *SDLImageHelper::_SDLload(SDL_Surface *tmpImage) { unsigned v = ((static_cast(tmpImage->pixels))[i] & fmt->Amask) >> fmt->Ashift; - uint8_t a = (v << fmt->Aloss) + (v >> (8 - (fmt->Aloss << 1))); + uint8_t a = static_cast((v << fmt->Aloss) + + (v >> (8 - (fmt->Aloss << 1)))); if (a != 255) hasAlpha = true; -- cgit v1.2.3-70-g09d2