1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-02-25 03:40:40 +00:00

enable terrain takes a worldspace as input

enable terrain anslo switches the worldspace.
This commit is contained in:
florent.teppe 2023-05-14 22:00:13 +02:00
parent 1b718f09c5
commit e09cf6ac61
3 changed files with 5 additions and 3 deletions

View File

@ -762,10 +762,12 @@ namespace MWRender
mWater->removeCell(store); mWater->removeCell(store);
} }
void RenderingManager::enableTerrain(bool enable) void RenderingManager::enableTerrain(bool enable, ESM::RefId worldspace)
{ {
if (!enable) if (!enable)
mWater->setCullCallback(nullptr); mWater->setCullCallback(nullptr);
else
mTerrain = getWorldspaceTerrain(worldspace);
mTerrain->enable(enable); mTerrain->enable(enable);
} }

View File

@ -150,7 +150,7 @@ namespace MWRender
void addCell(const MWWorld::CellStore* store); void addCell(const MWWorld::CellStore* store);
void removeCell(const MWWorld::CellStore* store); void removeCell(const MWWorld::CellStore* store);
void enableTerrain(bool enable); void enableTerrain(bool enable, ESM::RefId worldspace);
void updatePtr(const MWWorld::Ptr& old, const MWWorld::Ptr& updated); void updatePtr(const MWWorld::Ptr& old, const MWWorld::Ptr& updated);

View File

@ -784,7 +784,7 @@ namespace MWWorld
mHalfGridSize = cell.getCell()->isEsm4() ? Constants::ESM4CellGridRadius : Constants::CellGridRadius; mHalfGridSize = cell.getCell()->isEsm4() ? Constants::ESM4CellGridRadius : Constants::CellGridRadius;
mCurrentCell = &cell; mCurrentCell = &cell;
mRendering.enableTerrain(cell.isExterior()); mRendering.enableTerrain(cell.isExterior(), cell.getCell()->getWorldSpace());
MWWorld::Ptr old = mWorld.getPlayerPtr(); MWWorld::Ptr old = mWorld.getPlayerPtr();
mWorld.getPlayer().setCell(&cell); mWorld.getPlayer().setCell(&cell);