mirror of
https://github.com/libretro/scummvm.git
synced 2025-03-05 17:57:14 +00:00
MOHAWK: LB CD-ROM title prefixes aren't Windows-specific
svn-id: r55036
This commit is contained in:
parent
85da9de3bf
commit
4c0b02fe21
@ -595,7 +595,18 @@ int MohawkEngine_LivingBooks::getIntFromConfig(const Common::String §ion, co
|
|||||||
}
|
}
|
||||||
|
|
||||||
Common::String MohawkEngine_LivingBooks::getFileNameFromConfig(const Common::String §ion, const Common::String &key) {
|
Common::String MohawkEngine_LivingBooks::getFileNameFromConfig(const Common::String §ion, const Common::String &key) {
|
||||||
Common::String x = getStringFromConfig(section, key);
|
Common::String string = getStringFromConfig(section, key);
|
||||||
|
Common::String x;
|
||||||
|
|
||||||
|
uint32 i = 0;
|
||||||
|
if (string.hasPrefix("//")) {
|
||||||
|
// skip "//CD-ROM Title/" prefixes which we don't care about
|
||||||
|
i = 3;
|
||||||
|
while (i < string.size() && string[i - 1] != '/')
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
x = string.c_str() + i;
|
||||||
|
|
||||||
return (getPlatform() == Common::kPlatformMacintosh) ? convertMacFileName(x) : convertWinFileName(x);
|
return (getPlatform() == Common::kPlatformMacintosh) ? convertMacFileName(x) : convertWinFileName(x);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -633,15 +644,7 @@ Common::String MohawkEngine_LivingBooks::convertMacFileName(const Common::String
|
|||||||
Common::String MohawkEngine_LivingBooks::convertWinFileName(const Common::String &string) {
|
Common::String MohawkEngine_LivingBooks::convertWinFileName(const Common::String &string) {
|
||||||
Common::String filename;
|
Common::String filename;
|
||||||
|
|
||||||
uint32 i = 0;
|
for (uint32 i = 0; i < string.size(); i++) {
|
||||||
if (string.hasPrefix("//")) {
|
|
||||||
// skip "//CD-ROM Title/" prefixes which we don't care about
|
|
||||||
i = 3;
|
|
||||||
while (i < string.size() && string[i - 1] != '/')
|
|
||||||
i++;
|
|
||||||
}
|
|
||||||
|
|
||||||
for (; i < string.size(); i++) {
|
|
||||||
if (string[i] == '\\')
|
if (string[i] == '\\')
|
||||||
filename += '/';
|
filename += '/';
|
||||||
else
|
else
|
||||||
|
Loading…
x
Reference in New Issue
Block a user