From 63e44eddc9d53e5f43890c01a1a943536faece9b Mon Sep 17 00:00:00 2001 From: "florent.teppe" Date: Sat, 21 Jan 2023 15:03:13 +0100 Subject: [PATCH] Navigator doesn't use RefId anymore --- apps/openmw/mwworld/scene.cpp | 8 ++++---- components/detournavigator/navigator.hpp | 2 -- components/detournavigator/navigatorimpl.cpp | 5 ----- components/detournavigator/navigatorimpl.hpp | 2 -- components/detournavigator/navigatorstub.hpp | 1 - 5 files changed, 4 insertions(+), 14 deletions(-) diff --git a/apps/openmw/mwworld/scene.cpp b/apps/openmw/mwworld/scene.cpp index 5b008f10bf..aab2c4fc7f 100644 --- a/apps/openmw/mwworld/scene.cpp +++ b/apps/openmw/mwworld/scene.cpp @@ -541,7 +541,7 @@ namespace MWWorld } mNavigator.setWorldspace( - ESM::RefId::stringRefId( + Misc::StringUtils::lowerCase( mWorld.getWorldModel().getExterior(playerCellX, playerCellY)->getCell()->mCellId.mWorldspace), navigatorUpdateGuard.get()); mNavigator.updateBounds(pos, navigatorUpdateGuard.get()); @@ -665,7 +665,7 @@ namespace MWWorld CellStore* cell = mWorld.getWorldModel().getExterior(it->mData.mX, it->mData.mY); mNavigator.setWorldspace( - ESM::RefId::stringRefId(cell->getCell()->mCellId.mWorldspace), navigatorUpdateGuard.get()); + Misc::StringUtils::lowerCase(cell->getCell()->mCellId.mWorldspace), navigatorUpdateGuard.get()); const osg::Vec3f position = osg::Vec3f(it->mData.mX + 0.5f, it->mData.mY + 0.5f, 0) * Constants::CellSizeInUnits; mNavigator.updateBounds(position, navigatorUpdateGuard.get()); @@ -723,7 +723,7 @@ namespace MWWorld CellStore* cell = mWorld.getWorldModel().getInterior(it->mName); mNavigator.setWorldspace( - ESM::RefId::stringRefId(cell->getCell()->mCellId.mWorldspace), navigatorUpdateGuard.get()); + Misc::StringUtils::lowerCase(cell->getCell()->mCellId.mWorldspace), navigatorUpdateGuard.get()); ESM::Position position; mWorld.findInteriorPosition(it->mName, position); mNavigator.updateBounds(position.asVec3(), navigatorUpdateGuard.get()); @@ -880,7 +880,7 @@ namespace MWWorld loadingListener->setProgressRange(cell->count()); mNavigator.setWorldspace( - ESM::RefId::stringRefId(cell->getCell()->mCellId.mWorldspace), navigatorUpdateGuard.get()); + Misc::StringUtils::lowerCase(cell->getCell()->mCellId.mWorldspace), navigatorUpdateGuard.get()); mNavigator.updateBounds(position.asVec3(), navigatorUpdateGuard.get()); // Load cell. diff --git a/components/detournavigator/navigator.hpp b/components/detournavigator/navigator.hpp index 0891e77e46..dbe6e26dad 100644 --- a/components/detournavigator/navigator.hpp +++ b/components/detournavigator/navigator.hpp @@ -93,8 +93,6 @@ namespace DetourNavigator */ virtual void setWorldspace(std::string_view worldspace, const UpdateGuard* guard) = 0; - virtual void setWorldspace(const ESM::RefId& worldspace, const UpdateGuard* guard) = 0; - /** * @brief updateBounds should be called before adding object from loading cell * @param playerPosition corresponds to the bounds center diff --git a/components/detournavigator/navigatorimpl.cpp b/components/detournavigator/navigatorimpl.cpp index 5a71759a25..0978f69c24 100644 --- a/components/detournavigator/navigatorimpl.cpp +++ b/components/detournavigator/navigatorimpl.cpp @@ -39,11 +39,6 @@ namespace DetourNavigator mNavMeshManager.setWorldspace(worldspace, getImpl(guard)); } - void NavigatorImpl::setWorldspace(const ESM::RefId& worldspace, const UpdateGuard* guard) - { - setWorldspace(Misc::StringUtils::lowerCase(worldspace.getRefIdString()), guard); - } - void NavigatorImpl::updateBounds(const osg::Vec3f& playerPosition, const UpdateGuard* guard) { mNavMeshManager.updateBounds(playerPosition, getImpl(guard)); diff --git a/components/detournavigator/navigatorimpl.hpp b/components/detournavigator/navigatorimpl.hpp index 1778f81f98..14760341f8 100644 --- a/components/detournavigator/navigatorimpl.hpp +++ b/components/detournavigator/navigatorimpl.hpp @@ -29,8 +29,6 @@ namespace DetourNavigator void setWorldspace(std::string_view worldspace, const UpdateGuard* guard) override; - void setWorldspace(const ESM::RefId& worldspace, const UpdateGuard* guard) override; - void updateBounds(const osg::Vec3f& playerPosition, const UpdateGuard* guard) override; void addObject(const ObjectId id, const ObjectShapes& shapes, const btTransform& transform, diff --git a/components/detournavigator/navigatorstub.hpp b/components/detournavigator/navigatorstub.hpp index 2a87e381f7..5d55fde8a2 100644 --- a/components/detournavigator/navigatorstub.hpp +++ b/components/detournavigator/navigatorstub.hpp @@ -24,7 +24,6 @@ namespace DetourNavigator void removeAgent(const AgentBounds& /*agentBounds*/) override {} void setWorldspace(std::string_view /*worldspace*/, const UpdateGuard* /*guard*/) override {} - void setWorldspace(const ESM::RefId& /*worldspace*/, const UpdateGuard* /*guard*/) override {} void addObject(const ObjectId /*id*/, const ObjectShapes& /*shapes*/, const btTransform& /*transform*/, const UpdateGuard* /*guard*/) override