WII: File system access performance optimization

Games load up to 30 times faster. For example, the Zork games took up to 10 minutes to start. Now they load in under 20 seconds. Similar improvements can be seen in the massadd feature.
This commit is contained in:
Alexander Reim 2020-09-26 17:54:50 +02:00
parent b4b91b1fad
commit 92e37fd810

View File

@ -152,8 +152,7 @@ bool WiiFilesystemNode::getChildren(AbstractFSList &list, ListMode mode, bool hi
if (_path.empty())
return getDevopChildren(list, mode, hidden);
DIR* dp = opendir (_path.c_str());
DIR* tmpdir;
DIR *dp = opendir (_path.c_str());
if (dp == NULL)
return false;
@ -169,13 +168,7 @@ bool WiiFilesystemNode::getChildren(AbstractFSList &list, ListMode mode, bool hi
newPath += '/';
newPath += pent->d_name;
bool isDir = false;
tmpdir = opendir(newPath.c_str());
if(tmpdir)
{
isDir = true;
closedir(tmpdir);
}
bool isDir = ( pent->d_type == DT_DIR );
if ((mode == Common::FSNode::kListFilesOnly && isDir) ||
(mode == Common::FSNode::kListDirectoriesOnly && !isDir))