[Scummvm-git-logs] scummvm master -> 30764bbc41a881ba50be19a69a7f4381a905707f
criezy
criezy at scummvm.org
Mon Jun 21 20:44:46 UTC 2021
This automated email contains information about 4 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
6227100f8f AGS: Fix regression in FillDirList
788f3f659d AGS: Fix regression with Text AA GUI option not working
edaabb3d9d AGS: Fix regression with GUI translation option not working
30764bbc41 AGS: Fix regression when trying to delete files
Commit: 6227100f8fd5d7224f81e768cf1312f2e2fe2cf9
https://github.com/scummvm/scummvm/commit/6227100f8fd5d7224f81e768cf1312f2e2fe2cf9
Author: Thierry Crozat (criezy at scummvm.org)
Date: 2021-06-21T21:05:09+01:00
Commit Message:
AGS: Fix regression in FillDirList
This reapply the changes from 8fb9b5f9 to properly list the files
in the game data dir and in the savegame dir.
This for example fixes listing *.tra files in the options in
Kathy Rain.
Changed paths:
engines/ags/engine/ac/file.cpp
engines/ags/engine/ac/listbox.cpp
diff --git a/engines/ags/engine/ac/file.cpp b/engines/ags/engine/ac/file.cpp
index 221bf97184..721eb9a703 100644
--- a/engines/ags/engine/ac/file.cpp
+++ b/engines/ags/engine/ac/file.cpp
@@ -339,9 +339,8 @@ bool ResolveScriptPath(const String &orig_sc_path, bool read_only, ResolvedPath
// which wants to create a new prog.bwl in the game folder
parent_dir = FSLocation(SAVE_FOLDER_PREFIX);
- if (read_only) {
- alt_path = sc_path;
- }
+ if (read_only)
+ alt_path = Path::ConcatPaths(_GP(ResPaths).DataDir, sc_path);
}
// Sometimes we have multiple consecutive slashes or backslashes.
diff --git a/engines/ags/engine/ac/listbox.cpp b/engines/ags/engine/ac/listbox.cpp
index 8044948d2b..83fc92e78f 100644
--- a/engines/ags/engine/ac/listbox.cpp
+++ b/engines/ags/engine/ac/listbox.cpp
@@ -21,6 +21,7 @@
*/
#include "common/config-manager.h"
+#include "common/savefile.h"
#include "ags/lib/std/algorithm.h"
#include "ags/lib/std/set.h"
#include "ags/lib/allegro.h" // find files
@@ -65,9 +66,25 @@ void ListBox_Clear(GUIListBox *listbox) {
}
void FillDirList(std::set<String> &files, const String &path) {
- Common::FSDirectory dir(path);
+ String dirName = Path::GetDirectoryPath(path);
+ String filePattern = Path::get_filename(path);
+
+ if (dirName.CompareLeftNoCase(_GP(ResPaths).DataDir) == 0) {
+ String subDir = dirName.Mid(_GP(ResPaths).DataDir.GetLength());
+ if (!subDir.IsEmpty() && subDir[0u] == '/')
+ subDir.ClipLeft(1);
+ dirName = ConfMan.get("path");
+ } else if (dirName.CompareLeftNoCase(get_save_game_directory()) == 0) {
+ // Save files listing
+ Common::StringArray matches = g_system->getSavefileManager()->listSavefiles(filePattern);
+ for (uint idx = 0; idx < matches.size(); ++idx)
+ files.insert(matches[idx]);
+ return;
+ }
+
+ Common::FSDirectory dir(dirName);
Common::ArchiveMemberList fileList;
- dir.listMatchingMembers(fileList, "*.*");
+ dir.listMatchingMembers(fileList, filePattern);
for (Common::ArchiveMemberList::iterator iter = fileList.begin(); iter != fileList.end(); ++iter) {
files.insert((*iter)->getName());
}
Commit: 788f3f659dc280d48b115ff7facb0c51bc0ef4da
https://github.com/scummvm/scummvm/commit/788f3f659dc280d48b115ff7facb0c51bc0ef4da
Author: Thierry Crozat (criezy at scummvm.org)
Date: 2021-06-21T21:14:22+01:00
Commit Message:
AGS: Fix regression with Text AA GUI option not working
Changed paths:
engines/ags/engine/ac/display.cpp
diff --git a/engines/ags/engine/ac/display.cpp b/engines/ags/engine/ac/display.cpp
index fa66e0a8af..169a9307ee 100644
--- a/engines/ags/engine/ac/display.cpp
+++ b/engines/ags/engine/ac/display.cpp
@@ -427,7 +427,7 @@ int GetTextDisplayTime(const char *text, int canberel) {
}
bool ShouldAntiAliasText() {
- return (_GP(game).options[OPT_ANTIALIASFONTS] != 0);
+ return (_GP(game).options[OPT_ANTIALIASFONTS] != 0 || ::AGS::g_vm->_forceTextAA);
}
void wouttext_outline(Shared::Bitmap *ds, int xxp, int yyp, int usingfont, color_t text_color, const char *texx) {
Commit: edaabb3d9dc07f4da095b55433ca2febf5ca66be
https://github.com/scummvm/scummvm/commit/edaabb3d9dc07f4da095b55433ca2febf5ca66be
Author: Thierry Crozat (criezy at scummvm.org)
Date: 2021-06-21T21:22:04+01:00
Commit Message:
AGS: Fix regression with GUI translation option not working
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 0c4c4be333..577a4f49ba 100644
--- a/engines/ags/engine/main/config.cpp
+++ b/engines/ags/engine/main/config.cpp
@@ -43,6 +43,7 @@
#include "ags/shared/util/path.h"
#include "ags/shared/util/string_utils.h"
#include "ags/engine/media/audio/audio_system.h"
+#include "common/config-manager.h"
namespace AGS3 {
@@ -354,7 +355,11 @@ void apply_config(const ConfigTree &cfg) {
_GP(usetup).user_data_dir = INIreadstring(cfg, "misc", "user_data_dir");
_GP(usetup).shared_data_dir = INIreadstring(cfg, "misc", "shared_data_dir");
- _GP(usetup).translation = INIreadstring(cfg, "language", "translation");
+ 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)
@@ -456,6 +461,13 @@ void save_config_file() {
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);
Commit: 30764bbc41a881ba50be19a69a7f4381a905707f
https://github.com/scummvm/scummvm/commit/30764bbc41a881ba50be19a69a7f4381a905707f
Author: Thierry Crozat (criezy at scummvm.org)
Date: 2021-06-21T21:41:58+01:00
Commit Message:
AGS: Fix regression when trying to delete files
This for examples fixes deleting savegames from the ingame save
dialog in QfG2 AGDI.
The issue is that the file name we get from get_save_game_path(int)
in DeleteSaveSlot(int) contains the "/saves/" prefix, so we
cannot directly pass it to the ScummVM savefile manager.
Changed paths:
engines/ags/engine/ac/file.cpp
engines/ags/engine/ac/global_game.cpp
diff --git a/engines/ags/engine/ac/file.cpp b/engines/ags/engine/ac/file.cpp
index 721eb9a703..ac918757b8 100644
--- a/engines/ags/engine/ac/file.cpp
+++ b/engines/ags/engine/ac/file.cpp
@@ -73,10 +73,10 @@ int File_Delete(const char *fnmm) {
if (!ResolveScriptPath(fnmm, false, rp))
return 0;
- if (::remove(rp.FullPath.GetCStr()) == 0)
+ if (File::DeleteFile(rp.FullPath))
return 1;
if (_G(errnum) == AL_ENOENT && !rp.AltPath.IsEmpty() && rp.AltPath.Compare(rp.FullPath) != 0)
- return ::remove(rp.AltPath.GetCStr()) == 0 ? 1 : 0;
+ return File::DeleteFile(rp.AltPath) ? 1 : 0;
return 0;
}
diff --git a/engines/ags/engine/ac/global_game.cpp b/engines/ags/engine/ac/global_game.cpp
index 862d046b27..2a32cdf1a5 100644
--- a/engines/ags/engine/ac/global_game.cpp
+++ b/engines/ags/engine/ac/global_game.cpp
@@ -111,8 +111,7 @@ void RestoreGameSlot(int slnum) {
void DeleteSaveSlot(int slnum) {
String nametouse;
nametouse = get_save_game_path(slnum);
-
- g_system->getSavefileManager()->removeSavefile(nametouse);
+ Shared::File::DeleteFile(nametouse);
}
void PauseGame() {
More information about the Scummvm-git-logs
mailing list