MCPcopy Create free account
hub / github.com/OpenDungeons/OpenDungeons / refreshVisualDebugEntities

Method refreshVisualDebugEntities

source/entities/Creature.cpp:1753–1785  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1751}
1752
1753void Creature::refreshVisualDebugEntities(const std::vector<Tile*>& tiles)
1754{
1755 if(getIsOnServerMap())
1756 return;
1757
1758 mHasVisualDebuggingEntities = true;
1759
1760 for (Tile* tile : tiles)
1761 {
1762 // We check if the visual debug is already on this tile
1763 if(std::find(mVisualDebugEntityTiles.begin(), mVisualDebugEntityTiles.end(), tile) != mVisualDebugEntityTiles.end())
1764 continue;
1765
1766 RenderManager::getSingleton().rrCreateCreatureVisualDebug(this, tile);
1767
1768 mVisualDebugEntityTiles.push_back(tile);
1769 }
1770
1771 // now, we check if visual debug should be removed from a tile
1772 for (std::vector<Tile*>::iterator it = mVisualDebugEntityTiles.begin(); it != mVisualDebugEntityTiles.end();)
1773 {
1774 Tile* tile = *it;
1775 if(std::find(tiles.begin(), tiles.end(), tile) != tiles.end())
1776 {
1777 ++it;
1778 continue;
1779 }
1780
1781 it = mVisualDebugEntityTiles.erase(it);
1782
1783 RenderManager::getSingleton().rrDestroyCreatureVisualDebug(this, tile);
1784 }
1785}
1786
1787void Creature::stopComputeVisualDebugEntities()
1788{

Callers

nothing calls this directly

Tested by

no test coverage detected