From c2efedab22275302f0a10cc197424d345a021d18 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sun, 17 Jun 2012 20:13:48 +0300 Subject: Replace SDL int types to C++ types. --- src/resources/image.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'src/resources/image.cpp') 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(mSDLSurface->w); - mBounds.h = static_cast(mSDLSurface->h); + mBounds.w = static_cast(mSDLSurface->w); + mBounds.h = static_cast(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(width); - mBounds.h = static_cast(height); + mBounds.w = static_cast(width); + mBounds.h = static_cast(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_t a = static_cast( static_cast(sourceAlpha) * mAlpha); - Uint32 c = (static_cast(mSDLSurface->pixels))[i]; + uint32_t c = (static_cast(mSDLSurface->pixels))[i]; c &= ~fmt->Amask; c |= ((a >> fmt->Aloss) << fmt->Ashift & fmt->Amask); - (static_cast(mSDLSurface->pixels))[i] = c; + (static_cast(mSDLSurface->pixels))[i] = c; } } -- cgit v1.2.3-60-g2f50