From a03628acf307e07d383d8ab41c2a9ca73a052fb3 Mon Sep 17 00:00:00 2001 From: hyzboy Date: Mon, 13 Jan 2020 12:02:34 +0800 Subject: [PATCH] CreateSourceByFilesystem add uri check --- src/AssetsSourceFilesystem.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/AssetsSourceFilesystem.cpp b/src/AssetsSourceFilesystem.cpp index 83c7253..2edcc18 100644 --- a/src/AssetsSourceFilesystem.cpp +++ b/src/AssetsSourceFilesystem.cpp @@ -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