diff options
author | Thierry Crozat | 2016-10-16 18:42:40 +0100 |
---|---|---|
committer | GitHub | 2016-10-16 18:42:40 +0100 |
commit | 5151bd99dd8bc342a1367c558892d5486826941c (patch) | |
tree | 290e6458cbfc728f5415cff213dc813913f17bc9 /backends/graphics/openglsdl | |
parent | abc4656cc00f11091210213058a883718442b7b7 (diff) | |
parent | aa39a6ce4b2285d1308eb4607bdd53d317304661 (diff) | |
download | scummvm-rg350-5151bd99dd8bc342a1367c558892d5486826941c.tar.gz scummvm-rg350-5151bd99dd8bc342a1367c558892d5486826941c.tar.bz2 scummvm-rg350-5151bd99dd8bc342a1367c558892d5486826941c.zip |
Merge pull request #847 from criezy/sdl-filtering
Add graphics linear filtering feature
Diffstat (limited to 'backends/graphics/openglsdl')
-rw-r--r-- | backends/graphics/openglsdl/openglsdl-graphics.cpp | 40 |
1 files changed, 9 insertions, 31 deletions
diff --git a/backends/graphics/openglsdl/openglsdl-graphics.cpp b/backends/graphics/openglsdl/openglsdl-graphics.cpp index f6ae25c4ee..042cd49099 100644 --- a/backends/graphics/openglsdl/openglsdl-graphics.cpp +++ b/backends/graphics/openglsdl/openglsdl-graphics.cpp @@ -735,38 +735,13 @@ bool OpenGLSdlGraphicsManager::notifyEvent(const Common::Event &event) { return true; } else if (event.kbd.keycode == Common::KEYCODE_f) { - // Ctrl+Alt+f toggles the graphics modes. - - // We are crazy we will allow the OpenGL base class to - // introduce new graphics modes like shaders for special - // filtering. If some other OpenGL subclass needs this, - // we can think of refactoring this. - int mode = getGraphicsMode(); - const OSystem::GraphicsMode *supportedModes = getSupportedGraphicsModes(); - const OSystem::GraphicsMode *modeDesc = nullptr; - - // Search the current mode. - for (; supportedModes->name; ++supportedModes) { - if (supportedModes->id == mode) { - modeDesc = supportedModes; - break; - } - } - assert(modeDesc); - - // Try to use the next mode in the list. - ++modeDesc; - if (!modeDesc->name) { - modeDesc = getSupportedGraphicsModes(); - } - - // Never ever try to resize the window when we simply want to - // switch the graphics mode. This assures that the window size - // does not change. + // Never ever try to resize the window when we simply want to enable or disable filtering. + // This assures that the window size does not change. _ignoreLoadVideoMode = true; + // Ctrl+Alt+f toggles filtering on/off beginGFXTransaction(); - setGraphicsMode(modeDesc->id); + setFeatureState(OSystem::kFeatureFilteringMode, !getFeatureState(OSystem::kFeatureFilteringMode)); endGFXTransaction(); // Make sure we do not ignore the next resize. This @@ -774,8 +749,11 @@ bool OpenGLSdlGraphicsManager::notifyEvent(const Common::Event &event) { assert(!_ignoreLoadVideoMode); #ifdef USE_OSD - const Common::String osdMsg = Common::String::format(_("Graphics mode: %s"), _(modeDesc->description)); - displayMessageOnOSD(osdMsg.c_str()); + if (getFeatureState(OSystem::kFeatureFilteringMode)) { + displayMessageOnOSD(_("Filtering enabled")); + } else { + displayMessageOnOSD(_("Filtering disabled")); + } #endif return true; |