diff options
author | Andrei Karas <akaras@inbox.ru> | 2015-12-15 00:55:51 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2015-12-15 00:59:17 +0300 |
commit | 1d1ddce1a81cdf65d765444685313afc4b161e5f (patch) | |
tree | 7094b343c96642e0acaa02ebce5d618a763faa79 /src/gui/windowmanager.cpp | |
parent | 34dacb3f9d99a0148efc6907fd59274fe830c6d6 (diff) | |
download | manaverse-1d1ddce1a81cdf65d765444685313afc4b161e5f.tar.gz manaverse-1d1ddce1a81cdf65d765444685313afc4b161e5f.tar.bz2 manaverse-1d1ddce1a81cdf65d765444685313afc4b161e5f.tar.xz manaverse-1d1ddce1a81cdf65d765444685313afc4b161e5f.zip |
Fix manual set resolution in nacl.
Diffstat (limited to 'src/gui/windowmanager.cpp')
-rw-r--r-- | src/gui/windowmanager.cpp | 24 |
1 files changed, 23 insertions, 1 deletions
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); } |