summaryrefslogtreecommitdiff
path: root/src/resources/sdlimagehelper.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-05-08 22:47:30 +0300
committerAndrei Karas <akaras@inbox.ru>2014-05-08 22:47:30 +0300
commit64aabf79b5a10bdf8192bb1048804a3e36730905 (patch)
treeab7f8a82228acd617ec178f04d7ca6bb09f727de /src/resources/sdlimagehelper.cpp
parent3f9d0c023f3d84de0c68dbf9f7c29aa1b0abb9c9 (diff)
downloadmanaverse-64aabf79b5a10bdf8192bb1048804a3e36730905.tar.gz
manaverse-64aabf79b5a10bdf8192bb1048804a3e36730905.tar.bz2
manaverse-64aabf79b5a10bdf8192bb1048804a3e36730905.tar.xz
manaverse-64aabf79b5a10bdf8192bb1048804a3e36730905.zip
Fix code style in resources.
Diffstat (limited to 'src/resources/sdlimagehelper.cpp')
-rw-r--r--src/resources/sdlimagehelper.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/resources/sdlimagehelper.cpp b/src/resources/sdlimagehelper.cpp
index 7b9aeda5e..0858a9908 100644
--- a/src/resources/sdlimagehelper.cpp
+++ b/src/resources/sdlimagehelper.cpp
@@ -118,7 +118,7 @@ Image *SDLImageHelper::createTextSurface(SDL_Surface *const tmpImage,
return nullptr;
bool hasAlpha = false;
- const int sz = tmpImage->w * tmpImage->h;
+ const size_t sz = tmpImage->w * tmpImage->h;
// The alpha channel to be filled with alpha values
uint8_t *alphaChannel = new uint8_t[sz];
@@ -126,7 +126,7 @@ Image *SDLImageHelper::createTextSurface(SDL_Surface *const tmpImage,
const SDL_PixelFormat *const fmt = tmpImage->format;
if (fmt->Amask)
{
- for (int i = 0; i < sz; ++ i)
+ for (size_t i = 0; i < sz; ++ i)
{
uint32_t c = (static_cast<uint32_t*>(tmpImage->pixels))[i];
@@ -202,7 +202,7 @@ Image *SDLImageHelper::_SDLload(SDL_Surface *tmpImage) const
converted = true;
}
- const int sz = tmpImage->w * tmpImage->h;
+ const size_t sz = tmpImage->w * tmpImage->h;
// The alpha channel to be filled with alpha values
uint8_t *alphaChannel = new uint8_t[sz];
@@ -217,7 +217,7 @@ Image *SDLImageHelper::_SDLload(SDL_Surface *tmpImage) const
const uint8_t ashift = fmt->Ashift;
const uint8_t aloss = fmt->Aloss;
const uint32_t *pixels = static_cast<uint32_t*>(tmpImage->pixels);
- for (int i = 0; i < sz; ++ i)
+ for (size_t i = 0; i < sz; ++ i)
{
const unsigned v = (pixels[i] & amask) >> ashift;
const uint8_t a = static_cast<const uint8_t>((v << aloss)