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

Avoid redundant lookup

This commit is contained in:
elsid 2023-05-10 20:13:47 +02:00
parent 624ffef4fe
commit 1324256440
No known key found for this signature in database
GPG Key ID: 4DE04C198CBA7625
2 changed files with 3 additions and 6 deletions

View File

@ -194,7 +194,7 @@ namespace MWRender
MapSegment& segment = mExteriorSegments[std::make_pair(cellX, cellY)];
if (!segment.needUpdate)
return;
requestExteriorMap(cell);
requestExteriorMap(cell, segment);
segment.needUpdate = false;
}
@ -253,7 +253,7 @@ namespace MWRender
}
}
void LocalMap::requestExteriorMap(const MWWorld::CellStore* cell)
void LocalMap::requestExteriorMap(const MWWorld::CellStore* cell, MapSegment& segment)
{
mInterior = false;
@ -268,9 +268,6 @@ namespace MWRender
x * mMapWorldSize + mMapWorldSize / 2.f, y * mMapWorldSize + mMapWorldSize / 2.f, osg::Vec3d(0, 1, 0), zmin,
zmax);
MapSegment& segment
= mExteriorSegments[std::make_pair(cell->getCell()->getGridX(), cell->getCell()->getGridY())];
if (segment.mFogOfWarImage != nullptr)
return;

View File

@ -143,7 +143,7 @@ namespace MWRender
float mAngle;
const osg::Vec2f rotatePoint(const osg::Vec2f& point, const osg::Vec2f& center, const float angle);
void requestExteriorMap(const MWWorld::CellStore* cell);
void requestExteriorMap(const MWWorld::CellStore* cell, MapSegment& segment);
void requestInteriorMap(const MWWorld::CellStore* cell);
void setupRenderToTexture(