From fd77916f865a7dded2a14aa67d038ef3370a52f7 Mon Sep 17 00:00:00 2001 From: Thierry Crozat Date: Wed, 12 Oct 2016 23:33:28 +0100 Subject: SURFACESDL: Add hotkey to enable/disable filtering --- .../graphics/surfacesdl/surfacesdl-graphics.cpp | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/backends/graphics/surfacesdl/surfacesdl-graphics.cpp b/backends/graphics/surfacesdl/surfacesdl-graphics.cpp index cc1d8dbafa..2b62cc2c6e 100644 --- a/backends/graphics/surfacesdl/surfacesdl-graphics.cpp +++ b/backends/graphics/surfacesdl/surfacesdl-graphics.cpp @@ -2341,6 +2341,24 @@ bool SurfaceSdlGraphicsManager::handleScalerHotkeys(Common::KeyCode key) { internUpdateScreen(); return true; } + +#if SDL_VERSION_ATLEAST(2, 0, 0) + // Ctrl-Alt-f toggles filtering + if (key == 'f') { + beginGFXTransaction(); + setFeatureState(OSystem::kFeatureFilteringMode, !_videoMode.filtering); + endGFXTransaction(); +#ifdef USE_OSD + if (getFeatureState(OSystem::kFeatureFilteringMode)) { + displayMessageOnOSD(_("Filtering enabled")); + } else { + displayMessageOnOSD(_("Filtering disabled")); + } +#endif + internUpdateScreen(); + return true; + } +#endif int newMode = -1; int factor = _videoMode.scaleFactor - 1; @@ -2414,6 +2432,10 @@ bool SurfaceSdlGraphicsManager::isScalerHotkey(const Common::Event &event) { if (keyValue >= ARRAYSIZE(s_gfxModeSwitchTable)) return false; } +#if SDL_VERSION_ATLEAST(2, 0, 0) + if (event.kbd.keycode == 'f') + return true; +#endif return (isScaleKey || event.kbd.keycode == 'a'); } return false; -- cgit v1.2.3