summaryrefslogtreecommitdiff
path: root/src/gui
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-12-15 00:55:51 +0300
committerAndrei Karas <akaras@inbox.ru>2015-12-15 00:59:17 +0300
commit1d1ddce1a81cdf65d765444685313afc4b161e5f (patch)
tree7094b343c96642e0acaa02ebce5d618a763faa79 /src/gui
parent34dacb3f9d99a0148efc6907fd59274fe830c6d6 (diff)
downloadmanaplus-1d1ddce1a81cdf65d765444685313afc4b161e5f.tar.gz
manaplus-1d1ddce1a81cdf65d765444685313afc4b161e5f.tar.bz2
manaplus-1d1ddce1a81cdf65d765444685313afc4b161e5f.tar.xz
manaplus-1d1ddce1a81cdf65d765444685313afc4b161e5f.zip
Fix manual set resolution in nacl.
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/widgets/tabs/setup_video.cpp4
-rw-r--r--src/gui/windowmanager.cpp24
-rw-r--r--src/gui/windowmanager.h4
3 files changed, 29 insertions, 3 deletions
diff --git a/src/gui/widgets/tabs/setup_video.cpp b/src/gui/widgets/tabs/setup_video.cpp
index 77b56289e..e96320762 100644
--- a/src/gui/widgets/tabs/setup_video.cpp
+++ b/src/gui/widgets/tabs/setup_video.cpp
@@ -378,7 +378,7 @@ void Setup_Video::action(const ActionEvent &event)
if (intToRenderType(config.getIntValue("opengl"))
== RENDER_SOFTWARE)
{
- WindowManager::resizeVideo(width, height, false);
+ WindowManager::doResizeVideo(width, height, false);
}
else
{
@@ -419,7 +419,7 @@ void Setup_Video::action(const ActionEvent &event)
}
#else
mainGraphics->setWindowSize(width, height);
- WindowManager::resizeVideo(width, height, false);
+ WindowManager::doResizeVideo(width, height, false);
#endif
}
diff --git a/src/gui/windowmanager.cpp b/src/gui/windowmanager.cpp
index 4be7c3600..dfc72ab73 100644
--- a/src/gui/windowmanager.cpp
+++ b/src/gui/windowmanager.cpp
@@ -55,6 +55,9 @@
#include "utils/files.h"
#include "utils/sdlcheckutils.h"
#include "utils/sdlhelper.h"
+#ifdef __native_client__
+#include "utils/naclmessages.h"
+#endif // __native_client__
#ifdef ANDROID
#ifndef USE_SDL2
@@ -175,6 +178,25 @@ int WindowManager::getFramerate()
return SDL_getFramerate(&fpsManager);
}
+void WindowManager::doResizeVideo(int actualWidth,
+ int actualHeight,
+ const bool always)
+{
+ if (!always
+ && mainGraphics->mActualWidth == actualWidth
+ && mainGraphics->mActualHeight == actualHeight)
+ {
+ return;
+ }
+
+#ifdef __native_client__
+ naclPostMessage("resize-window",
+ strprintf("%d,%d", actualWidth, actualHeight));
+#else
+ resizeVideo(actualWidth, actualHeight, always);
+#endif
+}
+
void WindowManager::resizeVideo(int actualWidth,
int actualHeight,
const bool always)
@@ -257,7 +279,7 @@ void WindowManager::applyScale()
if (mainGraphics->getScale() == scale)
return;
mainGraphics->setScale(scale);
- resizeVideo(mainGraphics->mActualWidth,
+ doResizeVideo(mainGraphics->mActualWidth,
mainGraphics->mActualHeight,
true);
}
diff --git a/src/gui/windowmanager.h b/src/gui/windowmanager.h
index 8983ac82b..8acdce0fd 100644
--- a/src/gui/windowmanager.h
+++ b/src/gui/windowmanager.h
@@ -49,6 +49,10 @@ namespace WindowManager
void applyKeyRepeat();
+ void doResizeVideo(int actualWidth,
+ int actualHeight,
+ const bool always);
+
void resizeVideo(int actualWidth,
int actualHeight,
const bool always);