[Scummvm-git-logs] scummvm branch-2-7 -> fa36266f981677f8492fd4c6ebff05a2b84c278b

antoniou79 noreply at scummvm.org
Sat Jul 1 10:15:17 UTC 2023


This automated email contains information about 7 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
a563278b0a BACKENDS: GRAPHICS: Implement scaler scrolling for OpenGL
908bbba132 JANITORIAL: Fix code indentation
99ce1cfdc3 DOCS: Update shortcut for cycling graphic scalers
861af01685 DOCS: Update keymaps page for scaler scrolling
c3e879dd01 DOCS: Update scaler filter shortcuts in configuration_file
3f01c6d2d5 DOCS: Add cycle graphic filter shortcut under Software Scalers section
fa36266f98 DOCS: use kbd prefix for 0 and 9 keys in shortcut


Commit: a563278b0a28321ce589fab1a2735d811c861e20
    https://github.com/scummvm/scummvm/commit/a563278b0a28321ce589fab1a2735d811c861e20
Author: antoniou79 (a.antoniou79 at gmail.com)
Date: 2023-07-01T13:13:30+03:00

Commit Message:
BACKENDS: GRAPHICS: Implement scaler scrolling for OpenGL

Using the Ctrl+Alt+0 or 9 keymap

Also added a guard check for kFeatureScalers to allow the actions (kActionNextScaleFilter, kActionPreviousScaleFilter) to change scaler (but not scaler factor) in sdl/sdl-graphics.cpp

Changed paths:
    backends/graphics/openglsdl/openglsdl-graphics.cpp
    backends/graphics/sdl/sdl-graphics.cpp


diff --git a/backends/graphics/openglsdl/openglsdl-graphics.cpp b/backends/graphics/openglsdl/openglsdl-graphics.cpp
index 19acd13ef70..9f7a30950f4 100644
--- a/backends/graphics/openglsdl/openglsdl-graphics.cpp
+++ b/backends/graphics/openglsdl/openglsdl-graphics.cpp
@@ -24,6 +24,9 @@
 #include "backends/events/sdl/sdl-events.h"
 #include "backends/platform/sdl/sdl.h"
 #include "graphics/scaler/aspect.h"
+#ifdef USE_SCALERS
+#include "graphics/scalerplugin.h"
+#endif
 
 #include "common/textconsole.h"
 #include "common/config-manager.h"
@@ -717,6 +720,56 @@ bool OpenGLSdlGraphicsManager::notifyEvent(const Common::Event &event) {
 		return true;
 	}
 
+#ifdef USE_SCALERS
+	case kActionNextScaleFilter:
+	case kActionPreviousScaleFilter: {
+		if (_scalerPlugins.size() > 0) {
+			const int direction = event.customType == kActionNextScaleFilter ? 1 : -1;
+
+			uint scalerIndex = getScaler();
+			switch (direction) {
+			case 1:
+				if (scalerIndex >= _scalerPlugins.size() - 1) {
+					scalerIndex = 0;
+				} else {
+					++scalerIndex;
+				}
+				break;
+
+			case -1:
+			default:
+				if (scalerIndex == 0) {
+					scalerIndex = _scalerPlugins.size() - 1;
+				} else {
+					--scalerIndex;
+				}
+				break;
+			}
+
+			beginGFXTransaction();
+			setScaler(scalerIndex, getScaleFactor());
+			endGFXTransaction();
+
+#ifdef USE_OSD
+			int windowWidth = 0, windowHeight = 0;
+			getWindowSizeFromSdl(&windowWidth, &windowHeight);
+			const char *newScalerName = _scalerPlugins[scalerIndex]->get<ScalerPluginObject>().getPrettyName();
+			if (newScalerName) {
+				const Common::U32String message = Common::U32String::format(
+					"%S %s%d\n%d x %d",
+					_("Active graphics filter:").c_str(),
+					newScalerName,
+					getScaleFactor(),
+					windowWidth, windowHeight);
+				displayMessageOnOSD(message);
+			}
+#endif
+		}
+
+		return true;
+	}
+#endif // USE_SCALERS
+
 	case kActionToggleAspectRatioCorrection:
 		// Toggles the aspect ratio correction state.
 		beginGFXTransaction();
