[Scummvm-git-logs] scummvm master -> 67634d9d7c1a7d6c07e4912aefae82deda896b6d

dreammaster dreammaster at scummvm.org
Sat Jun 26 03:16:56 UTC 2021


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:
67634d9d7c AGS: Ignore any language setting from original cfg file


Commit: 67634d9d7c1a7d6c07e4912aefae82deda896b6d
    https://github.com/scummvm/scummvm/commit/67634d9d7c1a7d6c07e4912aefae82deda896b6d
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2021-06-25T20:16:44-07:00

Commit Message:
AGS: Ignore any language setting from original cfg file

Changed paths:
    engines/ags/engine/main/config.cpp


diff --git a/engines/ags/engine/main/config.cpp b/engines/ags/engine/main/config.cpp
index 577a4f49ba..b92e9a5b4d 100644
--- a/engines/ags/engine/main/config.cpp
+++ b/engines/ags/engine/main/config.cpp
@@ -358,8 +358,6 @@ void apply_config(const ConfigTree &cfg) {
 		Common::String translation;
 		if (ConfMan.getActiveDomain()->tryGetVal("translation", translation) && !translation.empty())
 			_GP(usetup).translation = translation;
-		else
-			_GP(usetup).translation = INIreadstring(cfg, "language", "translation");
 
 		int cache_size_kb = INIreadint(cfg, "misc", "cachemax", DEFAULTCACHESIZE_KB);
 		if (cache_size_kb > 0)
@@ -429,49 +427,6 @@ void post_config() {
 
 void save_config_file() {
 	// ScummVM doesn't write out any configuration changes
-#if !AGS_PLATFORM_SCUMMVM
-	ConfigTree cfg;
-
-	// Last display mode
-	// TODO: force_window check is a temporary workaround (see comment below)
-	if (_G(force_window) == 0) {
-		bool is_windowed = System_GetWindowed() != 0;
-		cfg["graphics"]["windowed"] = String::FromFormat("%d", is_windowed ? 1 : 0);
-		// TODO: this is a hack, necessary because the original config system was designed when
-		// switching mode at runtime was not considered a possibility.
-		// Normally, two changes need to be done here:
-		// * the display setup needs to be reviewed and simplified a bit.
-		// * perhaps there should be two saved setups for fullscreen and windowed saved in memory
-		// (like ActiveDisplaySetting is saved currently), to know how the window size is defined
-		// in each modes (by explicit width/height values or from game scaling).
-		// This specifically *must* be done if there will be script API for modifying fullscreen
-		// resolution, or size of the window could be changed any way at runtime.
-		if (is_windowed != _GP(usetup).Screen.DisplayMode.Windowed) {
-			if (is_windowed)
-				cfg["graphics"]["screen_def"] = "scaling";
-			else
-				cfg["graphics"]["screen_def"] = "max";
-		}
-	}
-
-	// Other game options that could be changed at runtime
-	if (_GP(game).options[OPT_RENDERATSCREENRES] == kRenderAtScreenRes_UserDefined)
-		cfg["graphics"]["render_at_screenres"] = String::FromFormat("%d", _GP(usetup).RenderAtScreenRes ? 1 : 0);
-	cfg["mouse"]["control_enabled"] = String::FromFormat("%d", _GP(usetup).mouse_ctrl_enabled ? 1 : 0);
-	cfg["mouse"]["speed"] = String::FromFormat("%f", _GP(mouse).GetSpeed());
-	cfg["language"]["translation"] = _GP(usetup).translation;
-
-	if (_GP(usetup).translation.empty()) {
-		if (ConfMan.getActiveDomain()->contains("translation"))
-			ConfMan.getActiveDomain()->erase("translation");
-	} else
-		ConfMan.getActiveDomain()->setVal("translation", _GP(usetup).translation);
-	ConfMan.flushToDisk();
-
-	String cfg_file = PreparePathForWriting(GetGameUserConfigDir(), DefaultConfigFileName);
-	if (!cfg_file.IsEmpty())
-		IniUtil::Merge(cfg_file, cfg);
-#endif
 }
 
 } // namespace AGS3




More information about the Scummvm-git-logs mailing list