summaryrefslogtreecommitdiff
path: root/src/render/sdl2softwaregraphics.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2013-12-29 21:22:33 +0300
committerAndrei Karas <akaras@inbox.ru>2013-12-29 21:22:33 +0300
commitf94a6551b8d140e272ac1c46bce1ff0e5df34986 (patch)
tree35c764dfec7b76f926c30cd186b6fe36968b6529 /src/render/sdl2softwaregraphics.cpp
parent0336b91f51cdf14e022f74d16c15892b63b658eb (diff)
downloadplus-f94a6551b8d140e272ac1c46bce1ff0e5df34986.tar.gz
plus-f94a6551b8d140e272ac1c46bce1ff0e5df34986.tar.bz2
plus-f94a6551b8d140e272ac1c46bce1ff0e5df34986.tar.xz
plus-f94a6551b8d140e272ac1c46bce1ff0e5df34986.zip
improve draw image calls.
Diffstat (limited to 'src/render/sdl2softwaregraphics.cpp')
-rw-r--r--src/render/sdl2softwaregraphics.cpp17
1 files changed, 7 insertions, 10 deletions
diff --git a/src/render/sdl2softwaregraphics.cpp b/src/render/sdl2softwaregraphics.cpp
index b0d76bd57..fa92f6030 100644
--- a/src/render/sdl2softwaregraphics.cpp
+++ b/src/render/sdl2softwaregraphics.cpp
@@ -112,10 +112,7 @@ bool SDL2SoftwareGraphics::drawRescaledImage(const Image *const image,
}
bool SDL2SoftwareGraphics::drawImage2(const Image *const image,
- int srcX, int srcY,
- int dstX, int dstY, const int width,
- const int height,
- const bool useColor A_UNUSED)
+ int dstX, int dstY)
{
FUNC_BLOCK("Graphics::drawImage2", 1)
// Check that preconditions for blitting are met.
@@ -127,13 +124,13 @@ bool SDL2SoftwareGraphics::drawImage2(const Image *const image,
SDL_Surface *const src = image->mSDLSurface;
- srcX += bounds.x;
- srcY += bounds.y;
+ int srcX = bounds.x;
+ int srcY = bounds.y;
dstX += top.xOffset;
dstY += top.yOffset;
- int w = width;
- int h = height;
+ int w = bounds.w;
+ int h = bounds.h;
if (srcX < 0)
{
w += srcX;
@@ -183,8 +180,8 @@ bool SDL2SoftwareGraphics::drawImage2(const Image *const image,
{
SDL_Rect srcRect =
{
- static_cast<int16_t>(srcX),
- static_cast<int16_t>(srcY),
+ static_cast<int16_t>(0),
+ static_cast<int16_t>(0),
static_cast<uint16_t>(w),
static_cast<uint16_t>(h)
};