Get the world size from the ESM::Land store

pull/1225/head
scrawl 8 years ago
parent 14225a42c6
commit 2d549d088e

@ -31,17 +31,17 @@ namespace MWRender
const MWWorld::ESMStore &esmStore =
MWBase::Environment::get().getWorld()->getStore();
MWWorld::Store<ESM::Cell>::iterator it = esmStore.get<ESM::Cell>().extBegin();
for (; it != esmStore.get<ESM::Cell>().extEnd(); ++it)
MWWorld::Store<ESM::Land>::iterator it = esmStore.get<ESM::Land>().begin();
for (; it != esmStore.get<ESM::Land>().end(); ++it)
{
if (it->getGridX() < minX)
minX = static_cast<float>(it->getGridX());
if (it->getGridX() > maxX)
maxX = static_cast<float>(it->getGridX());
if (it->getGridY() < minY)
minY = static_cast<float>(it->getGridY());
if (it->getGridY() > maxY)
maxY = static_cast<float>(it->getGridY());
if (it->mX < minX)
minX = static_cast<float>(it->mX);
if (it->mX > maxX)
maxX = static_cast<float>(it->mX);
if (it->mY < minY)
minY = static_cast<float>(it->mY);
if (it->mY > maxY)
maxY = static_cast<float>(it->mY);
}
// since grid coords are at cell origin, we need to add 1 cell

Loading…
Cancel
Save