[Scummvm-git-logs] scummvm branch-2-7 -> 43a0e5531fde52d5ce98fb5a0548f01a54b3f76b

antoniou79 noreply at scummvm.org
Sat Jul 1 11:43:05 UTC 2023


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

Summary:
cc73fd7f5f GUI: Ommit aspect ratio checkbox if this feature is missing
43a0e5531f BACKENDS: OPENGL: Don't depend on USE_ASPECT


Commit: cc73fd7f5f9984ce30ddb0cb5ab6b30b179e29da
    https://github.com/scummvm/scummvm/commit/cc73fd7f5f9984ce30ddb0cb5ab6b30b179e29da
Author: antoniou79 (a.antoniou79 at gmail.com)
Date: 2023-07-01T14:42:49+03:00

Commit Message:
GUI: Ommit aspect ratio checkbox if this feature is missing

Also fix compilation when building for --disable-aspect (buggy end bracket in backends/graphics/surfacesdl/surfacesdl-graphics.cpp)

Changed paths:
    backends/graphics/opengl/opengl-graphics.cpp
    backends/graphics/surfacesdl/surfacesdl-graphics.cpp
    gui/options.cpp


diff --git a/backends/graphics/opengl/opengl-graphics.cpp b/backends/graphics/opengl/opengl-graphics.cpp
index 9141416572a..62b1be501f2 100644
--- a/backends/graphics/opengl/opengl-graphics.cpp
+++ b/backends/graphics/opengl/opengl-graphics.cpp
@@ -108,7 +108,9 @@ OpenGLGraphicsManager::~OpenGLGraphicsManager() {
 
 bool OpenGLGraphicsManager::hasFeature(OSystem::Feature f) const {
 	switch (f) {
+#ifdef USE_ASPECT
 	case OSystem::kFeatureAspectRatioCorrection:
+#endif
 	case OSystem::kFeatureCursorPalette:
 	case OSystem::kFeatureFilteringMode:
 	case OSystem::kFeatureStretchMode:
diff --git a/backends/graphics/surfacesdl/surfacesdl-graphics.cpp b/backends/graphics/surfacesdl/surfacesdl-graphics.cpp
index 0256b2d8436..4a536b1f0a5 100644
--- a/backends/graphics/surfacesdl/surfacesdl-graphics.cpp
+++ b/backends/graphics/surfacesdl/surfacesdl-graphics.cpp
@@ -1381,8 +1381,8 @@ void SurfaceSdlGraphicsManager::internUpdateScreen() {
 #ifdef USE_ASPECT
 				if (_videoMode.aspectRatioCorrection && orig_dst_y < height && !_overlayInGUI)
 					r->h = stretch200To240((uint8 *) _hwScreen->pixels, dstPitch, r->w, r->h, r->x, r->y, orig_dst_y * scale1, _videoMode.filtering, 	convertSDLPixelFormat(_hwScreen->format));
-			}
 #endif
+			}
 		}
 		SDL_UnlockSurface(srcSurf);
 		SDL_UnlockSurface(_hwScreen);
diff --git a/gui/options.cpp b/gui/options.cpp
index 5b0e45fa6fc..c86f701e0b8 100644
--- a/gui/options.cpp
+++ b/gui/options.cpp
@@ -366,12 +366,14 @@ void OptionsDialog::build() {
 		}
 
 		// Aspect ratio setting
-		if (_guioptions.contains(GUIO_NOASPECT)) {
-			_aspectCheckbox->setState(false);
-			_aspectCheckbox->setEnabled(false);
-		} else {
-			_aspectCheckbox->setEnabled(true);
-			_aspectCheckbox->setState(ConfMan.getBool("aspect_ratio", _domain));
+		if (g_system->hasFeature(OSystem::kFeatureAspectRatioCorrection)) {
+			if (_guioptions.contains(GUIO_NOASPECT)) {
+				_aspectCheckbox->setState(false);
+				_aspectCheckbox->setEnabled(false);
+			} else {
+				_aspectCheckbox->setEnabled(true);
+				_aspectCheckbox->setState(ConfMan.getBool("aspect_ratio", _domain));
+			}
 		}
 
 		if (g_system->hasFeature(OSystem::kFeatureVSync)) {
@@ -612,8 +614,10 @@ void OptionsDialog::apply() {
 				ConfMan.setBool("fullscreen", _fullscreenCheckbox->getState(), _domain);
 				_fullscreenCheckbox->setOverride(false);
 			}
-			if (ConfMan.getBool("aspect_ratio", _domain) != _aspectCheckbox->getState())
-				graphicsModeChanged = true;
+			if (g_system->hasFeature(OSystem::kFeatureAspectRatioCorrection)) {
+				if (ConfMan.getBool("aspect_ratio", _domain) != _aspectCheckbox->getState())
+					graphicsModeChanged = true;
+			}
 			if (g_system->hasFeature(OSystem::kFeatureVSync)) {
 				if (ConfMan.getBool("vsync", _domain) != _vsyncCheckbox->getState()) {
 					graphicsModeChanged = true;
@@ -622,7 +626,9 @@ void OptionsDialog::apply() {
 				}
 			}
 
-			ConfMan.setBool("aspect_ratio", _aspectCheckbox->getState(), _domain);
+			if (g_system->hasFeature(OSystem::kFeatureAspectRatioCorrection)) {
+				ConfMan.setBool("aspect_ratio", _aspectCheckbox->getState(), _domain);
+			}
 
 			bool isSet = false;
 
@@ -1291,10 +1297,12 @@ void OptionsDialog::setGraphicSettingsState(bool enabled) {
 	else
 		_fullscreenCheckbox->setEnabled(false);
 
-	if (_guioptions.contains(GUIO_NOASPECT))
-		_aspectCheckbox->setEnabled(false);
-	else
-		_aspectCheckbox->setEnabled(enabled);
+	if (g_system->hasFeature(OSystem::kFeatureAspectRatioCorrection)) {
+		if (_guioptions.contains(GUIO_NOASPECT))
+			_aspectCheckbox->setEnabled(false);
+		else
+			_aspectCheckbox->setEnabled(enabled);
+	}
 
 	if (g_system->hasFeature(OSystem::kFeatureVSync))
 		_vsyncCheckbox->setEnabled(enabled);
@@ -1699,7 +1707,8 @@ void OptionsDialog::addGraphicControls(GuiObject *boss, const Common::String &pr
 		_filteringCheckbox = new CheckboxWidget(boss, prefix + "grFilteringCheckbox", _("Filter graphics"), _("Use linear filtering when scaling graphics"));
 
 	// Aspect ratio checkbox
-	_aspectCheckbox = new CheckboxWidget(boss, prefix + "grAspectCheckbox", _("Aspect ratio correction"), _("Correct aspect ratio for games"));
+	if (g_system->hasFeature(OSystem::kFeatureAspectRatioCorrection))
+		_aspectCheckbox = new CheckboxWidget(boss, prefix + "grAspectCheckbox", _("Aspect ratio correction"), _("Correct aspect ratio for games"));
 
 	_enableGraphicSettings = true;
 }
@@ -2047,7 +2056,9 @@ void OptionsDialog::setupGraphicsTab() {
 	if (g_system->hasFeature(OSystem::kFeatureFilteringMode))
 		_filteringCheckbox->setVisible(true);
 
-	_aspectCheckbox->setVisible(true);
+	if (g_system->hasFeature(OSystem::kFeatureAspectRatioCorrection))
+		_aspectCheckbox->setVisible(true);
+
 	_renderModePopUpDesc->setVisible(true);
 	_renderModePopUp->setVisible(true);
 


Commit: 43a0e5531fde52d5ce98fb5a0548f01a54b3f76b
    https://github.com/scummvm/scummvm/commit/43a0e5531fde52d5ce98fb5a0548f01a54b3f76b
Author: Le Philousophe (lephilousophe at users.noreply.github.com)
Date: 2023-07-01T14:42:58+03:00

Commit Message:
BACKENDS: OPENGL: Don't depend on USE_ASPECT

USE_ASPECT disables software aspect ratio correction.
In OpenGL it's done by GPU.

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


diff --git a/backends/graphics/opengl/opengl-graphics.cpp b/backends/graphics/opengl/opengl-graphics.cpp
index 62b1be501f2..9141416572a 100644
--- a/backends/graphics/opengl/opengl-graphics.cpp
+++ b/backends/graphics/opengl/opengl-graphics.cpp
@@ -108,9 +108,7 @@ OpenGLGraphicsManager::~OpenGLGraphicsManager() {
 
 bool OpenGLGraphicsManager::hasFeature(OSystem::Feature f) const {
 	switch (f) {
-#ifdef USE_ASPECT
 	case OSystem::kFeatureAspectRatioCorrection:
-#endif
 	case OSystem::kFeatureCursorPalette:
 	case OSystem::kFeatureFilteringMode:
 	case OSystem::kFeatureStretchMode:




More information about the Scummvm-git-logs mailing list