in draw tile now we try to find tile in tile set and update it's sequenceID, and not redraw this tile

This commit is contained in:
ExMix 2013-03-18 18:35:43 +03:00 committed by Alex Zolotarev
parent b2202565dd
commit cb7ce32f23
3 changed files with 18 additions and 4 deletions

View file

@ -374,11 +374,18 @@ void TileRenderer::WaitForEmptyAndFinished()
bool TileRenderer::HasTile(Tiler::RectInfo const & rectInfo)
{
TileStructuresLockGuard guard(m_tileCache, m_tileSet);
if (m_tileSet.HasTile(rectInfo))
{
m_tileSet.SetTileSequenceID(rectInfo, m_sequenceID);
return true;
}
TileCache & tileCache = GetTileCache();
tileCache.Lock();
bool res = tileCache.HasTile(rectInfo);
tileCache.Unlock();
return res;
if (tileCache.HasTile(rectInfo))
return true;
return false;
}
void TileRenderer::SetIsPaused(bool flag)

View file

@ -26,6 +26,12 @@ int TileSet::GetTileSequenceID(Tiler::RectInfo const & rectInfo)
return m_tiles[rectInfo].m_sequenceID;
}
void TileSet::SetTileSequenceID(Tiler::RectInfo const & rectInfo, int sequenceID)
{
ASSERT(HasTile(rectInfo), ());
m_tiles[rectInfo].m_sequenceID = sequenceID;
}
void TileSet::RemoveTile(const Tiler::RectInfo &rectInfo)
{
m_tiles.erase(rectInfo);

View file

@ -26,6 +26,7 @@ public:
void AddTile(Tile const & tile);
/// get sequenceID in witch tile was rendered
int GetTileSequenceID(Tiler::RectInfo const & rectInfo);
void SetTileSequenceID(Tiler::RectInfo const & rectInfo, int sequenceID);
/// get tile from the set
Tile const & GetTile(Tiler::RectInfo const & rectInfo);
/// remove tile from the set