aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThierry Crozat2016-10-12 23:33:28 +0100
committerThierry Crozat2016-10-13 01:46:26 +0100
commitfd77916f865a7dded2a14aa67d038ef3370a52f7 (patch)
treeb0038b527d41227cce25b7a9769e2d348f915de6
parent529a7ca26c61cfe10339ee9c7a1fa75ccaf4b562 (diff)
downloadscummvm-rg350-fd77916f865a7dded2a14aa67d038ef3370a52f7.tar.gz
scummvm-rg350-fd77916f865a7dded2a14aa67d038ef3370a52f7.tar.bz2
scummvm-rg350-fd77916f865a7dded2a14aa67d038ef3370a52f7.zip
SURFACESDL: Add hotkey to enable/disable filtering
-rw-r--r--backends/graphics/surfacesdl/surfacesdl-graphics.cpp22
1 files changed, 22 insertions, 0 deletions
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;