From 2ef5a8486d417312ff3c8b97f0d75d2ec61298d1 Mon Sep 17 00:00:00 2001 From: elsid Date: Thu, 19 Sep 2024 01:05:10 +0200 Subject: [PATCH] Use normalized path in ObjectPaging::createChunk --- apps/openmw/mwrender/objectpaging.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/apps/openmw/mwrender/objectpaging.cpp b/apps/openmw/mwrender/objectpaging.cpp index 6e39d99404..8040790bd7 100644 --- a/apps/openmw/mwrender/objectpaging.cpp +++ b/apps/openmw/mwrender/objectpaging.cpp @@ -20,6 +20,7 @@ #include #include #include +#include #include #include #include @@ -639,7 +640,7 @@ namespace MWRender continue; const int type = store.findStatic(ref.mRefId); - std::string model = getModel(type, ref.mRefId, store); + VFS::Path::Normalized model = getModel(type, ref.mRefId, store); if (model.empty()) continue; model = Misc::ResourceHelpers::correctMeshPath(model); @@ -647,10 +648,10 @@ namespace MWRender if (activeGrid && type != ESM::REC_STAT) { model = Misc::ResourceHelpers::correctActorModelPath(model, mSceneManager->getVFS()); - std::string kfname = Misc::StringUtils::lowerCase(model); - if (kfname.size() > 4 && kfname.ends_with(".nif")) + if (Misc::getFileExtension(model) == "nif") { - kfname.replace(kfname.size() - 4, 4, ".kf"); + VFS::Path::Normalized kfname = model; + kfname.changeExtension("kf"); if (mSceneManager->getVFS()->exists(kfname)) continue; } @@ -671,7 +672,7 @@ namespace MWRender ->second; } - osg::ref_ptr cnode = mSceneManager->getTemplate(VFS::Path::toNormalized(model), false); + osg::ref_ptr cnode = mSceneManager->getTemplate(model, false); if (activeGrid) {