1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-03-06 01:19:42 +00:00

Get the world size from the ESM::Land store

This commit is contained in:
scrawl 2017-03-07 18:31:53 +01:00
parent 14225a42c6
commit 2d549d088e

View file

@ -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