summaryrefslogtreecommitdiff
path: root/src/mobileopenglgraphics.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2013-08-22 11:59:38 +0300
committerAndrei Karas <akaras@inbox.ru>2013-08-24 21:08:15 +0300
commit2480ea4cc668ff99007dd6fb8b44911eea5d5287 (patch)
treec8fc22a9612d30474cddd6d40da5269ffd7f55a5 /src/mobileopenglgraphics.cpp
parent07390a4c8dcde85602c1a91d3773061d67d169ab (diff)
downloadmanaplus-2480ea4cc668ff99007dd6fb8b44911eea5d5287.tar.gz
manaplus-2480ea4cc668ff99007dd6fb8b44911eea5d5287.tar.bz2
manaplus-2480ea4cc668ff99007dd6fb8b44911eea5d5287.tar.xz
manaplus-2480ea4cc668ff99007dd6fb8b44911eea5d5287.zip
store window size into rectangle.
Diffstat (limited to 'src/mobileopenglgraphics.cpp')
-rw-r--r--src/mobileopenglgraphics.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/mobileopenglgraphics.cpp b/src/mobileopenglgraphics.cpp
index 2aec87498..e2991eddc 100644
--- a/src/mobileopenglgraphics.cpp
+++ b/src/mobileopenglgraphics.cpp
@@ -845,11 +845,11 @@ void MobileOpenGLGraphics::_beginDraw()
glLoadIdentity();
#ifdef ANDROID
- glOrthof(0.0, static_cast<float>(mWindow->w),
- static_cast<float>(mWindow->h), 0.0, -1.0, 1.0);
+ glOrthof(0.0, static_cast<float>(mRect.w),
+ static_cast<float>(mRect.h), 0.0, -1.0, 1.0);
#else
- glOrtho(0.0, static_cast<double>(mWindow->w),
- static_cast<double>(mWindow->h), 0.0, -1.0, 1.0);
+ glOrtho(0.0, static_cast<double>(mRect.w),
+ static_cast<double>(mRect.h), 0.0, -1.0, 1.0);
#endif
glMatrixMode(GL_MODELVIEW);
@@ -883,7 +883,7 @@ void MobileOpenGLGraphics::_beginDraw()
// glScalef(0.5f, 0.5f, 0.5f);
- pushClipArea(gcn::Rectangle(0, 0, mWindow->w, mWindow->h));
+ pushClipArea(gcn::Rectangle(0, 0, mRect.w, mRect.h));
}
void MobileOpenGLGraphics::_endDraw()
@@ -894,13 +894,13 @@ void MobileOpenGLGraphics::_endDraw()
void MobileOpenGLGraphics::prepareScreenshot()
{
if (config.getBoolValue("usefbo"))
- graphicsManager.createFBO(mWindow->w, mWindow->h, &mFbo);
+ graphicsManager.createFBO(mRect.w, mRect.h, &mFbo);
}
SDL_Surface* MobileOpenGLGraphics::getScreenshot()
{
- const int h = mWindow->h;
- const int w = mWindow->w - (mWindow->w % 4);
+ const int h = mRect.h;
+ const int w = mRect.w - (mRect.w % 4);
GLint pack = 1;
SDL_Surface *const screenshot = SDL_CreateRGBSurface(
@@ -971,7 +971,7 @@ bool MobileOpenGLGraphics::pushClipArea(gcn::Rectangle area)
glTranslatef(static_cast<GLfloat>(transX),
static_cast<GLfloat>(transY), 0);
}
- glScissor(clipArea.x, mWindow->h - clipArea.y - clipArea.height,
+ glScissor(clipArea.x, mRect.h - clipArea.y - clipArea.height,
clipArea.width, clipArea.height);
return result;
@@ -986,7 +986,7 @@ void MobileOpenGLGraphics::popClipArea()
glPopMatrix();
const gcn::ClipRectangle &clipArea = mClipStack.top();
- glScissor(clipArea.x, mWindow->h - clipArea.y - clipArea.height,
+ glScissor(clipArea.x, mRect.h - clipArea.y - clipArea.height,
clipArea.width, clipArea.height);
}