From d927aaad14d3ce7efd8b3cc7043423450cc03915 Mon Sep 17 00:00:00 2001 From: elsid Date: Wed, 10 May 2023 20:15:04 +0200 Subject: [PATCH] Avoid redundant getCell()->getGrid* calls --- apps/openmw/mwrender/localmap.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/apps/openmw/mwrender/localmap.cpp b/apps/openmw/mwrender/localmap.cpp index f3a8791cd3..433f8092b3 100644 --- a/apps/openmw/mwrender/localmap.cpp +++ b/apps/openmw/mwrender/localmap.cpp @@ -257,16 +257,15 @@ namespace MWRender { mInterior = false; - int x = cell->getCell()->getGridX(); - int y = cell->getCell()->getGridY(); + const int x = cell->getCell()->getGridX(); + const int y = cell->getCell()->getGridY(); osg::BoundingSphere bound = mSceneRoot->getBound(); float zmin = bound.center().z() - bound.radius(); float zmax = bound.center().z() + bound.radius(); - setupRenderToTexture(cell->getCell()->getGridX(), cell->getCell()->getGridY(), - x * mMapWorldSize + mMapWorldSize / 2.f, y * mMapWorldSize + mMapWorldSize / 2.f, osg::Vec3d(0, 1, 0), zmin, - zmax); + setupRenderToTexture(x, y, x * mMapWorldSize + mMapWorldSize / 2.f, y * mMapWorldSize + mMapWorldSize / 2.f, + osg::Vec3d(0, 1, 0), zmin, zmax); if (segment.mFogOfWarImage != nullptr) return;