|
|
@ -58,7 +58,7 @@ namespace Resource
|
|
|
|
|
|
|
|
|
|
|
|
osg::ref_ptr<const AnimBlendRules> AnimBlendRulesManager::loadRules(std::string_view path)
|
|
|
|
osg::ref_ptr<const AnimBlendRules> AnimBlendRulesManager::loadRules(std::string_view path)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
const VFS::Path::Normalized normalizedPath = VFS::Path::Normalized(path);
|
|
|
|
const VFS::Path::Normalized normalizedPath(path);
|
|
|
|
std::optional<osg::ref_ptr<osg::Object>> obj = mCache->getRefFromObjectCacheOrNone(normalizedPath);
|
|
|
|
std::optional<osg::ref_ptr<osg::Object>> obj = mCache->getRefFromObjectCacheOrNone(normalizedPath);
|
|
|
|
if (obj.has_value())
|
|
|
|
if (obj.has_value())
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -67,15 +67,7 @@ namespace Resource
|
|
|
|
else
|
|
|
|
else
|
|
|
|
{
|
|
|
|
{
|
|
|
|
osg::ref_ptr<AnimBlendRules> blendRules = AnimBlendRules::fromFile(mVfs, normalizedPath);
|
|
|
|
osg::ref_ptr<AnimBlendRules> blendRules = AnimBlendRules::fromFile(mVfs, normalizedPath);
|
|
|
|
if (blendRules == nullptr)
|
|
|
|
if (blendRules)
|
|
|
|
{
|
|
|
|
|
|
|
|
// No blend rules were found in VFS, cache a nullptr.
|
|
|
|
|
|
|
|
osg::ref_ptr<AnimBlendRules> nullRules = nullptr;
|
|
|
|
|
|
|
|
mCache->addEntryToObjectCache(normalizedPath, nullRules);
|
|
|
|
|
|
|
|
// To avoid confusion - never return blend rules with 0 rules
|
|
|
|
|
|
|
|
return nullRules;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
{
|
|
|
|
{
|
|
|
|
// Blend rules were found in VFS, cache them.
|
|
|
|
// Blend rules were found in VFS, cache them.
|
|
|
|
mCache->addEntryToObjectCache(normalizedPath, blendRules);
|
|
|
|
mCache->addEntryToObjectCache(normalizedPath, blendRules);
|
|
|
@ -83,7 +75,10 @@ namespace Resource
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return nullptr;
|
|
|
|
// No blend rules were found in VFS, cache a nullptr.
|
|
|
|
|
|
|
|
osg::ref_ptr<AnimBlendRules> nullRules = nullptr;
|
|
|
|
|
|
|
|
mCache->addEntryToObjectCache(normalizedPath, nullRules);
|
|
|
|
|
|
|
|
return nullRules;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void AnimBlendRulesManager::reportStats(unsigned int frameNumber, osg::Stats* stats) const
|
|
|
|
void AnimBlendRulesManager::reportStats(unsigned int frameNumber, osg::Stats* stats) const
|
|
|
|