From f94a6551b8d140e272ac1c46bce1ff0e5df34986 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sun, 29 Dec 2013 21:22:33 +0300 Subject: improve draw image calls. --- src/render/sdl2graphics.cpp | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) (limited to 'src/render/sdl2graphics.cpp') 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(srcX + bounds.x), - static_cast(srcY + bounds.y), - static_cast(width), - static_cast(height) + static_cast(bounds.x), + static_cast(bounds.y), + static_cast(bounds.w), + static_cast(bounds.h) }; const SDL_Rect dstRect = { static_cast(dstX + top.xOffset), static_cast(dstY + top.yOffset), - static_cast(width), - static_cast(height) + static_cast(bounds.w), + static_cast(bounds.h) }; return !MSDL_RenderCopy(mRenderer, image->mTexture, &srcRect, &dstRect); -- cgit v1.2.3-60-g2f50