mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-10-01 14:58:14 +00:00
Prefer upper case PSP/SHADERS and PSP/THEMES
These two were lower case for legacy reasons, unlike every other directory, which actually matters on case sensitive file systems like the one iOS uses. An existing lower case directory is still used if there's no upper case one, so nobody has to move their files. Fixes #20527 Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01JvJR8oJNSCimCM9KXVLjfq
This commit is contained in:
1 parent
f10a62f23e
commit
b5bafa43b8
1 file changed
+18
-2
+18
-2
@@ -62,6 +62,22 @@ Path FindConfigFile(const Path &searchPath, std::string_view baseFilename, bool
|
||||
return filename;
|
||||
}
|
||||
|
||||
// The custom shader and theme directories are lower case for legacy reasons, which is confusing
|
||||
// since every other directory is upper case - and on a case sensitive file system, like the one
|
||||
// iOS uses, the case actually matters. So we prefer the upper case name now, but keep using a
|
||||
// lower case directory that already exists, so nobody has to move their files.
|
||||
static Path PreferUpperCaseDir(const Path &parent, const char *upperCase, const char *lowerCase) {
|
||||
const Path upper = parent / upperCase;
|
||||
if (File::Exists(upper)) {
|
||||
return upper;
|
||||
}
|
||||
const Path lower = parent / lowerCase;
|
||||
if (File::Exists(lower)) {
|
||||
return lower;
|
||||
}
|
||||
return upper;
|
||||
}
|
||||
|
||||
Path GetSysDirectory(PSPDirectories directoryType) {
|
||||
const Path &memStickDirectory = g_Config.memStickDirectory;
|
||||
Path pspDirectory;
|
||||
@@ -109,9 +125,9 @@ Path GetSysDirectory(PSPDirectories directoryType) {
|
||||
case DIRECTORY_AUDIO:
|
||||
return pspDirectory / "AUDIO";
|
||||
case DIRECTORY_CUSTOM_SHADERS:
|
||||
return pspDirectory / "shaders";
|
||||
return PreferUpperCaseDir(pspDirectory, "SHADERS", "shaders");
|
||||
case DIRECTORY_CUSTOM_THEMES:
|
||||
return pspDirectory / "themes";
|
||||
return PreferUpperCaseDir(pspDirectory, "THEMES", "themes");
|
||||
case DIRECTORY_NAND:
|
||||
return pspDirectory / "NAND";
|
||||
|
||||
|
||||
Reference in new issue
Block a user