Simulates memory stick size to get fixed free space.
Some games may be sensitive to the changes of free space of memory stick, and Android's free space is usually variable.
This commit is contained in:
parent
f0ea814107
commit
166035a87b
6 changed files with 28 additions and 6 deletions
|
@ -669,3 +669,17 @@ void MetaFileSystem::DoState(PointerWrap &p)
|
|||
}
|
||||
}
|
||||
|
||||
u64 MetaFileSystem::getDirSize(const std::string &dirPath) {
|
||||
u64 result = 0;
|
||||
auto allFiles = GetDirListing(dirPath);
|
||||
for (auto file : allFiles) {
|
||||
if (file.name == "." || file.name == "..")
|
||||
continue;
|
||||
if (file.type == FILETYPE_DIRECTORY) {
|
||||
result += getDirSize(dirPath + file.name + "/");
|
||||
} else {
|
||||
result += file.size;
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue