diff options
author | Andrei Karas <akaras@inbox.ru> | 2016-02-07 16:18:13 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2016-02-07 16:18:13 +0300 |
commit | 9fe21fcd8883b37bdc30224822e6e42afb35b8f0 (patch) | |
tree | 798117abd4dc7e610997d59d530a96ddc1509f53 /src/render/surfacegraphics.cpp | |
parent | 4429cb14e9e187edef27aba692a4266733f79c17 (diff) | |
download | manaplus-9fe21fcd8883b37bdc30224822e6e42afb35b8f0.tar.gz manaplus-9fe21fcd8883b37bdc30224822e6e42afb35b8f0.tar.bz2 manaplus-9fe21fcd8883b37bdc30224822e6e42afb35b8f0.tar.xz manaplus-9fe21fcd8883b37bdc30224822e6e42afb35b8f0.zip |
Replace most static_cast<Type> to shorter versions from defines.
Diffstat (limited to 'src/render/surfacegraphics.cpp')
-rw-r--r-- | src/render/surfacegraphics.cpp | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/src/render/surfacegraphics.cpp b/src/render/surfacegraphics.cpp index bc730920b..d3083dd5c 100644 --- a/src/render/surfacegraphics.cpp +++ b/src/render/surfacegraphics.cpp @@ -51,12 +51,12 @@ void SurfaceGraphics::drawImage(const Image *restrict const image, const SDL_Rect &imageRect = image->mBounds; SDL_Rect dstRect; SDL_Rect srcRect; - dstRect.x = static_cast<int16_t>(dstX); - dstRect.y = static_cast<int16_t>(dstY); - srcRect.x = static_cast<int16_t>(imageRect.x); - srcRect.y = static_cast<int16_t>(imageRect.y); - srcRect.w = static_cast<uint16_t>(imageRect.w); - srcRect.h = static_cast<uint16_t>(imageRect.h); + dstRect.x = CAST_S16(dstX); + dstRect.y = CAST_S16(dstY); + srcRect.x = CAST_S16(imageRect.x); + srcRect.y = CAST_S16(imageRect.y); + srcRect.w = CAST_U16(imageRect.w); + srcRect.h = CAST_U16(imageRect.h); #ifdef USE_SDL2 SDL_BlitSurface(image->mSDLSurface, &srcRect, mTarget, &dstRect); @@ -84,12 +84,12 @@ void SurfaceGraphics::copyImage(const Image *restrict const image, const SDL_Rect &imageRect = image->mBounds; SDL_Rect dstRect; SDL_Rect srcRect; - dstRect.x = static_cast<int16_t>(dstX); - dstRect.y = static_cast<int16_t>(dstY); - srcRect.x = static_cast<int16_t>(imageRect.x); - srcRect.y = static_cast<int16_t>(imageRect.y); - srcRect.w = static_cast<uint16_t>(imageRect.w); - srcRect.h = static_cast<uint16_t>(imageRect.h); + dstRect.x = CAST_S16(dstX); + dstRect.y = CAST_S16(dstY); + srcRect.x = CAST_S16(imageRect.x); + srcRect.y = CAST_S16(imageRect.y); + srcRect.w = CAST_U16(imageRect.w); + srcRect.h = CAST_U16(imageRect.h); #ifdef USE_SDL2 // probably need change some flags @@ -111,12 +111,12 @@ void SurfaceGraphics::drawImageCached(const Image *restrict const image, SDL_Rect dstRect; SDL_Rect srcRect; - dstRect.x = static_cast<int16_t>(x); - dstRect.y = static_cast<int16_t>(y); - srcRect.x = static_cast<int16_t>(rect.x); - srcRect.y = static_cast<int16_t>(rect.y); - srcRect.w = static_cast<uint16_t>(rect.w); - srcRect.h = static_cast<uint16_t>(rect.h); + dstRect.x = CAST_S16(x); + dstRect.y = CAST_S16(y); + srcRect.x = CAST_S16(rect.x); + srcRect.y = CAST_S16(rect.y); + srcRect.w = CAST_U16(rect.w); + srcRect.h = CAST_U16(rect.h); #ifdef USE_SDL2 SDL_BlitSurface(image->mSDLSurface, &srcRect, mTarget, &dstRect); |