diff options
author | Andrei Karas <akaras@inbox.ru> | 2012-07-17 23:26:59 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2012-07-17 23:26:59 +0300 |
commit | 7e0a97d2521b9ce57003176e82a0b5564aa003c2 (patch) | |
tree | 5b2cfe1afe09bea1063f783050c1fb549daee76d /src/resources/sdlimagehelper.cpp | |
parent | f68cbf700a99f2f184715a5b8025bcb4b6525391 (diff) | |
download | manaverse-7e0a97d2521b9ce57003176e82a0b5564aa003c2.tar.gz manaverse-7e0a97d2521b9ce57003176e82a0b5564aa003c2.tar.bz2 manaverse-7e0a97d2521b9ce57003176e82a0b5564aa003c2.tar.xz manaverse-7e0a97d2521b9ce57003176e82a0b5564aa003c2.zip |
Fix more code style and additional warnings.
Diffstat (limited to 'src/resources/sdlimagehelper.cpp')
-rw-r--r-- | src/resources/sdlimagehelper.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
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<uint32_t*>(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<uint8_t>((v << fmt->Aloss) + + (v >> (8 - (fmt->Aloss << 1)))); uint8_t a2 = static_cast<uint8_t>(static_cast<float>(a) * alpha); @@ -241,7 +242,8 @@ Image *SDLImageHelper::_SDLload(SDL_Surface *tmpImage) { unsigned v = ((static_cast<uint32_t*>(tmpImage->pixels))[i] & fmt->Amask) >> fmt->Ashift; - uint8_t a = (v << fmt->Aloss) + (v >> (8 - (fmt->Aloss << 1))); + uint8_t a = static_cast<uint8_t>((v << fmt->Aloss) + + (v >> (8 - (fmt->Aloss << 1)))); if (a != 255) hasAlpha = true; |