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

Method refreshVisualDebugEntities

source/game/Seat.cpp:657–689  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

655}
656
657void Seat::refreshVisualDebugEntities(const std::vector<Tile*>& tiles)
658{
659 if(mGameMap->isServerGameMap())
660 return;
661
662 mIsDebuggingVision = true;
663
664 for (Tile* tile : tiles)
665 {
666 // We check if the visual debug is already on this tile
667 if(std::find(mVisualDebugEntityTiles.begin(), mVisualDebugEntityTiles.end(), tile) != mVisualDebugEntityTiles.end())
668 continue;
669
670 RenderManager::getSingleton().rrCreateSeatVisionVisualDebug(getId(), tile);
671
672 mVisualDebugEntityTiles.push_back(tile);
673 }
674
675 // now, we check if visual debug should be removed from a tile
676 for (std::vector<Tile*>::iterator it = mVisualDebugEntityTiles.begin(); it != mVisualDebugEntityTiles.end();)
677 {
678 Tile* tile = *it;
679 if(std::find(tiles.begin(), tiles.end(), tile) != tiles.end())
680 {
681 ++it;
682 continue;
683 }
684
685 it = mVisualDebugEntityTiles.erase(it);
686
687 RenderManager::getSingleton().rrDestroySeatVisionVisualDebug(getId(), tile);
688 }
689}
690
691void Seat::toggleSeatVisualDebug()
692{

Callers 1

processMessageMethod · 0.45

Tested by

no test coverage detected