diff options
author | Andrei Karas <akaras@inbox.ru> | 2013-12-29 21:22:33 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2013-12-29 21:22:33 +0300 |
commit | f94a6551b8d140e272ac1c46bce1ff0e5df34986 (patch) | |
tree | 35c764dfec7b76f926c30cd186b6fe36968b6529 /src/render/sdl2graphics.cpp | |
parent | 0336b91f51cdf14e022f74d16c15892b63b658eb (diff) | |
download | manaplus-f94a6551b8d140e272ac1c46bce1ff0e5df34986.tar.gz manaplus-f94a6551b8d140e272ac1c46bce1ff0e5df34986.tar.bz2 manaplus-f94a6551b8d140e272ac1c46bce1ff0e5df34986.tar.xz manaplus-f94a6551b8d140e272ac1c46bce1ff0e5df34986.zip |
improve draw image calls.
Diffstat (limited to 'src/render/sdl2graphics.cpp')
-rw-r--r-- | src/render/sdl2graphics.cpp | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/src/render/sdl2graphics.cpp b/src/render/sdl2graphics.cpp index 00452d9c6..d9844ee6d 100644 --- a/src/render/sdl2graphics.cpp +++ b/src/render/sdl2graphics.cpp @@ -116,9 +116,8 @@ bool SDLGraphics::drawRescaledImage(const Image *const image, &srcRect, &dstRect) < 0); } -bool SDLGraphics::drawImage2(const Image *const image, int srcX, int srcY, - int dstX, int dstY, const int width, - const int height, const bool useColor A_UNUSED) +bool SDLGraphics::drawImage2(const Image *const image, + int dstX, int dstY) { FUNC_BLOCK("Graphics::drawImage2", 1) // Check that preconditions for blitting are met. @@ -132,18 +131,18 @@ bool SDLGraphics::drawImage2(const Image *const image, int srcX, int srcY, const SDL_Rect &bounds = image->mBounds; const SDL_Rect srcRect = { - static_cast<int32_t>(srcX + bounds.x), - static_cast<int32_t>(srcY + bounds.y), - static_cast<int32_t>(width), - static_cast<int32_t>(height) + static_cast<int32_t>(bounds.x), + static_cast<int32_t>(bounds.y), + static_cast<int32_t>(bounds.w), + static_cast<int32_t>(bounds.h) }; const SDL_Rect dstRect = { static_cast<int32_t>(dstX + top.xOffset), static_cast<int32_t>(dstY + top.yOffset), - static_cast<int32_t>(width), - static_cast<int32_t>(height) + static_cast<int32_t>(bounds.w), + static_cast<int32_t>(bounds.h) }; return !MSDL_RenderCopy(mRenderer, image->mTexture, &srcRect, &dstRect); |