code review changes and fixes

This commit is contained in:
ohyzha
2024-08-02 15:27:36 +03:00
parent e69a553b18
commit be549dccf6
18 changed files with 86 additions and 51 deletions

View File

@@ -90,11 +90,12 @@ namespace OpenVulkano
return Array<char>(buffer);
}
Array<char> WebResourceLoader::GetResource(const std::string& resourceName)
Array<char> WebResourceLoader::GetResource(const std::string& resourceName, std::string& resourcePath)
{
if (IsUrl(resourceName))
{
std::filesystem::path cacheFilePath = GetCacheFilePath(resourceName);
resourcePath = resourceName;
if (std::filesystem::exists(cacheFilePath)) { return Utils::ReadFile(cacheFilePath.string()); }
else { return DownloadResource(resourceName); }
}