aboutsummaryrefslogtreecommitdiff
path: root/backends
diff options
context:
space:
mode:
authorThierry Crozat2016-10-12 23:33:12 +0100
committerThierry Crozat2016-10-13 01:46:26 +0100
commit529a7ca26c61cfe10339ee9c7a1fa75ccaf4b562 (patch)
tree35cb1e1fbce60104154c4a0c9afb87fceeca5701 /backends
parent48ec053a1346564bb2f8a03d9b20ee09fb777ecf (diff)
downloadscummvm-rg350-529a7ca26c61cfe10339ee9c7a1fa75ccaf4b562.tar.gz
scummvm-rg350-529a7ca26c61cfe10339ee9c7a1fa75ccaf4b562.tar.bz2
scummvm-rg350-529a7ca26c61cfe10339ee9c7a1fa75ccaf4b562.zip
OPENGLSDL: Add hotkey to enable/disable filtering
Crtl-Alt-f now enables/disables filtering instead of changing the graphics mode. Since there is only one graphics mode now, a hotkey to change it is a bit useless.
Diffstat (limited to 'backends')
-rw-r--r--backends/graphics/openglsdl/openglsdl-graphics.cpp40
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;