mirror of
https://github.com/OpenMW/openmw.git
synced 2025-01-16 15:29:55 +00:00
setworldspace uses serializeText
This commit is contained in:
parent
21bd28542a
commit
3258fa4f98
2 changed files with 13 additions and 12 deletions
|
@ -263,17 +263,18 @@ namespace NavMeshTool
|
||||||
|
|
||||||
const osg::Vec2i cellPosition(cell.mData.mX, cell.mData.mY);
|
const osg::Vec2i cellPosition(cell.mData.mX, cell.mData.mY);
|
||||||
const std::size_t cellObjectsBegin = data.mObjects.size();
|
const std::size_t cellObjectsBegin = data.mObjects.size();
|
||||||
const auto cellNameLowerCase
|
const auto cellWorldspace = Misc::StringUtils::lowerCase(
|
||||||
= Misc::StringUtils::lowerCase(cell.isExterior() ? ESM::Cell::sDefaultWorldspace : cell.mName);
|
(cell.isExterior() ? ESM::RefId::stringRefId(ESM::Cell::sDefaultWorldspace) : cell.mId)
|
||||||
|
.serializeText());
|
||||||
WorldspaceNavMeshInput& navMeshInput = [&]() -> WorldspaceNavMeshInput& {
|
WorldspaceNavMeshInput& navMeshInput = [&]() -> WorldspaceNavMeshInput& {
|
||||||
auto it = navMeshInputs.find(cellNameLowerCase);
|
auto it = navMeshInputs.find(cellWorldspace);
|
||||||
if (it == navMeshInputs.end())
|
if (it == navMeshInputs.end())
|
||||||
{
|
{
|
||||||
it = navMeshInputs
|
it = navMeshInputs
|
||||||
.emplace(cellNameLowerCase,
|
.emplace(cellWorldspace,
|
||||||
std::make_unique<WorldspaceNavMeshInput>(cellNameLowerCase, settings.mRecast))
|
std::make_unique<WorldspaceNavMeshInput>(cellWorldspace, settings.mRecast))
|
||||||
.first;
|
.first;
|
||||||
it->second->mTileCachedRecastMeshManager.setWorldspace(cellNameLowerCase, nullptr);
|
it->second->mTileCachedRecastMeshManager.setWorldspace(cellWorldspace, nullptr);
|
||||||
}
|
}
|
||||||
return *it->second;
|
return *it->second;
|
||||||
}();
|
}();
|
||||||
|
|
|
@ -556,7 +556,7 @@ namespace MWWorld
|
||||||
.getExterior(playerCellX, playerCellY)
|
.getExterior(playerCellX, playerCellY)
|
||||||
->getCell()
|
->getCell()
|
||||||
->getWorldSpace()
|
->getWorldSpace()
|
||||||
.getRefIdString()),
|
.serializeText()),
|
||||||
navigatorUpdateGuard.get());
|
navigatorUpdateGuard.get());
|
||||||
mNavigator.updateBounds(pos, navigatorUpdateGuard.get());
|
mNavigator.updateBounds(pos, navigatorUpdateGuard.get());
|
||||||
|
|
||||||
|
@ -677,8 +677,8 @@ namespace MWWorld
|
||||||
"Testing exterior cells (" + std::to_string(i) + "/" + std::to_string(cells.getExtSize()) + ")...");
|
"Testing exterior cells (" + std::to_string(i) + "/" + std::to_string(cells.getExtSize()) + ")...");
|
||||||
|
|
||||||
CellStore* cell = mWorld.getWorldModel().getExterior(it->mData.mX, it->mData.mY);
|
CellStore* cell = mWorld.getWorldModel().getExterior(it->mData.mX, it->mData.mY);
|
||||||
mNavigator.setWorldspace(
|
mNavigator.setWorldspace(Misc::StringUtils::lowerCase(cell->getCell()->getWorldSpace().serializeText()),
|
||||||
Misc::StringUtils::lowerCase(cell->getCell()->getWorldSpace().toString()), navigatorUpdateGuard.get());
|
navigatorUpdateGuard.get());
|
||||||
const osg::Vec3f position
|
const osg::Vec3f position
|
||||||
= osg::Vec3f(it->mData.mX + 0.5f, it->mData.mY + 0.5f, 0) * Constants::CellSizeInUnits;
|
= osg::Vec3f(it->mData.mX + 0.5f, it->mData.mY + 0.5f, 0) * Constants::CellSizeInUnits;
|
||||||
mNavigator.updateBounds(position, navigatorUpdateGuard.get());
|
mNavigator.updateBounds(position, navigatorUpdateGuard.get());
|
||||||
|
@ -735,8 +735,8 @@ namespace MWWorld
|
||||||
"Testing interior cells (" + std::to_string(i) + "/" + std::to_string(cells.getIntSize()) + ")...");
|
"Testing interior cells (" + std::to_string(i) + "/" + std::to_string(cells.getIntSize()) + ")...");
|
||||||
|
|
||||||
CellStore* cell = mWorld.getWorldModel().getInterior(it->mName);
|
CellStore* cell = mWorld.getWorldModel().getInterior(it->mName);
|
||||||
mNavigator.setWorldspace(
|
mNavigator.setWorldspace(Misc::StringUtils::lowerCase(cell->getCell()->getWorldSpace().serializeText()),
|
||||||
Misc::StringUtils::lowerCase(cell->getCell()->getWorldSpace().toString()), navigatorUpdateGuard.get());
|
navigatorUpdateGuard.get());
|
||||||
ESM::Position position;
|
ESM::Position position;
|
||||||
mWorld.findInteriorPosition(it->mName, position);
|
mWorld.findInteriorPosition(it->mName, position);
|
||||||
mNavigator.updateBounds(position.asVec3(), navigatorUpdateGuard.get());
|
mNavigator.updateBounds(position.asVec3(), navigatorUpdateGuard.get());
|
||||||
|
@ -892,7 +892,7 @@ namespace MWWorld
|
||||||
loadingListener->setProgressRange(cell->count());
|
loadingListener->setProgressRange(cell->count());
|
||||||
|
|
||||||
mNavigator.setWorldspace(
|
mNavigator.setWorldspace(
|
||||||
Misc::StringUtils::lowerCase(cell->getCell()->getWorldSpace().toString()), navigatorUpdateGuard.get());
|
Misc::StringUtils::lowerCase(cell->getCell()->getWorldSpace().serializeText()), navigatorUpdateGuard.get());
|
||||||
mNavigator.updateBounds(position.asVec3(), navigatorUpdateGuard.get());
|
mNavigator.updateBounds(position.asVec3(), navigatorUpdateGuard.get());
|
||||||
|
|
||||||
// Load cell.
|
// Load cell.
|
||||||
|
|
Loading…
Reference in a new issue