CreateSourceByFilesystem add uri check

This commit is contained in:
2020-01-13 12:02:34 +08:00
parent b622b98f79
commit a03628acf3

View File

@@ -39,15 +39,21 @@ namespace hgl
}
};//class AssetsSourceFilesytem:public AssetsSource
AssetsSource *CreateSourceByFilesystem(const OSString &path,const bool only_read)
AssetsSource *CreateSourceByFilesystem(const UTF8String &uri,const OSString &path,const bool only_read)
{
if(!uri.IsEmpty())
{
if(GetSource(uri))
return(nullptr);
}
if(path.IsEmpty())
return(nullptr);
if(!filesystem::IsDirectory(path))
return(nullptr);
return(new AssetsSourceFilesytem(path,only_read));
return(new AssetsSourceFilesytem(uri,path,only_read));
}
}//namespace assets
}//namespace hgl