From 98d97712e25c857b4b1546b2f5626f048442abb1 Mon Sep 17 00:00:00 2001 From: Kenix3 Date: Wed, 11 Dec 2024 21:30:58 -0500 Subject: [PATCH] Fixes name of private functions for ResourceIdentifier in ResourceManager. --- src/resource/ResourceManager.cpp | 22 +++++++++++----------- src/resource/ResourceManager.h | 4 ++-- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/resource/ResourceManager.cpp b/src/resource/ResourceManager.cpp index dfbda537f..98207fab8 100644 --- a/src/resource/ResourceManager.cpp +++ b/src/resource/ResourceManager.cpp @@ -75,17 +75,17 @@ std::shared_ptr ResourceManager::LoadFileProcess(const std::string& filePa return file; } -std::shared_ptr ResourceManager::LoadFileProcess(const ResourceIdentifier& cacheData, +std::shared_ptr ResourceManager::LoadFileProcess(const ResourceIdentifier& identifier, std::shared_ptr initData) { - if (cacheData.Parent == nullptr) { - return LoadFileProcess(cacheData.Path, initData); + if (identifier.Parent == nullptr) { + return LoadFileProcess(identifier.Path, initData); } - auto archive = cacheData.Parent; - auto file = archive->LoadFile(cacheData.Path, initData); + auto archive = identifier.Parent; + auto file = archive->LoadFile(identifier.Path, initData); if (file != nullptr) { SPDLOG_TRACE("Loaded File {} on ResourceManager", file->InitData->Path); } else { - SPDLOG_TRACE("Could not load File {} in ResourceManager", cacheData.Path); + SPDLOG_TRACE("Could not load File {} in ResourceManager", identifier.Path); } return file; } @@ -223,10 +223,10 @@ std::shared_ptr ResourceManager::LoadResource(const std::string& file } std::variant> -ResourceManager::CheckCache(const ResourceIdentifier& cacheData, bool loadExact) { - if (!loadExact && mAltAssetsEnabled && !cacheData.Path.starts_with(IResource::gAltAssetPrefix)) { - const auto altPath = IResource::gAltAssetPrefix + cacheData.Path; - auto altCacheResult = CheckCache({ altPath, cacheData.Owner, cacheData.Parent }, loadExact); +ResourceManager::CheckCache(const ResourceIdentifier& identifier, bool loadExact) { + if (!loadExact && mAltAssetsEnabled && !identifier.Path.starts_with(IResource::gAltAssetPrefix)) { + const auto altPath = IResource::gAltAssetPrefix + identifier.Path; + auto altCacheResult = CheckCache({ altPath, identifier.Owner, identifier.Parent }, loadExact); // If the type held at this cache index is a resource, then we return it. // Else we attempt to load standard definition assets. @@ -237,7 +237,7 @@ ResourceManager::CheckCache(const ResourceIdentifier& cacheData, bool loadExact) const std::lock_guard lock(mMutex); - auto cacheFind = mResourceCache.find(cacheData); + auto cacheFind = mResourceCache.find(identifier); if (cacheFind == mResourceCache.end()) { return ResourceLoadError::NotCached; } diff --git a/src/resource/ResourceManager.h b/src/resource/ResourceManager.h index 717abdaae..765038c60 100644 --- a/src/resource/ResourceManager.h +++ b/src/resource/ResourceManager.h @@ -87,9 +87,9 @@ class ResourceManager { void SetAltAssetsEnabled(bool isEnabled); protected: - std::variant> CheckCache(const ResourceIdentifier& cacheData, + std::variant> CheckCache(const ResourceIdentifier& identifier, bool loadExact = false); - std::shared_ptr LoadFileProcess(const ResourceIdentifier& cacheData, + std::shared_ptr LoadFileProcess(const ResourceIdentifier& identifier, std::shared_ptr initData = nullptr); std::variant> CheckCache(const std::string& filePath, bool loadExact = false);