diff --git a/apps/openmw/mwworld/projectilemanager.cpp b/apps/openmw/mwworld/projectilemanager.cpp index 2c398db07d..382453e713 100644 --- a/apps/openmw/mwworld/projectilemanager.cpp +++ b/apps/openmw/mwworld/projectilemanager.cpp @@ -189,7 +189,7 @@ namespace MWWorld float mRotateSpeed; }; - void ProjectileManager::createModel(State& state, const std::string& model, const osg::Vec3f& pos, + void ProjectileManager::createModel(State& state, VFS::Path::NormalizedView model, const osg::Vec3f& pos, const osg::Quat& orient, bool rotate, bool createLight, osg::Vec4 lightDiffuseColor, const std::string& texture) { state.mNode = new osg::PositionAttitudeTransform; @@ -207,8 +207,7 @@ namespace MWWorld attachTo = rotateNode; } - osg::ref_ptr projectile - = mResourceSystem->getSceneManager()->getInstance(VFS::Path::toNormalized(model), attachTo); + osg::ref_ptr projectile = mResourceSystem->getSceneManager()->getInstance(model, attachTo); if (state.mIdMagic.size() > 1) { @@ -315,7 +314,7 @@ namespace MWWorld osg::Vec4 lightDiffuseColor = getMagicBoltLightDiffuseColor(state.mEffects); - auto model = ptr.getClass().getCorrectedModel(ptr); + VFS::Path::Normalized model = ptr.getClass().getCorrectedModel(ptr); createModel(state, model, pos, orient, true, true, lightDiffuseColor, texture); MWBase::SoundManager* sndMgr = MWBase::Environment::get().getSoundManager(); @@ -355,7 +354,7 @@ namespace MWWorld MWWorld::ManualRef ref(*MWBase::Environment::get().getESMStore(), projectile.getCellRef().getRefId()); MWWorld::Ptr ptr = ref.getPtr(); - const auto model = ptr.getClass().getCorrectedModel(ptr); + const VFS::Path::Normalized model = ptr.getClass().getCorrectedModel(ptr); createModel(state, model, pos, orient, false, false, osg::Vec4(0, 0, 0, 0)); if (!ptr.getClass().getEnchantment(ptr).empty()) SceneUtil::addEnchantedGlow(state.mNode, mResourceSystem, ptr.getClass().getEnchantmentColor(ptr)); @@ -695,7 +694,7 @@ namespace MWWorld state.mAttackStrength = esm.mAttackStrength; state.mToDelete = false; - std::string model; + VFS::Path::Normalized model; try { MWWorld::ManualRef ref(*MWBase::Environment::get().getESMStore(), esm.mId); @@ -750,7 +749,7 @@ namespace MWWorld // file's effect list, which is already trimmed of non-projectile // effects. We need to use the stored value. - std::string model; + VFS::Path::Normalized model; try { MWWorld::ManualRef ref(*MWBase::Environment::get().getESMStore(), state.mIdMagic.at(0)); diff --git a/apps/openmw/mwworld/projectilemanager.hpp b/apps/openmw/mwworld/projectilemanager.hpp index 012e3b5922..3003136ffc 100644 --- a/apps/openmw/mwworld/projectilemanager.hpp +++ b/apps/openmw/mwworld/projectilemanager.hpp @@ -7,6 +7,7 @@ #include #include +#include #include "../mwbase/soundmanager.hpp" @@ -135,7 +136,7 @@ namespace MWWorld void moveProjectiles(float dt); void moveMagicBolts(float dt); - void createModel(State& state, const std::string& model, const osg::Vec3f& pos, const osg::Quat& orient, + void createModel(State& state, VFS::Path::NormalizedView model, const osg::Vec3f& pos, const osg::Quat& orient, bool rotate, bool createLight, osg::Vec4 lightDiffuseColor, const std::string& texture = ""); void update(State& state, float duration);