summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2012-01-20 20:13:17 +0300
committerAndrei Karas <akaras@inbox.ru>2012-01-20 21:03:06 +0300
commit3ce8eb744df104efc83e625b0aeb7b8fed1c3c79 (patch)
tree552df0347ca3c4f51e35587ed0e60aff8d4bebe5
parent690579fef58390e1b28a0dc73174ab559cb3b40c (diff)
downloadmanaplus-3ce8eb744df104efc83e625b0aeb7b8fed1c3c79.tar.gz
manaplus-3ce8eb744df104efc83e625b0aeb7b8fed1c3c79.tar.bz2
manaplus-3ce8eb744df104efc83e625b0aeb7b8fed1c3c79.tar.xz
manaplus-3ce8eb744df104efc83e625b0aeb7b8fed1c3c79.zip
Fix ambient layer scalling in safe opengl mode.
-rw-r--r--src/opengl1graphics.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/opengl1graphics.cpp b/src/opengl1graphics.cpp
index 672962f7b..b6ecd068b 100644
--- a/src/opengl1graphics.cpp
+++ b/src/opengl1graphics.cpp
@@ -377,6 +377,9 @@ void OpenGL1Graphics::drawRescaledImagePattern(Image *image, int x, int y,
// Draw a set of textured rectangles
glBegin(GL_QUADS);
+ const float scaleFactorW = (float) scaledWidth / image->getWidth();
+ const float scaleFactorH = (float) scaledHeight / image->getHeight();
+
for (int py = 0; py < h; py += ih)
{
const int height = (py + ih >= h) ? h - py : ih;
@@ -386,8 +389,8 @@ void OpenGL1Graphics::drawRescaledImagePattern(Image *image, int x, int y,
int width = (px + iw >= w) ? w - px : iw;
int dstX = x + px;
- drawRescaledQuad(image, srcX, srcY, dstX, dstY,
- width, height, scaledWidth, scaledHeight);
+ drawRescaledQuad(image, srcX, srcY, dstX, dstY, width / scaleFactorW,
+ height / scaleFactorH, scaledWidth, scaledHeight);
}
}