summaryrefslogtreecommitdiff
path: root/src/render/normalopenglgraphics.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/normalopenglgraphics.cpp
parent0336b91f51cdf14e022f74d16c15892b63b658eb (diff)
downloadmv-f94a6551b8d140e272ac1c46bce1ff0e5df34986.tar.gz
mv-f94a6551b8d140e272ac1c46bce1ff0e5df34986.tar.bz2
mv-f94a6551b8d140e272ac1c46bce1ff0e5df34986.tar.xz
mv-f94a6551b8d140e272ac1c46bce1ff0e5df34986.zip
improve draw image calls.
Diffstat (limited to 'src/render/normalopenglgraphics.cpp')
-rw-r--r--src/render/normalopenglgraphics.cpp21
1 files changed, 6 insertions, 15 deletions
diff --git a/src/render/normalopenglgraphics.cpp b/src/render/normalopenglgraphics.cpp
index 0f7cc966b..28572f9ba 100644
--- a/src/render/normalopenglgraphics.cpp
+++ b/src/render/normalopenglgraphics.cpp
@@ -285,29 +285,23 @@ static inline void drawRescaledQuad(const Image *const image,
bool NormalOpenGLGraphics::drawImage2(const Image *const image,
- int srcX, int srcY,
- int dstX, int dstY,
- const int width, const int height,
- const bool useColor)
+ int dstX, int dstY)
{
FUNC_BLOCK("Graphics::drawImage2", 1)
if (!image)
return false;
- const SDL_Rect &imageRect = image->mBounds;
-
- if (!useColor)
- setColorAlpha(image->mAlpha);
+ setColorAlpha(image->mAlpha);
#ifdef DEBUG_BIND_TEXTURE
debugBindTexture(image);
#endif
bindTexture(OpenGLImageHelper::mTextureType, image->mGLImage);
-
setTexturingAndBlending(true);
- drawQuad(image, srcX + imageRect.x, srcY + imageRect.y,
- dstX, dstY, width, height);
+ const SDL_Rect &imageRect = image->mBounds;
+ drawQuad(image, imageRect.x, imageRect.y,
+ dstX, dstY, imageRect.w, imageRect.h);
return true;
}
@@ -520,10 +514,7 @@ bool NormalOpenGLGraphics::drawRescaledImage(const Image *const image,
// Just draw the image normally when no resizing is necessary,
if (width == desiredWidth && height == desiredHeight)
- {
- return drawImage2(image, srcX, srcY, dstX, dstY,
- width, height, useColor);
- }
+ return drawImage2(image, dstX, dstY);
// When the desired image is smaller than the current one,
// disable smooth effect.