[Scummvm-git-logs] scummvm master -> c67e41688ccfa42dbbac81ea6096a9542e434057

sluicebox noreply at scummvm.org
Thu Dec 5 23:01:26 UTC 2024


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

Summary:
c67e41688c GUI: Fix Rotation mode option


Commit: c67e41688ccfa42dbbac81ea6096a9542e434057
    https://github.com/scummvm/scummvm/commit/c67e41688ccfa42dbbac81ea6096a9542e434057
Author: sluicebox (22204938+sluicebox at users.noreply.github.com)
Date: 2024-12-05T15:01:22-08:00

Commit Message:
GUI: Fix Rotation mode option

- Changing rotation back to "<default>" had no effect
- Unchecking "Override" checkbox did not change rotation
- "Override" checkbox initialization was not affected by rotation

Changed paths:
    gui/editgamedialog.cpp
    gui/options.cpp


diff --git a/gui/editgamedialog.cpp b/gui/editgamedialog.cpp
index d7a9cf1888d..173ffc75f56 100644
--- a/gui/editgamedialog.cpp
+++ b/gui/editgamedialog.cpp
@@ -400,6 +400,7 @@ void EditGameDialog::open() {
 
 	e = ConfMan.hasKey("gfx_mode", _domain) ||
 		ConfMan.hasKey("render_mode", _domain) ||
+		ConfMan.hasKey("rotation_mode", _domain) ||
 		ConfMan.hasKey("stretch_mode", _domain) ||
 		ConfMan.hasKey("scaler", _domain) ||
 		ConfMan.hasKey("scale_factor", _domain) ||
diff --git a/gui/options.cpp b/gui/options.cpp
index 5866e2b6069..448195bfe3d 100644
--- a/gui/options.cpp
+++ b/gui/options.cpp
@@ -681,11 +681,18 @@ void OptionsDialog::apply() {
 			if (g_system->hasFeature(OSystem::kFeatureRotationMode)) {
 				if ((int32)_rotationModePopUp->getSelectedTag() >= 0) {
 					int rotationModeCode = ((Common::RotationMode)_rotationModePopUp->getSelectedTag());
-					if (_rotationModePopUp->getSelectedTag() == 0 || ConfMan.getInt("rotation_mode", _domain) != rotationModeCode) {
+					if (!ConfMan.hasKey("rotation_mode", _domain) ||
+						ConfMan.getInt("rotation_mode", _domain) != rotationModeCode) {
 						ConfMan.setInt("rotation_mode", rotationModeCode, _domain);
 						_rotationModePopUpDesc->setFontColor(ThemeEngine::FontColor::kFontColorNormal);
+						graphicsModeChanged = true;
+					}
+				} else {
+					// default selected
+					if (ConfMan.hasKey("rotation_mode", _domain)) {
+						ConfMan.removeKey("rotation_mode", _domain);
+						graphicsModeChanged = true;
 					}
-					g_system->setFeatureState(OSystem::kFeatureRotationMode, true);
 				}
 			}
 
@@ -775,6 +782,7 @@ void OptionsDialog::apply() {
 			ConfMan.removeKey("scaler", _domain);
 			ConfMan.removeKey("scale_factor", _domain);
 			ConfMan.removeKey("render_mode", _domain);
+			ConfMan.removeKey("rotation_mode", _domain);
 			ConfMan.removeKey("renderer", _domain);
 			ConfMan.removeKey("antialiasing", _domain);
 			ConfMan.removeKey("vsync", _domain);
@@ -826,6 +834,10 @@ void OptionsDialog::apply() {
 		if (ConfMan.hasKey("vsync"))
 			g_system->setFeatureState(OSystem::kFeatureVSync, ConfMan.getBool("vsync", _domain));
 
+		if (g_system->hasFeature(OSystem::kFeatureRotationMode)) {
+			g_system->setFeatureState(OSystem::kFeatureRotationMode, ConfMan.hasKey("rotation_mode", _domain));
+		}
+
 		OSystem::TransactionError gfxError = g_system->endGFXTransaction();
 
 		// Since this might change the screen resolution we need to give




More information about the Scummvm-git-logs mailing list