1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-02-21 11:09:43 +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);
}
void RenderingManager::enableTerrain(bool enable)
void RenderingManager::enableTerrain(bool enable, ESM::RefId worldspace)
{
if (!enable)
mWater->setCullCallback(nullptr);
else
mTerrain = getWorldspaceTerrain(worldspace);
mTerrain->enable(enable);
}

View file

@ -150,7 +150,7 @@ namespace MWRender
void addCell(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);

View file

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