diff --git a/backends/graphics/sdl/sdl-graphics.cpp b/backends/graphics/sdl/sdl-graphics.cpp
index 10fca20daf9..42587b367c3 100644
--- a/backends/graphics/sdl/sdl-graphics.cpp
+++ b/backends/graphics/sdl/sdl-graphics.cpp
@@ -464,27 +464,29 @@ Common::Keymap *SdlGraphicsManager::getKeymap() {
 		keymap->addAction(act);
 	}
 
-	act = new Action("SCL+", _("Increase the scale factor"));
-	act->addDefaultInputMapping("C+A+PLUS");
-	act->addDefaultInputMapping("C+A+KP_PLUS");
-	act->setCustomBackendActionEvent(kActionIncreaseScaleFactor);
-	keymap->addAction(act);
+		act = new Action("SCL+", _("Increase the scale factor"));
+		act->addDefaultInputMapping("C+A+PLUS");
+		act->addDefaultInputMapping("C+A+KP_PLUS");
+		act->setCustomBackendActionEvent(kActionIncreaseScaleFactor);
+		keymap->addAction(act);
 
-	act = new Action("SCL-", _("Decrease the scale factor"));
-	act->addDefaultInputMapping("C+A+MINUS");
-	act->addDefaultInputMapping("C+A+KP_MINUS");
-	act->setCustomBackendActionEvent(kActionDecreaseScaleFactor);
-	keymap->addAction(act);
+		act = new Action("SCL-", _("Decrease the scale factor"));
+		act->addDefaultInputMapping("C+A+MINUS");
+		act->addDefaultInputMapping("C+A+KP_MINUS");
+		act->setCustomBackendActionEvent(kActionDecreaseScaleFactor);
+		keymap->addAction(act);
 
-	act = new Action("FLTN", _("Switch to the next scaler"));
-	act->addDefaultInputMapping("C+A+0");
-	act->setCustomBackendActionEvent(kActionNextScaleFilter);
-	keymap->addAction(act);
+	if (hasFeature(OSystem::kFeatureScalers)) {
+		act = new Action("FLTN", _("Switch to the next scaler"));
+		act->addDefaultInputMapping("C+A+0");
+		act->setCustomBackendActionEvent(kActionNextScaleFilter);
+		keymap->addAction(act);
 
-	act = new Action("FLTP", _("Switch to the previous scaler"));
-	act->addDefaultInputMapping("C+A+9");
-	act->setCustomBackendActionEvent(kActionPreviousScaleFilter);
-	keymap->addAction(act);
+		act = new Action("FLTP", _("Switch to the previous scaler"));
+		act->addDefaultInputMapping("C+A+9");
+		act->setCustomBackendActionEvent(kActionPreviousScaleFilter);
+		keymap->addAction(act);
+	}
 
 	return keymap;
 }


Commit: 908bbba132c32b25dac13cc0b9dbac5098909b03
    https://github.com/scummvm/scummvm/commit/908bbba132c32b25dac13cc0b9dbac5098909b03
Author: antoniou79 (a.antoniou79 at gmail.com)
Date: 2023-07-01T13:13:38+03:00

Commit Message:
JANITORIAL: Fix code indentation

Changed paths:
    backends/graphics/sdl/sdl-graphics.cpp


diff --git a/backends/graphics/sdl/sdl-graphics.cpp b/backends/graphics/sdl/sdl-graphics.cpp
index 42587b367c3..19f903fb06a 100644
--- a/backends/graphics/sdl/sdl-graphics.cpp
+++ b/backends/graphics/sdl/sdl-graphics.cpp
@@ -464,17 +464,17 @@ Common::Keymap *SdlGraphicsManager::getKeymap() {
 		keymap->addAction(act);
 	}
 
