mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-09-23 20:00:45 -04:00
Remove rendered segments outside the map grid again
This commit is contained in:
parent
d6ce23aba7
commit
50601b7733
@ -390,7 +390,7 @@ namespace MWGui
|
|||||||
const int x = cell.getGridX();
|
const int x = cell.getGridX();
|
||||||
const int y = cell.getGridY();
|
const int y = cell.getGridY();
|
||||||
|
|
||||||
MyGUI::IntSize oldSize{ mGrid.width(), mGrid.height() };
|
const MyGUI::IntRect prevGrid = mGrid;
|
||||||
|
|
||||||
if (cell.isExterior())
|
if (cell.isExterior())
|
||||||
{
|
{
|
||||||
@ -423,6 +423,18 @@ namespace MWGui
|
|||||||
++it;
|
++it;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (mActiveCell && mActiveCell->isExterior())
|
||||||
|
{
|
||||||
|
for (int cx = prevGrid.left; cx <= prevGrid.right; ++cx)
|
||||||
|
{
|
||||||
|
for (int cy = prevGrid.top; cy <= prevGrid.bottom; ++cy)
|
||||||
|
{
|
||||||
|
if (!mGrid.inside({ cx, cy }))
|
||||||
|
mLocalMapRender->removeExteriorCell(cx, cy);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -470,7 +482,7 @@ namespace MWGui
|
|||||||
resetEntry(mMaps[i], false, nullptr);
|
resetEntry(mMaps[i], false, nullptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (oldSize != MyGUI::IntSize{ mGrid.width(), mGrid.height() })
|
if (prevGrid.width() != mGrid.width() || prevGrid.height() != mGrid.height())
|
||||||
setCanvasSize(mLocalMap, mGrid, getWidgetSize());
|
setCanvasSize(mLocalMap, mGrid, getWidgetSize());
|
||||||
|
|
||||||
// Delay the door markers update until scripts have been given a chance to run.
|
// Delay the door markers update until scripts have been given a chance to run.
|
||||||
|
@ -206,13 +206,16 @@ namespace MWRender
|
|||||||
std::make_pair(cell->getCell()->getGridX(), cell->getCell()->getGridY()), MapSegment{});
|
std::make_pair(cell->getCell()->getGridX(), cell->getCell()->getGridY()), MapSegment{});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void LocalMap::removeExteriorCell(int x, int y)
|
||||||
|
{
|
||||||
|
mExteriorSegments.erase({ x, y });
|
||||||
|
}
|
||||||
|
|
||||||
void LocalMap::removeCell(MWWorld::CellStore* cell)
|
void LocalMap::removeCell(MWWorld::CellStore* cell)
|
||||||
{
|
{
|
||||||
saveFogOfWar(cell);
|
saveFogOfWar(cell);
|
||||||
|
|
||||||
if (cell->isExterior())
|
if (!cell->isExterior())
|
||||||
mExteriorSegments.erase({ cell->getCell()->getGridX(), cell->getCell()->getGridY() });
|
|
||||||
else
|
|
||||||
mInteriorSegments.clear();
|
mInteriorSegments.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -301,6 +304,7 @@ namespace MWRender
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
mInterior = true;
|
mInterior = true;
|
||||||
|
mExteriorSegments.clear();
|
||||||
|
|
||||||
mBounds = bounds;
|
mBounds = bounds;
|
||||||
|
|
||||||
|
@ -55,6 +55,7 @@ namespace MWRender
|
|||||||
void requestMap(const MWWorld::CellStore* cell);
|
void requestMap(const MWWorld::CellStore* cell);
|
||||||
|
|
||||||
void addCell(MWWorld::CellStore* cell);
|
void addCell(MWWorld::CellStore* cell);
|
||||||
|
void removeExteriorCell(int x, int y);
|
||||||
|
|
||||||
void removeCell(MWWorld::CellStore* cell);
|
void removeCell(MWWorld::CellStore* cell);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user