summaryrefslogtreecommitdiff
path: root/src/resources/mobileopenglscreenshothelper.cpp
diff options
context:
space:
mode:
authorewew ukek <ewewukek@gmail.com>2024-04-16 18:33:14 +0000
committerFedja Beader <fedja@protonmail.ch>2024-04-16 18:33:14 +0000
commit6e02a3cbe4c3e9faa9aab458bdf1c220eb7b4e32 (patch)
tree53f6c164a1360094e5d0591834bdcbbd8a5fdfa0 /src/resources/mobileopenglscreenshothelper.cpp
parent1a77b01a78a408b54ef709cb6df0d07893843c78 (diff)
downloadmv-6e02a3cbe4c3e9faa9aab458bdf1c220eb7b4e32.tar.gz
mv-6e02a3cbe4c3e9faa9aab458bdf1c220eb7b4e32.tar.bz2
mv-6e02a3cbe4c3e9faa9aab458bdf1c220eb7b4e32.tar.xz
mv-6e02a3cbe4c3e9faa9aab458bdf1c220eb7b4e32.zip
Fix screenshot size for OpenGL modes
Screenshot code didn't take into account scaling setting which resulted in cropped screenshots. I didn't touch SDL modes because they don't support scaling and I'm not sure how that would be implemented for software render. **** mana/plus!70
Diffstat (limited to 'src/resources/mobileopenglscreenshothelper.cpp')
-rw-r--r--src/resources/mobileopenglscreenshothelper.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/resources/mobileopenglscreenshothelper.cpp b/src/resources/mobileopenglscreenshothelper.cpp
index fb0be453a..6772c8fd0 100644
--- a/src/resources/mobileopenglscreenshothelper.cpp
+++ b/src/resources/mobileopenglscreenshothelper.cpp
@@ -50,15 +50,17 @@ MobileOpenGLScreenshotHelper::~MobileOpenGLScreenshotHelper()
void MobileOpenGLScreenshotHelper::prepare()
{
if (config.getBoolValue("usefbo"))
- graphicsManager.createFBO(mainGraphics->mWidth,
- mainGraphics->mHeight,
- &mFbo);
+ graphicsManager.createFBO(mainGraphics->mActualWidth,
+ mainGraphics->mActualHeight,
+ &mFbo);
}
SDL_Surface *MobileOpenGLScreenshotHelper::getScreenshot()
{
- const int h = mainGraphics->mHeight;
- const int w = mainGraphics->mWidth - (mainGraphics->mWidth % 4);
+ const int h = mainGraphics->mActualHeight;
+ const int w = mainGraphics->mActualWidth
+ -(mainGraphics->mActualWidth % 4);
+
GLint pack = 1;
SDL_Surface *const tmpImage = MSDL_CreateRGBSurface(