diff --git a/apps/openmw/mwclass/classmodel.hpp b/apps/openmw/mwclass/classmodel.hpp index f063ae7292..0f633f37bf 100644 --- a/apps/openmw/mwclass/classmodel.hpp +++ b/apps/openmw/mwclass/classmodel.hpp @@ -4,7 +4,6 @@ #include "../mwworld/livecellref.hpp" #include "../mwworld/ptr.hpp" -#include #include namespace MWClass diff --git a/apps/openmw/mwclass/npc.cpp b/apps/openmw/mwclass/npc.cpp index cc4a124ec2..22c953d27d 100644 --- a/apps/openmw/mwclass/npc.cpp +++ b/apps/openmw/mwclass/npc.cpp @@ -441,15 +441,15 @@ namespace MWClass return model.substr(prefix.size()); } - std::string Npc::getCorrectedModel(const MWWorld::ConstPtr& ptr) const + VFS::Path::Normalized Npc::getCorrectedModel(const MWWorld::ConstPtr& ptr) const { const MWWorld::LiveCellRef* ref = ptr.get(); const ESM::Race* race = MWBase::Environment::get().getESMStore()->get().find(ref->mBase->mRace); if (race->mData.mFlags & ESM::Race::Beast) - return Settings::models().mBaseanimkna.get().value(); + return Settings::models().mBaseanimkna.get(); - return Settings::models().mBaseanim.get().value(); + return Settings::models().mBaseanim.get(); } void Npc::getModelsToPreload(const MWWorld::ConstPtr& ptr, std::vector& models) const diff --git a/apps/openmw/mwclass/npc.hpp b/apps/openmw/mwclass/npc.hpp index 1d70c5e1ba..29ab459242 100644 --- a/apps/openmw/mwclass/npc.hpp +++ b/apps/openmw/mwclass/npc.hpp @@ -133,7 +133,7 @@ namespace MWClass std::string_view getModel(const MWWorld::ConstPtr& ptr) const override; - std::string getCorrectedModel(const MWWorld::ConstPtr& ptr) const override; + VFS::Path::Normalized getCorrectedModel(const MWWorld::ConstPtr& ptr) const override; float getSkill(const MWWorld::Ptr& ptr, ESM::RefId id) const override; diff --git a/apps/openmw/mwscript/miscextensions.cpp b/apps/openmw/mwscript/miscextensions.cpp index 5d5f6be529..72faf0afa9 100644 --- a/apps/openmw/mwscript/miscextensions.cpp +++ b/apps/openmw/mwscript/miscextensions.cpp @@ -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( - VFS::Path::toNormalized(ptr.getClass().getCorrectedModel(ptr)), vfs); + const VFS::Path::Normalized model + = ::Misc::ResourceHelpers::correctActorModelPath(ptr.getClass().getCorrectedModel(ptr), vfs); msg << "Model: " << model.value() << std::endl; if (!model.empty()) { diff --git a/apps/openmw/mwworld/class.cpp b/apps/openmw/mwworld/class.cpp index 26100551e8..105fbca80a 100644 --- a/apps/openmw/mwworld/class.cpp +++ b/apps/openmw/mwworld/class.cpp @@ -311,7 +311,7 @@ namespace MWWorld return {}; } - std::string Class::getCorrectedModel(const MWWorld::ConstPtr& ptr) const + VFS::Path::Normalized Class::getCorrectedModel(const MWWorld::ConstPtr& ptr) const { std::string_view model = getModel(ptr); if (!model.empty()) diff --git a/apps/openmw/mwworld/class.hpp b/apps/openmw/mwworld/class.hpp index 0c6d55692f..d3d75aa935 100644 --- a/apps/openmw/mwworld/class.hpp +++ b/apps/openmw/mwworld/class.hpp @@ -17,6 +17,7 @@ #include #include +#include namespace ESM { @@ -277,7 +278,7 @@ namespace MWWorld virtual std::string_view getModel(const MWWorld::ConstPtr& ptr) const; - virtual std::string getCorrectedModel(const MWWorld::ConstPtr& ptr) const; + virtual VFS::Path::Normalized getCorrectedModel(const MWWorld::ConstPtr& ptr) const; virtual bool useAnim() const; ///< Whether or not to use animated variant of model (default false) diff --git a/apps/openmw/mwworld/scene.cpp b/apps/openmw/mwworld/scene.cpp index 275e152b29..c30c2b5af0 100644 --- a/apps/openmw/mwworld/scene.cpp +++ b/apps/openmw/mwworld/scene.cpp @@ -95,7 +95,7 @@ namespace rendering.rotateObject(ptr, rotation); } - std::string getModel(const MWWorld::Ptr& ptr) + VFS::Path::Normalized getModel(const MWWorld::Ptr& ptr) { if (Misc::ResourceHelpers::isHiddenMarker(ptr.getCellRef().getRefId())) return {}; @@ -115,7 +115,7 @@ namespace return; } - std::string model = getModel(ptr); + const VFS::Path::Normalized model = getModel(ptr); const auto rotation = makeDirectNodeRotation(ptr); ESM::RefNum refnum = ptr.getCellRef().getRefNum(); @@ -706,7 +706,7 @@ namespace MWWorld ptr.mRef->mData.mPhysicsPostponed = false; if (ptr.mRef->mData.isEnabled() && ptr.mRef->mRef.getCount() > 0) { - std::string model = getModel(ptr); + const VFS::Path::Normalized model = getModel(ptr); if (!model.empty()) { const auto rotation = makeNodeRotation(ptr, RotationOrder::direct); diff --git a/apps/openmw/mwworld/worldimp.cpp b/apps/openmw/mwworld/worldimp.cpp index cfbf8311ee..c541c6003a 100644 --- a/apps/openmw/mwworld/worldimp.cpp +++ b/apps/openmw/mwworld/worldimp.cpp @@ -2325,8 +2325,7 @@ namespace MWWorld MWBase::Environment::get().getWindowManager()->watchActor(getPlayerPtr()); mPhysics->remove(getPlayerPtr()); - mPhysics->addActor( - getPlayerPtr(), VFS::Path::toNormalized(getPlayerPtr().getClass().getCorrectedModel(getPlayerPtr()))); + mPhysics->addActor(getPlayerPtr(), getPlayerPtr().getClass().getCorrectedModel(getPlayerPtr())); applyLoopingParticles(player);