aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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;