diff options
author | Andrei Karas <akaras@inbox.ru> | 2012-06-17 20:13:48 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2012-06-17 20:13:48 +0300 |
commit | c2efedab22275302f0a10cc197424d345a021d18 (patch) | |
tree | 7488abbb3655451a3f6a1621e0708f72011af5f6 /src/resources/image.cpp | |
parent | 79aba82be3de5b6b571e2f59f7a34ded4b03160f (diff) | |
download | plus-c2efedab22275302f0a10cc197424d345a021d18.tar.gz plus-c2efedab22275302f0a10cc197424d345a021d18.tar.bz2 plus-c2efedab22275302f0a10cc197424d345a021d18.tar.xz plus-c2efedab22275302f0a10cc197424d345a021d18.zip |
Replace SDL int types to C++ types.
Diffstat (limited to 'src/resources/image.cpp')
-rw-r--r-- | src/resources/image.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/resources/image.cpp b/src/resources/image.cpp index 3c5a2a97e..a4be43e4e 100644 --- a/src/resources/image.cpp +++ b/src/resources/image.cpp @@ -46,7 +46,7 @@ #include "debug.h" -Image::Image(SDL_Surface *image, bool hasAlphaChannel0, Uint8 *alphaChannel): +Image::Image(SDL_Surface *image, bool hasAlphaChannel0, uint8_t *alphaChannel): mAlpha(1.0f), mHasAlphaChannel(hasAlphaChannel0), mSDLSurface(image), @@ -67,8 +67,8 @@ Image::Image(SDL_Surface *image, bool hasAlphaChannel0, Uint8 *alphaChannel): if (mSDLSurface) { - mBounds.w = static_cast<Uint16>(mSDLSurface->w); - mBounds.h = static_cast<Uint16>(mSDLSurface->h); + mBounds.w = static_cast<uint16_t>(mSDLSurface->w); + mBounds.h = static_cast<uint16_t>(mSDLSurface->h); mLoaded = true; } @@ -97,8 +97,8 @@ Image::Image(GLuint glimage, int width, int height, { mBounds.x = 0; mBounds.y = 0; - mBounds.w = static_cast<Uint16>(width); - mBounds.h = static_cast<Uint16>(height); + mBounds.w = static_cast<uint16_t>(width); + mBounds.h = static_cast<uint16_t>(height); if (mGLImage) { @@ -265,16 +265,16 @@ void Image::setAlpha(float alpha) for (int i = i1; i <= i2; i++) { // Only change the pixel if it was visible at load time... - Uint8 sourceAlpha = mAlphaChannel[i]; + uint8_t sourceAlpha = mAlphaChannel[i]; if (sourceAlpha > 0) { - Uint8 a = static_cast<Uint8>( + uint8_t a = static_cast<uint8_t>( static_cast<float>(sourceAlpha) * mAlpha); - Uint32 c = (static_cast<Uint32*>(mSDLSurface->pixels))[i]; + uint32_t c = (static_cast<uint32_t*>(mSDLSurface->pixels))[i]; c &= ~fmt->Amask; c |= ((a >> fmt->Aloss) << fmt->Ashift & fmt->Amask); - (static_cast<Uint32*>(mSDLSurface->pixels))[i] = c; + (static_cast<uint32_t*>(mSDLSurface->pixels))[i] = c; } } |