1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-03-24 13:43:43 +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( 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 osg::ref_ptr<const osg::Node> templateNode = mResourceSystem->getSceneManager()->getTemplate(model);
= mResourceSystem->getSceneManager()->getTemplate(VFS::Path::toNormalized(model));
const NodeMap& nodeMap = getNodeMap(); const NodeMap& nodeMap = getNodeMap();
auto found = nodeMap.find(bonename); auto found = nodeMap.find(bonename);

View File

@ -5,6 +5,8 @@
#include <osg/ref_ptr> #include <osg/ref_ptr>
#include <components/vfs/pathutil.hpp>
#include "../mwworld/containerstore.hpp" #include "../mwworld/containerstore.hpp"
#include "animation.hpp" #include "animation.hpp"
@ -59,7 +61,7 @@ namespace MWRender
return attachMesh(model, bonename, false, &stubColor); return attachMesh(model, bonename, false, &stubColor);
} }
osg::ref_ptr<osg::Node> attach( 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 mScabbard;
PartHolderPtr mHolsteredShield; PartHolderPtr mHolsteredShield;

View File

@ -111,7 +111,7 @@ namespace MWRender
MWWorld::ConstPtr item = *it; MWWorld::ConstPtr item = *it;
std::string_view bonename; 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 (slot == MWWorld::InventoryStore::Slot_CarriedRight)
{ {
if (item.getType() == ESM::Weapon::sRecordId) 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, PartHolderPtr NpcAnimation::insertBoundedPart(const std::string& model, std::string_view bonename,
std::string_view bonefilter, bool enchantedGlow, osg::Vec4f* glowColor, bool isLight) 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) if (enchantedGlow)
mGlowUpdater = SceneUtil::addEnchantedGlow(attached, mResourceSystem, *glowColor); 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) osg::Vec3f NpcAnimation::runAnimation(float timepassed)