Bladeren bron

Simplified code, as FileSystem already does the path access rights check.

Lasse Öörni 13 jaren geleden
bovenliggende
commit
35fa40c48f
2 gewijzigde bestanden met toevoegingen van 5 en 11 verwijderingen
  1. 4 10
      Engine/Resource/ResourceCache.cpp
  2. 1 1
      Engine/Resource/ResourceCache.h

+ 4 - 10
Engine/Resource/ResourceCache.cpp

@@ -375,11 +375,8 @@ SharedPtr<File> ResourceCache::GetFile(const String& nameIn)
                 return file;
             }
         }
-    }
-    
-    // Fallback using absolute path
-    if (fileSystem && !fileSystem->HasRegisteredPaths())
-    {
+        
+        // Fallback using absolute path
         if (fileSystem->FileExists(name))
             return SharedPtr<File>(new File(context_, name));
     }
@@ -472,11 +469,8 @@ bool ResourceCache::Exists(const String& nameIn) const
             if (fileSystem->FileExists(resourceDirs_[i] + name))
                 return true;
         }
-    }
-    
-    // Fallback using absolute path
-    if (fileSystem && !fileSystem->HasRegisteredPaths())
-    {
+        
+        // Fallback using absolute path
         if (fileSystem->FileExists(name))
             return true;
     }

+ 1 - 1
Engine/Resource/ResourceCache.h

@@ -90,7 +90,7 @@ public:
     /// Enable or disable automatic reloading of resources as files are modified.
     void SetAutoReloadResources(bool enable);
     
-    /// Open and return a file from the resource load paths or from inside a package file. If allowed paths have not been registered, also do a fallback search by interpreting the path as absolute. Return null if fails.
+    /// Open and return a file from the resource load paths or from inside a package file. If not found, use a fallback search with absolute path. Return null if fails.
     SharedPtr<File> GetFile(const String& name);
     /// Return a resource by type and name. Load if not loaded yet. Return null if fails.
     Resource* GetResource(ShortStringHash type, const String& name);