//********************************************************* void CDisplayerVisualActivitySequence::setWorldMapNumEdges(uint count) { //H_AUTO(R2_CDisplayerVisualActivitySequence_setWorldMapNumEdges) // TODO nico : try to factor with CPrimRender::setWorldMapNumEdges nlassert(_AddedToWorldMap); CGroupMap *gm = CTool::getWorldMap(); nlassert(gm); if (count < _WorldMapEdges.size()) { for(uint k = count; k < _WorldMapEdges.size(); ++k) { gm->delCtrl(_WorldMapEdges[k]); } } else { uint left = count - (uint)_WorldMapEdges.size(); while (left --) { CCtrlQuad *cq = new CCtrlQuad; cq->setModulateGlobalColor(false); cq->setActive(true); gm->addCtrl(cq); cq->setParent(gm); cq->setRenderLayer(1); _WorldMapEdges.push_back(cq); } } _WorldMapEdges.resize(count); for(uint k = 0; k < count; ++k) { _WorldMapEdges[k]->setTexture(CV_FootStepMapTexture.get()); } }
//********************************************************************************************************* CCtrlQuad *CInstanceMapDeco::newQuad(CGroupMap &owner) { //H_AUTO(R2_CInstanceMapDeco_newQuad) nlassert(_Instance); CCtrlQuad *q = new CCtrlQuad; q->setActive(false); q->setModulateGlobalColor(false); owner.addCtrl(q); q->setParent(&owner); return q; }
// ********************************************************* void CPrimRender::setWorldMapNumEdges(uint count) { //H_AUTO(R2_CPrimRender_setWorldMapNumEdges) nlassert(_AddedToWorldMap); CGroupMap *gm = CTool::getWorldMap(); nlassert(gm); if (count < _WorldMapEdges.size()) { for(uint k = count; k < _WorldMapEdges.size(); ++k) { gm->delCtrl(_WorldMapEdges[k]); } } else { uint left = count - (uint)_WorldMapEdges.size(); while (left --) { CCtrlQuad *cq = newCtrlQuad((uint)_WorldMapEdges.size()); cq->setModulateGlobalColor(false); cq->setActive(_Active); gm->addCtrl(cq); cq->setParent(gm); cq->setRenderLayer(1); _WorldMapEdges.push_back(cq); if (_WorldMapPoly) { cq->setId(_WorldMapPoly->getId() + toString("_e%d", _WorldMapEdges.size() - 1)); } } } _WorldMapEdges.resize(count); for(uint k = 0; k < count; ++k) { _WorldMapEdges[k]->setTexture(_Look.EdgeLook.WorldMapTexture); _WorldMapEdges[k]->setColorRGBA(_Look.EdgeLook.WorldMapColor); } }