1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-12-13 10:13:06 +00:00

Dont use NormalizedView for yamlpath, use changeExtension, add setting to tests script

This commit is contained in:
Sam Hellawell 2024-07-20 20:15:17 +01:00
parent a7a105dfdd
commit b9a7bdc0c7
2 changed files with 5 additions and 6 deletions

View file

@ -762,13 +762,11 @@ namespace MWRender
{ {
// Note, even if the actual config is .json - we should send a .yaml path to AnimBlendRulesManager, the // Note, even if the actual config is .json - we should send a .yaml path to AnimBlendRulesManager, the
// manager will check for .json if it will not find a specified .yaml file. // manager will check for .json if it will not find a specified .yaml file.
auto yamlpath = kfname; VFS::Path::Normalized blendConfigPath(kfname);
Misc::StringUtils::replaceLast(yamlpath, ".kf", ".yaml"); blendConfigPath.changeExtension("yaml");
Misc::StringUtils::replaceLast(yamlpath, ".dae", ".yaml");
// globalBlendConfigPath is only used with actors! Objects have no default blending. // globalBlendConfigPath is only used with actors! Objects have no default blending.
constexpr VFS::Path::NormalizedView globalBlendConfigPath("animations/animation-config.yaml"); constexpr VFS::Path::NormalizedView globalBlendConfigPath("animations/animation-config.yaml");
const VFS::Path::NormalizedView blendConfigPath(yamlpath);
osg::ref_ptr<const SceneUtil::AnimBlendRules> blendRules; osg::ref_ptr<const SceneUtil::AnimBlendRules> blendRules;
if (mPtr.getClass().isActor()) if (mPtr.getClass().isActor())
@ -776,8 +774,8 @@ namespace MWRender
blendRules blendRules
= mResourceSystem->getAnimBlendRulesManager()->getRules(globalBlendConfigPath, blendConfigPath); = mResourceSystem->getAnimBlendRulesManager()->getRules(globalBlendConfigPath, blendConfigPath);
if (blendRules == nullptr) if (blendRules == nullptr)
Log(Debug::Warning) << "Unable to find animation blending rules: '" << yamlpath << "' or '" Log(Debug::Warning) << "Unable to find animation blending rules: '" << blendConfigPath << "' or '"
<< globalBlendConfigPath.value() << "'"; << globalBlendConfigPath << "'";
} }
else else
{ {

View file

@ -62,6 +62,7 @@ def runTest(name):
"resolution x = 640\n" "resolution x = 640\n"
"resolution y = 480\n" "resolution y = 480\n"
"framerate limit = 60\n" "framerate limit = 60\n"
"smooth animation transitions = true\n"
) )
stdout_lines = list() stdout_lines = list()
exit_ok = True exit_ok = True