diff options
author | Andrei Karas <akaras@inbox.ru> | 2015-12-17 22:52:07 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2015-12-17 22:52:07 +0300 |
commit | 120e0b5b384566c89984aeea86ae517909ebaac1 (patch) | |
tree | 71a3fae89106d1aa4827a1b314ce3d6f9890575e | |
parent | 8d3ef9075b56d9e9e8288e82e0242896433ff853 (diff) | |
download | manaverse-120e0b5b384566c89984aeea86ae517909ebaac1.tar.gz manaverse-120e0b5b384566c89984aeea86ae517909ebaac1.tar.bz2 manaverse-120e0b5b384566c89984aeea86ae517909ebaac1.tar.xz manaverse-120e0b5b384566c89984aeea86ae517909ebaac1.zip |
Add support for full screen in nacl.
-rw-r--r-- | src/actions/actions.cpp | 4 | ||||
-rw-r--r-- | src/gui/widgets/tabs/setup_video.cpp | 6 | ||||
-rw-r--r-- | src/gui/windowmanager.cpp | 13 | ||||
-rw-r--r-- | src/gui/windowmanager.h | 2 |
4 files changed, 21 insertions, 4 deletions
diff --git a/src/actions/actions.cpp b/src/actions/actions.cpp index 663c7d475..dec8539d3 100644 --- a/src/actions/actions.cpp +++ b/src/actions/actions.cpp @@ -41,6 +41,7 @@ #include "gui/gui.h" #include "gui/popupmanager.h" #include "gui/sdlinput.h" +#include "gui/windowmanager.h" #include "gui/popups/popupmenu.h" @@ -909,8 +910,7 @@ impHandler0(attackHuman) impHandler0(safeVideoMode) { - if (mainGraphics) - mainGraphics->setFullscreen(false); + WindowManager::setFullScreen(false); return true; } diff --git a/src/gui/widgets/tabs/setup_video.cpp b/src/gui/widgets/tabs/setup_video.cpp index e96320762..1212da022 100644 --- a/src/gui/widgets/tabs/setup_video.cpp +++ b/src/gui/widgets/tabs/setup_video.cpp @@ -177,7 +177,9 @@ Setup_Video::Setup_Video(const Widget2 *const widget) : #else mNoFrameCheckBox->setEnabled(false); mEnableResizeCheckBox->setEnabled(false); +#ifndef __native_client__ mFsCheckBox->setEnabled(false); +#endif // __native_client__ #endif int width = 600; @@ -214,10 +216,10 @@ void Setup_Video::apply() if (intToRenderType(config.getIntValue("opengl")) == RENDER_SOFTWARE) { #endif - if (!mainGraphics->setFullscreen(fullscreen)) + if (!WindowManager::setFullScreen(fullscreen)) { fullscreen = !fullscreen; - if (!mainGraphics->setFullscreen(fullscreen)) + if (!WindowManager::setFullScreen(fullscreen)) { std::stringstream errorMsg; if (fullscreen) diff --git a/src/gui/windowmanager.cpp b/src/gui/windowmanager.cpp index dfc72ab73..1959ac4a1 100644 --- a/src/gui/windowmanager.cpp +++ b/src/gui/windowmanager.cpp @@ -243,6 +243,19 @@ void WindowManager::resizeVideo(int actualWidth, } } +bool WindowManager::setFullScreen(const bool fs) +{ +#ifdef __native_client__ + naclPostMessage("set-fullscreen", + fs ? "on" : "off"); + return true; +#else + if (!mainGraphics) + return false; + return mainGraphics->setFullscreen(fs); +#endif +} + void WindowManager::applyGrabMode() { SDL::grabInput(mainGraphics->getWindow(), diff --git a/src/gui/windowmanager.h b/src/gui/windowmanager.h index 8acdce0fd..79a4a383a 100644 --- a/src/gui/windowmanager.h +++ b/src/gui/windowmanager.h @@ -57,6 +57,8 @@ namespace WindowManager int actualHeight, const bool always); + bool setFullScreen(const bool fs); + void applyScale(); #ifndef USE_SDL2 |