mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-04-28 21:07:59 +03:00
Use normalized path for correctActorModelPath
This commit is contained in:
parent
376911f645
commit
afa769408a
10 changed files with 30 additions and 25 deletions
|
@ -121,7 +121,7 @@ namespace NavMeshTool
|
|||
|
||||
for (CellRef& cellRef : cellRefs)
|
||||
{
|
||||
std::string model(getModel(esmData, cellRef.mRefId, cellRef.mType));
|
||||
VFS::Path::Normalized model(getModel(esmData, cellRef.mRefId, cellRef.mType));
|
||||
if (model.empty())
|
||||
continue;
|
||||
|
||||
|
|
|
@ -47,7 +47,7 @@ namespace CSVRender
|
|||
mBaseNode->removeChildren(0, mBaseNode->getNumChildren());
|
||||
|
||||
// Load skeleton
|
||||
std::string skeletonModel = mActorData->getSkeleton();
|
||||
VFS::Path::Normalized skeletonModel = mActorData->getSkeleton();
|
||||
skeletonModel
|
||||
= Misc::ResourceHelpers::correctActorModelPath(skeletonModel, mData.getResourceSystem()->getVFS());
|
||||
loadSkeleton(skeletonModel);
|
||||
|
|
|
@ -413,8 +413,7 @@ namespace MWPhysics
|
|||
return;
|
||||
|
||||
const VFS::Path::Normalized animationMesh = ptr.getClass().useAnim()
|
||||
? VFS::Path::toNormalized(
|
||||
Misc::ResourceHelpers::correctActorModelPath(mesh.value(), mResourceSystem->getVFS()))
|
||||
? Misc::ResourceHelpers::correctActorModelPath(mesh, mResourceSystem->getVFS())
|
||||
: VFS::Path::Normalized(mesh);
|
||||
osg::ref_ptr<Resource::BulletShapeInstance> shapeInstance = mShapeManager->getInstance(animationMesh);
|
||||
if (!shapeInstance || !shapeInstance->mCollisionShape)
|
||||
|
@ -564,7 +563,7 @@ namespace MWPhysics
|
|||
void PhysicsSystem::addActor(const MWWorld::Ptr& ptr, VFS::Path::NormalizedView mesh)
|
||||
{
|
||||
const VFS::Path::Normalized animationMesh
|
||||
= Misc::ResourceHelpers::correctActorModelPath(mesh.value(), mResourceSystem->getVFS());
|
||||
= Misc::ResourceHelpers::correctActorModelPath(mesh, mResourceSystem->getVFS());
|
||||
osg::ref_ptr<const Resource::BulletShape> shape = mShapeManager->getShape(animationMesh);
|
||||
|
||||
// Try to get shape from basic model as fallback for creatures
|
||||
|
|
|
@ -1625,7 +1625,8 @@ namespace MWRender
|
|||
const bool werewolf = false;
|
||||
|
||||
defaultSkeleton = Misc::ResourceHelpers::correctActorModelPath(
|
||||
getActorSkeleton(firstPerson, isFemale, isBeast, werewolf), mResourceSystem->getVFS());
|
||||
VFS::Path::toNormalized(getActorSkeleton(firstPerson, isFemale, isBeast, werewolf)),
|
||||
mResourceSystem->getVFS());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -494,13 +494,14 @@ namespace MWRender
|
|||
}
|
||||
|
||||
const std::string defaultSkeleton = Misc::ResourceHelpers::correctActorModelPath(
|
||||
getActorSkeleton(is1stPerson, isFemale, isBeast, isWerewolf), mResourceSystem->getVFS());
|
||||
VFS::Path::toNormalized(getActorSkeleton(is1stPerson, isFemale, isBeast, isWerewolf)),
|
||||
mResourceSystem->getVFS());
|
||||
|
||||
std::string smodel = defaultSkeleton;
|
||||
bool isCustomModel = false;
|
||||
if (!is1stPerson && !isWerewolf && !mNpc->mModel.empty())
|
||||
{
|
||||
std::string model = Misc::ResourceHelpers::correctMeshPath(mNpc->mModel);
|
||||
VFS::Path::Normalized model = Misc::ResourceHelpers::correctMeshPath(mNpc->mModel);
|
||||
isCustomModel = !isDefaultActorSkeleton(model);
|
||||
smodel = Misc::ResourceHelpers::correctActorModelPath(model, mResourceSystem->getVFS());
|
||||
}
|
||||
|
|
|
@ -79,7 +79,8 @@ namespace MWRender
|
|||
std::string animationMesh = mesh;
|
||||
if (animated && !mesh.empty())
|
||||
{
|
||||
animationMesh = Misc::ResourceHelpers::correctActorModelPath(mesh, mResourceSystem->getVFS());
|
||||
animationMesh = Misc::ResourceHelpers::correctActorModelPath(
|
||||
VFS::Path::toNormalized(mesh), mResourceSystem->getVFS());
|
||||
if (animationMesh == mesh && Misc::StringUtils::ciEndsWith(animationMesh, ".nif"))
|
||||
animated = false;
|
||||
}
|
||||
|
@ -96,7 +97,8 @@ namespace MWRender
|
|||
ptr.getRefData().getBaseNode()->setNodeMask(Mask_Actor);
|
||||
|
||||
bool animated = true;
|
||||
std::string animationMesh = Misc::ResourceHelpers::correctActorModelPath(mesh, mResourceSystem->getVFS());
|
||||
std::string animationMesh
|
||||
= Misc::ResourceHelpers::correctActorModelPath(VFS::Path::toNormalized(mesh), mResourceSystem->getVFS());
|
||||
if (animationMesh == mesh && Misc::StringUtils::ciEndsWith(animationMesh, ".nif"))
|
||||
animated = false;
|
||||
|
||||
|
|
|
@ -1437,8 +1437,8 @@ namespace MWScript
|
|||
osg::Vec3f pos(ptr.getRefData().getPosition().asVec3());
|
||||
msg << "Coordinates: " << pos.x() << " " << pos.y() << " " << pos.z() << std::endl;
|
||||
auto vfs = MWBase::Environment::get().getResourceSystem()->getVFS();
|
||||
const VFS::Path::Normalized model(
|
||||
::Misc::ResourceHelpers::correctActorModelPath(ptr.getClass().getCorrectedModel(ptr), vfs));
|
||||
const VFS::Path::Normalized model = ::Misc::ResourceHelpers::correctActorModelPath(
|
||||
VFS::Path::toNormalized(ptr.getClass().getCorrectedModel(ptr)), vfs);
|
||||
msg << "Model: " << model.value() << std::endl;
|
||||
if (!model.empty())
|
||||
{
|
||||
|
|
|
@ -1126,8 +1126,9 @@ namespace MWWorld
|
|||
void Scene::preload(const std::string& mesh, bool useAnim)
|
||||
{
|
||||
const VFS::Path::Normalized meshPath = useAnim
|
||||
? Misc::ResourceHelpers::correctActorModelPath(mesh, mRendering.getResourceSystem()->getVFS())
|
||||
: mesh;
|
||||
? Misc::ResourceHelpers::correctActorModelPath(
|
||||
VFS::Path::toNormalized(mesh), mRendering.getResourceSystem()->getVFS())
|
||||
: VFS::Path::toNormalized(mesh);
|
||||
|
||||
if (mRendering.getResourceSystem()->getSceneManager()->checkLoaded(meshPath, mRendering.getReferenceTime()))
|
||||
return;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue