1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-03-22 07:21:26 +00:00

Use normalized path in ActorAnimation::attach

This commit is contained in:
elsid 2024-09-18 23:56:03 +02:00
parent a78f5182e4
commit f1533c215d
No known key found for this signature in database
GPG Key ID: 4DE04C198CBA7625
4 changed files with 8 additions and 7 deletions

View File

@ -88,10 +88,9 @@ namespace MWRender
}
osg::ref_ptr<osg::Node> ActorAnimation::attach(
const std::string& model, std::string_view bonename, std::string_view bonefilter, bool isLight)
VFS::Path::NormalizedView model, std::string_view bonename, std::string_view bonefilter, bool isLight)
{
osg::ref_ptr<const osg::Node> templateNode
= mResourceSystem->getSceneManager()->getTemplate(VFS::Path::toNormalized(model));
osg::ref_ptr<const osg::Node> templateNode = mResourceSystem->getSceneManager()->getTemplate(model);
const NodeMap& nodeMap = getNodeMap();
auto found = nodeMap.find(bonename);

View File

@ -5,6 +5,8 @@
#include <osg/ref_ptr>
#include <components/vfs/pathutil.hpp>
#include "../mwworld/containerstore.hpp"
#include "animation.hpp"
@ -59,7 +61,7 @@ namespace MWRender
return attachMesh(model, bonename, false, &stubColor);
}
osg::ref_ptr<osg::Node> attach(
const std::string& model, std::string_view bonename, std::string_view bonefilter, bool isLight);
VFS::Path::NormalizedView model, std::string_view bonename, std::string_view bonefilter, bool isLight);
PartHolderPtr mScabbard;
PartHolderPtr mHolsteredShield;

View File

@ -111,7 +111,7 @@ namespace MWRender
MWWorld::ConstPtr item = *it;
std::string_view bonename;
std::string itemModel = item.getClass().getCorrectedModel(item);
VFS::Path::Normalized itemModel = item.getClass().getCorrectedModel(item);
if (slot == MWWorld::InventoryStore::Slot_CarriedRight)
{
if (item.getType() == ESM::Weapon::sRecordId)

View File

@ -681,11 +681,11 @@ namespace MWRender
PartHolderPtr NpcAnimation::insertBoundedPart(const std::string& model, std::string_view bonename,
std::string_view bonefilter, bool enchantedGlow, osg::Vec4f* glowColor, bool isLight)
{
osg::ref_ptr<osg::Node> attached = attach(model, bonename, bonefilter, isLight);
osg::ref_ptr<osg::Node> attached = attach(VFS::Path::toNormalized(model), bonename, bonefilter, isLight);
if (enchantedGlow)
mGlowUpdater = SceneUtil::addEnchantedGlow(attached, mResourceSystem, *glowColor);
return std::make_unique<PartHolder>(attached);
return std::make_unique<PartHolder>(std::move(attached));
}
osg::Vec3f NpcAnimation::runAnimation(float timepassed)