-		act = new Action("SCL+", _("Increase the scale factor"));
-		act->addDefaultInputMapping("C+A+PLUS");
-		act->addDefaultInputMapping("C+A+KP_PLUS");
-		act->setCustomBackendActionEvent(kActionIncreaseScaleFactor);
-		keymap->addAction(act);
+	act = new Action("SCL+", _("Increase the scale factor"));
+	act->addDefaultInputMapping("C+A+PLUS");
+	act->addDefaultInputMapping("C+A+KP_PLUS");
+	act->setCustomBackendActionEvent(kActionIncreaseScaleFactor);
+	keymap->addAction(act);
 
-		act = new Action("SCL-", _("Decrease the scale factor"));
-		act->addDefaultInputMapping("C+A+MINUS");
-		act->addDefaultInputMapping("C+A+KP_MINUS");
-		act->setCustomBackendActionEvent(kActionDecreaseScaleFactor);
-		keymap->addAction(act);
+	act = new Action("SCL-", _("Decrease the scale factor"));
+	act->addDefaultInputMapping("C+A+MINUS");
+	act->addDefaultInputMapping("C+A+KP_MINUS");
+	act->setCustomBackendActionEvent(kActionDecreaseScaleFactor);
+	keymap->addAction(act);
 
 	if (hasFeature(OSystem::kFeatureScalers)) {
 		act = new Action("FLTN", _("Switch to the next scaler"));


Commit: 99ce1cfdc3c9a411082649274c506a2f0b5f18ed
    https://github.com/scummvm/scummvm/commit/99ce1cfdc3c9a411082649274c506a2f0b5f18ed
Author: antoniou79 (a.antoniou79 at gmail.com)
Date: 2023-07-01T13:14:25+03:00

Commit Message:
DOCS: Update shortcut for cycling graphic scalers

Changed paths:
    doc/docportal/advanced_topics/understand_graphics.rst
    doc/docportal/use_scummvm/keyboard_shortcuts.rst


diff --git a/doc/docportal/advanced_topics/understand_graphics.rst b/doc/docportal/advanced_topics/understand_graphics.rst
index 30e00bc925f..09cd8ed390a 100644
--- a/doc/docportal/advanced_topics/understand_graphics.rst
+++ b/doc/docportal/advanced_topics/understand_graphics.rst
@@ -20,8 +20,6 @@ Graphics modes
 
 Most platforms have either one or two available graphics modes. The most common ones are OpenGL and SDL Surface.
 
-To switch between graphics modes, press :kbd:`Ctrl + Alt` and :kbd:`1` to :kbd:`8`.
-
 OpenGL graphics mode
 *************************************
 
diff --git a/doc/docportal/use_scummvm/keyboard_shortcuts.rst b/doc/docportal/use_scummvm/keyboard_shortcuts.rst
index 0f3f3e328ec..332128ac91f 100755
--- a/doc/docportal/use_scummvm/keyboard_shortcuts.rst
+++ b/doc/docportal/use_scummvm/keyboard_shortcuts.rst
@@ -21,7 +21,7 @@ Default shortcuts are shown in the table.
         :kbd:`Ctrl+z`,Quit (other platforms)
         :kbd:`Ctrl+u` ,Mutes all sounds
         :kbd:`Ctrl+m` ,Toggles mouse capture
-        :kbd:`Ctrl+Alt+ 1-8` ,Switches between graphics filters
+        :kbd:`Ctrl+Alt` and `9` or `0` ,Cycles forwards/backwards between graphics filters
         :kbd:`Ctrl+Alt` and :kbd:`+` or :kbd:`-`,Increases/decreases the scale factor
         :kbd:`Ctrl+Alt+a` ,Toggles aspect ratio correction on/off
         :kbd:`Ctrl+Alt+f` ,Toggles between nearest neighbor and bilinear interpolation (graphics filtering on/off)


Commit: 861af01685069806bc57c7dc9d90e288050f37a5
    https://github.com/scummvm/scummvm/commit/861af01685069806bc57c7dc9d90e288050f37a5
Author: antoniou79 (a.antoniou79 at gmail.com)
Date: 2023-07-01T13:14:31+03:00

Commit Message:
DOCS: Update keymaps page for scaler scrolling

Changed paths:
    doc/docportal/settings/keymaps.rst


diff --git a/doc/docportal/settings/keymaps.rst b/doc/docportal/settings/keymaps.rst
index c726e7cc5ff..b3e4a6bea23 100644
--- a/doc/docportal/settings/keymaps.rst
+++ b/doc/docportal/settings/keymaps.rst
@@ -134,45 +134,15 @@ Increase the scale factor
 Decrease the scale factor
 	*keymap_sdl-graphics_SCL-*
 
-.. _FLT1:
+.. _FLTN:
 
-Switch to nearest neighbour scaling
-	*keymap_sdl-graphics_FLT1*
+Switch to next graphical scale filter
+	*keymap_sdl-graphics_FLTN*
 
-.. _FLT2:
+.. _FLTP:
 
-Switch to AdvMame 2x/3x scaling
-	*keymap_sdl-graphics_FLT2*
-
-.. _FLT3:
-
-Switch to HQ 2x/3x scaling
-	*keymap_sdl-graphics_FLT3*
-
-.. _FLT4:
-
-Switch to 2XSai scaling
-	*keymap_sdl-graphics_FLT4*
-
-.. _FLT5:
-
-Switch to Super2xSai scaling
-	*keymap_sdl-graphics_FLT5*
-
-.. _FLT6:
-
-Switch to SuperEagle scaling
-	*keymap_sdl-graphics_FLT6*
-
-.. _FLT7:
-
-Switch to TV 2x scaling
-	*keymap_sdl-graphics_FLT7*
-
-.. _FLT8:
-
-Switch to DotMatrix scaling
-	*keymap_sdl-graphics_FLT8*
+Switch to previous graphical scale filter
+	*keymap_sdl-graphics_FLTP*
 
 GUI
 *****


Commit: c3e879dd01b9bd206875a8e11229886e6b49153d
    https://github.com/scummvm/scummvm/commit/c3e879dd01b9bd206875a8e11229886e6b49153d
Author: antoniou79 (a.antoniou79 at gmail.com)
Date: 2023-07-01T13:14:38+03:00

Commit Message:
DOCS: Update scaler filter shortcuts in configuration_file

Changed paths:
    doc/docportal/advanced_topics/configuration_file.rst


diff --git a/doc/docportal/advanced_topics/configuration_file.rst b/doc/docportal/advanced_topics/configuration_file.rst
index ff87ba66500..7974d7fd91b 100755
--- a/doc/docportal/advanced_topics/configuration_file.rst
+++ b/doc/docportal/advanced_topics/configuration_file.rst
@@ -306,14 +306,8 @@ There are many recognized configuration keys. In the table below, each key is ei
 		":ref:`keymap_sdl-graphics_ASPT <ASPT>`",string,C+A+a,
 		":ref:`keymap_sdl-graphics_CAPT <CAPT>`",string,C+m,
 		":ref:`keymap_sdl-graphics_FILT <FILT>`",string,C+A+f
-		":ref:`keymap_sdl-graphics_FLT1 <FLT1>`",string,C+A+1
-		":ref:`keymap_sdl-graphics_FLT2 <FLT2>`",string,C+A+2
-		":ref:`keymap_sdl-graphics_FLT3 <FLT3>`",string,C+A+3
-		":ref:`keymap_sdl-graphics_FLT4 <FLT4>`",string,C+A+4
-		":ref:`keymap_sdl-graphics_FLT5 <FLT5>`",string,C+A+5
-		":ref:`keymap_sdl-graphics_FLT6 <FLT6>`",string, C+A+6
-		":ref:`keymap_sdl-graphics_FLT7 <FLT7>`",string,C+A+7
-		":ref:`keymap_sdl-graphics_FLT8 <FLT8>`",string,C+A+8
+		":ref:`keymap_sdl-graphics_FLTN <FLTN>`",string,C+A+0
+		":ref:`keymap_sdl-graphics_FLTP <FLTP>`",string,C+A+9
 		":ref:`keymap_sdl-graphics_FULS <FULS>`",string,A+RETURN
 		":ref:`keymap_sdl-graphics_SCL- <SCL>`",string,C+A+MINUS
 		":ref:`keymap_sdl-graphics_SCL+ <SCL>`",string,C+A+PLUS


Commit: 3f01c6d2d509bf69620e007d615258ae9a85200b
    https://github.com/scummvm/scummvm/commit/3f01c6d2d509bf69620e007d615258ae9a85200b
Author: antoniou79 (a.antoniou79 at gmail.com)
Date: 2023-07-01T13:14:44+03:00

Commit Message:
DOCS: Add cycle graphic filter shortcut under Software Scalers section

Changed paths:
    doc/docportal/advanced_topics/understand_graphics.rst


diff --git a/doc/docportal/advanced_topics/understand_graphics.rst b/doc/docportal/advanced_topics/understand_graphics.rst
index 09cd8ed390a..4989ed7006a 100644
--- a/doc/docportal/advanced_topics/understand_graphics.rst
+++ b/doc/docportal/advanced_topics/understand_graphics.rst
@@ -39,6 +39,8 @@ If the game originally ran at a resolution of 320x200—which is typical for mos
 
 There is always a speed penalty when using a scaler other than Normal 1x.
 
+To cycle forwards or backwards between graphical filters, press :kbd:`Ctrl + Alt` and :kbd:`0` or :kbd:`9` (respectively).
+
 .. figure:: ../images/graphics/graphics_mode/1x.png
 
     **Normal 1x**: No filtering, no scaling (original resolution). Fastest.


Commit: fa36266f981677f8492fd4c6ebff05a2b84c278b
    https://github.com/scummvm/scummvm/commit/fa36266f981677f8492fd4c6ebff05a2b84c278b
Author: antoniou79 (a.antoniou79 at gmail.com)
Date: 2023-07-01T13:14:51+03:00

Commit Message:
DOCS: use kbd prefix for 0 and 9 keys in shortcut

Changed paths:
    doc/docportal/use_scummvm/keyboard_shortcuts.rst


diff --git a/doc/docportal/use_scummvm/keyboard_shortcuts.rst b/doc/docportal/use_scummvm/keyboard_shortcuts.rst
index 332128ac91f..3d3d062c3ad 100755
--- a/doc/docportal/use_scummvm/keyboard_shortcuts.rst
+++ b/doc/docportal/use_scummvm/keyboard_shortcuts.rst
@@ -21,7 +21,7 @@ Default shortcuts are shown in the table.
         :kbd:`Ctrl+z`,Quit (other platforms)
         :kbd:`Ctrl+u` ,Mutes all sounds
         :kbd:`Ctrl+m` ,Toggles mouse capture
-        :kbd:`Ctrl+Alt` and `9` or `0` ,Cycles forwards/backwards between graphics filters
+        :kbd:`Ctrl+Alt` and :kbd:`9` or :kbd:`0`,Cycles forwards/backwards between graphics filters
         :kbd:`Ctrl+Alt` and :kbd:`+` or :kbd:`-`,Increases/decreases the scale factor
         :kbd:`Ctrl+Alt+a` ,Toggles aspect ratio correction on/off
         :kbd:`Ctrl+Alt+f` ,Toggles between nearest neighbor and bilinear interpolation (graphics filtering on/off)




More information about the Scummvm-git-logs mailing list