summaryrefslogtreecommitdiff
path: root/src/resources/openglscreenshothelper.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-12-16 01:03:19 +0300
committerAndrei Karas <akaras@inbox.ru>2015-12-16 01:03:19 +0300
commit78fb544aeb8761e8d554487487bc27e610822e2d (patch)
tree45ec42f5dcba94cd391f54a4cef2c017d7318d38 /src/resources/openglscreenshothelper.cpp
parentfcdc44b21bda79052205ca1884b7f3a1ebd32957 (diff)
downloadmanaverse-78fb544aeb8761e8d554487487bc27e610822e2d.tar.gz
manaverse-78fb544aeb8761e8d554487487bc27e610822e2d.tar.bz2
manaverse-78fb544aeb8761e8d554487487bc27e610822e2d.tar.xz
manaverse-78fb544aeb8761e8d554487487bc27e610822e2d.zip
Use screenshort helpers for creating screenshots
Diffstat (limited to 'src/resources/openglscreenshothelper.cpp')
-rw-r--r--src/resources/openglscreenshothelper.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/resources/openglscreenshothelper.cpp b/src/resources/openglscreenshothelper.cpp
index ec561476e..9d0edd80e 100644
--- a/src/resources/openglscreenshothelper.cpp
+++ b/src/resources/openglscreenshothelper.cpp
@@ -44,18 +44,18 @@ OpenGLScreenshotHelper::~OpenGLScreenshotHelper()
{
}
-void OpenGLScreenshotHelper::prepare(const int width,
- const int height)
+void OpenGLScreenshotHelper::prepare()
{
if (config.getBoolValue("usefbo"))
- graphicsManager.createFBO(width, height, &mFbo);
+ graphicsManager.createFBO(mainGraphics->mWidth,
+ mainGraphics->mHeight,
+ &mFbo);
}
-SDL_Surface *OpenGLScreenshotHelper::getScreenshot(const int width,
- const int height)
+SDL_Surface *OpenGLScreenshotHelper::getScreenshot()
{
- const int h = height;
- const int w = width - (width % 4);
+ const int h = mainGraphics->mHeight;
+ const int w = mainGraphics->mWidth - (mainGraphics->mWidth % 4);
GLint pack = 1;
SDL_Surface *const screenshot = MSDL_CreateRGBSurface(