summaryrefslogtreecommitdiff
path: root/src/being/localplayer.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2016-12-31 22:53:42 +0300
committerAndrei Karas <akaras@inbox.ru>2016-12-31 22:53:42 +0300
commit896d41e4b073046c59933ea8829474bd82b9c506 (patch)
tree737bbfa3381f9d0ddd8629faf29dd6dce0ca4be3 /src/being/localplayer.cpp
parent1962d62c1e209af7d61e85a4ed3675f0a16e5924 (diff)
downloadmanaverse-896d41e4b073046c59933ea8829474bd82b9c506.tar.gz
manaverse-896d41e4b073046c59933ea8829474bd82b9c506.tar.bz2
manaverse-896d41e4b073046c59933ea8829474bd82b9c506.tar.xz
manaverse-896d41e4b073046c59933ea8829474bd82b9c506.zip
Improve special layers draw speed in same way like fringe layer.
Diffstat (limited to 'src/being/localplayer.cpp')
-rw-r--r--src/being/localplayer.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/being/localplayer.cpp b/src/being/localplayer.cpp
index 9af1371bf..8bb049489 100644
--- a/src/being/localplayer.cpp
+++ b/src/being/localplayer.cpp
@@ -1811,6 +1811,7 @@ void LocalPlayer::setHome()
{
specialLayer->setTile(CAST_S32(pos.x),
CAST_S32(pos.y), MapItemType::EMPTY);
+ specialLayer->updateCache();
}
pos.x = static_cast<float>(mX);
@@ -1872,6 +1873,7 @@ void LocalPlayer::setHome()
else
{
specialLayer->setTile(mX, mY, MapItemType::EMPTY);
+ specialLayer->updateCache();
socialWindow->removePortal(mX, mY);
}
}
@@ -2083,7 +2085,7 @@ void LocalPlayer::navigateClean()
mNavigatePath.clear();
- const SpecialLayer *const tmpLayer = mMap->getTempLayer();
+ SpecialLayer *const tmpLayer = mMap->getTempLayer();
if (!tmpLayer)
return;
@@ -2553,6 +2555,7 @@ void LocalPlayer::setRealPos(const int x, const int y)
return;
SpecialLayer *const layer = mMap->getTempLayer();
+ bool cacheUpdated(false);
if (layer)
{
if ((mCrossX || mCrossY) &&
@@ -2560,6 +2563,8 @@ void LocalPlayer::setRealPos(const int x, const int y)
layer->getTile(mCrossX, mCrossY)->getType() == MapItemType::CROSS)
{
layer->setTile(mCrossX, mCrossY, MapItemType::EMPTY);
+ layer->updateCache();
+ cacheUpdated = true;
}
if (mShowServerPos)
@@ -2569,7 +2574,11 @@ void LocalPlayer::setRealPos(const int x, const int y)
if (!mapItem || mapItem->getType() == MapItemType::EMPTY)
{
if (mX != x && mY != y)
+ {
layer->setTile(x, y, MapItemType::CROSS);
+ if (cacheUpdated == false)
+ layer->updateCache();
+ }
}
}