summaryrefslogtreecommitdiff
path: root/src/render/sdl2graphics.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2013-12-30 14:17:37 +0300
committerAndrei Karas <akaras@inbox.ru>2013-12-30 14:17:37 +0300
commit31fcdb31fb406531bec49ee2d1b3cc286ed3b5a8 (patch)
treeb7f2a06054bacc8208d8fb429fc811ed199b4453 /src/render/sdl2graphics.cpp
parent74f89c500d278b6ac668c313b63d0f1e76f4acaf (diff)
downloadmv-31fcdb31fb406531bec49ee2d1b3cc286ed3b5a8.tar.gz
mv-31fcdb31fb406531bec49ee2d1b3cc286ed3b5a8.tar.bz2
mv-31fcdb31fb406531bec49ee2d1b3cc286ed3b5a8.tar.xz
mv-31fcdb31fb406531bec49ee2d1b3cc286ed3b5a8.zip
Improve drawRescaledImage in renderers.
Diffstat (limited to 'src/render/sdl2graphics.cpp')
-rw-r--r--src/render/sdl2graphics.cpp13
1 files changed, 5 insertions, 8 deletions
diff --git a/src/render/sdl2graphics.cpp b/src/render/sdl2graphics.cpp
index d9844ee6d..45f09f0f7 100644
--- a/src/render/sdl2graphics.cpp
+++ b/src/render/sdl2graphics.cpp
@@ -81,12 +81,9 @@ SDLGraphics::~SDLGraphics()
}
bool SDLGraphics::drawRescaledImage(const Image *const image,
- int srcX, int srcY,
int dstX, int dstY,
- const int width, const int height,
const int desiredWidth,
- const int desiredHeight,
- const bool useColor A_UNUSED)
+ const int desiredHeight)
{
FUNC_BLOCK("Graphics::drawRescaledImage", 1)
// Check that preconditions for blitting are met.
@@ -99,10 +96,10 @@ bool SDLGraphics::drawRescaledImage(const Image *const image,
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 =
{