mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-02-22 12:39:59 +00:00
Merge branch 'Map-door-markers-flicker-in-some-cells' into 'master'
Do not update doors markers at each frame, only when needed Closes #6214 See merge request OpenMW/openmw!1168
This commit is contained in:
commit
d852b10227
@ -192,6 +192,7 @@ namespace MWGui
|
||||
, mMarkerUpdateTimer(0.0f)
|
||||
, mLastDirectionX(0.0f)
|
||||
, mLastDirectionY(0.0f)
|
||||
, mNeedDoorMarkersUpdate(false)
|
||||
{
|
||||
mCustomMarkers.eventMarkersChanged += MyGUI::newDelegate(this, &LocalMapBase::updateCustomMarkers);
|
||||
}
|
||||
@ -440,6 +441,10 @@ namespace MWGui
|
||||
}
|
||||
}
|
||||
|
||||
// Delay the door markers update until scripts have been given a chance to run.
|
||||
// If we don't do this, door markers that should be disabled will still appear on the map.
|
||||
mNeedDoorMarkersUpdate = true;
|
||||
|
||||
for (MyGUI::Widget* widget : currentDoorMarkersWidgets())
|
||||
widget->setCoord(getMarkerCoordinates(widget, 8));
|
||||
|
||||
@ -544,7 +549,11 @@ namespace MWGui
|
||||
|
||||
void LocalMapBase::onFrame(float dt)
|
||||
{
|
||||
updateDoorMarkers();
|
||||
if (mNeedDoorMarkersUpdate)
|
||||
{
|
||||
updateDoorMarkers();
|
||||
mNeedDoorMarkersUpdate = false;
|
||||
}
|
||||
|
||||
mMarkerUpdateTimer += dt;
|
||||
|
||||
@ -950,6 +959,9 @@ namespace MWGui
|
||||
zoomOnCursor(zoomRatio);
|
||||
return; //the zoom out is too big, we switch to the global map
|
||||
}
|
||||
|
||||
if (zoomOut)
|
||||
mNeedDoorMarkersUpdate = true;
|
||||
}
|
||||
zoomOnCursor(speedDiff);
|
||||
}
|
||||
@ -1172,7 +1184,10 @@ namespace MWGui
|
||||
MyGUI::IntPoint diff = MyGUI::IntPoint(_left, _top) - mLastDragPos;
|
||||
|
||||
if (!mGlobal)
|
||||
{
|
||||
mNeedDoorMarkersUpdate = true;
|
||||
mLocalMap->setViewOffset( mLocalMap->getViewOffset() + diff );
|
||||
}
|
||||
else
|
||||
mGlobalMap->setViewOffset( mGlobalMap->getViewOffset() + diff );
|
||||
|
||||
|
@ -187,6 +187,8 @@ namespace MWGui
|
||||
float mLastDirectionX;
|
||||
float mLastDirectionY;
|
||||
|
||||
bool mNeedDoorMarkersUpdate;
|
||||
|
||||
private:
|
||||
void updateDoorMarkers();
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user